diff --git a/cloudfunctions/v2alpha/cloudfunctions-api.json b/cloudfunctions/v2alpha/cloudfunctions-api.json index c7565aaf597..c4fd724219d 100644 --- a/cloudfunctions/v2alpha/cloudfunctions-api.json +++ b/cloudfunctions/v2alpha/cloudfunctions-api.json @@ -571,7 +571,7 @@ } } }, - "revision": "20220511", + "revision": "20220622", "rootUrl": "https://cloudfunctions.googleapis.com/", "schemas": { "AuditConfig": { @@ -784,7 +784,7 @@ "type": "object" }, "Function": { - "description": "Describes a Cloud Function that contains user computation executed in response to an event. It encapsulate function and triggers configurations.", + "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": { diff --git a/cloudfunctions/v2alpha/cloudfunctions-gen.go b/cloudfunctions/v2alpha/cloudfunctions-gen.go index 615b6e8f922..fc03febdfe1 100644 --- a/cloudfunctions/v2alpha/cloudfunctions-gen.go +++ b/cloudfunctions/v2alpha/cloudfunctions-gen.go @@ -620,8 +620,8 @@ func (s *Expr) MarshalJSON() ([]byte, error) { } // Function: Describes a Cloud Function that contains user computation -// executed in response to an event. It encapsulate function and -// triggers configurations. +// 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. diff --git a/cloudfunctions/v2beta/cloudfunctions-api.json b/cloudfunctions/v2beta/cloudfunctions-api.json index c9dcd466918..a779b59fa80 100644 --- a/cloudfunctions/v2beta/cloudfunctions-api.json +++ b/cloudfunctions/v2beta/cloudfunctions-api.json @@ -571,7 +571,7 @@ } } }, - "revision": "20220511", + "revision": "20220622", "rootUrl": "https://cloudfunctions.googleapis.com/", "schemas": { "AuditConfig": { @@ -784,7 +784,7 @@ "type": "object" }, "Function": { - "description": "Describes a Cloud Function that contains user computation executed in response to an event. It encapsulate function and triggers configurations.", + "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": { diff --git a/cloudfunctions/v2beta/cloudfunctions-gen.go b/cloudfunctions/v2beta/cloudfunctions-gen.go index b41503ff8ba..f2f98ac00c7 100644 --- a/cloudfunctions/v2beta/cloudfunctions-gen.go +++ b/cloudfunctions/v2beta/cloudfunctions-gen.go @@ -620,8 +620,8 @@ func (s *Expr) MarshalJSON() ([]byte, error) { } // Function: Describes a Cloud Function that contains user computation -// executed in response to an event. It encapsulate function and -// triggers configurations. +// 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. diff --git a/container/v1/container-api.json b/container/v1/container-api.json index 3c4de59969c..0e007a69e27 100644 --- a/container/v1/container-api.json +++ b/container/v1/container-api.json @@ -730,6 +730,34 @@ "resources": { "nodePools": { "methods": { + "completeUpgrade": { + "description": "CompleteNodePoolUpgrade will signal an on-going node pool upgrade to complete.", + "flatPath": "v1/projects/{projectsId}/locations/{locationsId}/clusters/{clustersId}/nodePools/{nodePoolsId}:completeUpgrade", + "httpMethod": "POST", + "id": "container.projects.locations.clusters.nodePools.completeUpgrade", + "parameterOrder": [ + "name" + ], + "parameters": { + "name": { + "description": "The name (project, location, cluster, node pool id) of the node pool to complete upgrade. Specified in the format 'projects/*/locations/*/clusters/*/nodePools/*'.", + "location": "path", + "pattern": "^projects/[^/]+/locations/[^/]+/clusters/[^/]+/nodePools/[^/]+$", + "required": true, + "type": "string" + } + }, + "path": "v1/{+name}:completeUpgrade", + "request": { + "$ref": "CompleteNodePoolUpgradeRequest" + }, + "response": { + "$ref": "Empty" + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform" + ] + }, "create": { "description": "Creates a node pool for a cluster.", "flatPath": "v1/projects/{projectsId}/locations/{locationsId}/clusters/{clustersId}/nodePools", @@ -2459,7 +2487,7 @@ } } }, - "revision": "20220610", + "revision": "20220615", "rootUrl": "https://container.googleapis.com/", "schemas": { "AcceleratorConfig": { @@ -2669,6 +2697,75 @@ }, "type": "object" }, + "BlueGreenInfo": { + "description": "Information relevant to blue-green upgrade.", + "id": "BlueGreenInfo", + "properties": { + "blueInstanceGroupUrls": { + "description": "The resource URLs of the [managed instance groups] (/compute/docs/instance-groups/creating-groups-of-managed-instances) associated with blue pool.", + "items": { + "type": "string" + }, + "type": "array" + }, + "bluePoolDeletionStartTime": { + "description": "Time to start deleting blue pool to complete blue-green upgrade, in [RFC3339](https://www.ietf.org/rfc/rfc3339.txt) text format.", + "type": "string" + }, + "greenInstanceGroupUrls": { + "description": "The resource URLs of the [managed instance groups] (/compute/docs/instance-groups/creating-groups-of-managed-instances) associated with green pool.", + "items": { + "type": "string" + }, + "type": "array" + }, + "greenPoolVersion": { + "description": "Version of green pool.", + "type": "string" + }, + "phase": { + "description": "Current blue-green upgrade phase.", + "enum": [ + "PHASE_UNSPECIFIED", + "UPDATE_STARTED", + "CREATING_GREEN_POOL", + "CORDONING_BLUE_POOL", + "DRAINING_BLUE_POOL", + "NODE_POOL_SOAKING", + "DELETING_BLUE_POOL", + "ROLLBACK_STARTED" + ], + "enumDescriptions": [ + "Unspecified phase.", + "blue-green upgrade has been initiated.", + "Start creating green pool nodes.", + "Start cordoning blue pool nodes.", + "Start draining blue pool nodes.", + "Start soaking time after draining entire blue pool.", + "Start deleting blue nodes.", + "Rollback has been initiated." + ], + "type": "string" + } + }, + "type": "object" + }, + "BlueGreenSettings": { + "description": "Settings for blue-green upgrade.", + "id": "BlueGreenSettings", + "properties": { + "nodePoolSoakDuration": { + "description": "Time needed after draining entire blue pool. After this period, blue pool will be cleaned up.", + "format": "google-duration", + "type": "string" + }, + "standardRolloutPolicy": { + "$ref": "StandardRolloutPolicy", + "description": "Standard policy for the blue-green upgrade." + } + }, + "type": "object" + }, "CancelOperationRequest": { "description": "CancelOperationRequest cancels a single operation.", "id": "CancelOperationRequest", @@ -3265,6 +3362,12 @@ }, "type": "object" }, + "CompleteNodePoolUpgradeRequest": { + "description": "CompleteNodePoolUpgradeRequest sets the name of target node pool to complete upgrade.", + "id": "CompleteNodePoolUpgradeRequest", + "properties": {}, + "type": "object" + }, "ConfidentialNodes": { "description": "ConfidentialNodes is configuration for the confidential nodes feature, which makes nodes run on confidential VMs.", "id": "ConfidentialNodes", @@ -4105,11 +4208,17 @@ "items": { "enum": [ "COMPONENT_UNSPECIFIED", - "SYSTEM_COMPONENTS" + "SYSTEM_COMPONENTS", + "APISERVER", + "SCHEDULER", + "CONTROLLER_MANAGER" ], "enumDescriptions": [ "Default value. This shouldn't be used.", - "system components" + "system components", + "kube-apiserver", + "kube-scheduler", + "kube-controller-manager" ], "type": "string" }, @@ -4406,7 +4515,7 @@ "properties": { "gcfsConfig": { "$ref": "GcfsConfig", - "description": "GCFS (Google Container File System, a.k.a Riptide) options." + "description": "GCFS (Google Container File System, a.k.a. Riptide) options." } }, "type": "object" @@ -4516,7 +4625,7 @@ "type": "integer" }, "instanceGroupUrls": { - "description": "[Output only] The resource URLs of the [managed instance groups](https://cloud.google.com/compute/docs/instance-groups/creating-groups-of-managed-instances) associated with this node pool.", + "description": "[Output only] The resource URLs of the [managed instance groups](https://cloud.google.com/compute/docs/instance-groups/creating-groups-of-managed-instances) associated with this node pool. During the node pool blue-green upgrade operation, the URLs contain both blue and green resources.", "items": { "type": "string" }, @@ -4580,6 +4689,11 @@ "description": "[Output only] Deprecated. Use conditions instead. Additional information about the current status of this node pool instance, if available.", "type": "string" }, + "updateInfo": { + "$ref": "UpdateInfo", + "description": "Output only. [Output only] Update info contains relevant information during a node pool update.", + "readOnly": true + }, "upgradeSettings": { "$ref": "UpgradeSettings", "description": "Upgrade settings control disruption and speed of the upgrade." @@ -4614,6 +4728,20 @@ "description": "Is autoscaling enabled for this node pool.", "type": "boolean" }, + "locationPolicy": { + "description": "Location policy used when scaling up a nodepool.", + "enum": [ + "LOCATION_POLICY_UNSPECIFIED", + "BALANCED", + "ANY" + ], + "enumDescriptions": [ + "Not set.", + "BALANCED is a best effort policy that aims to balance the sizes of different zones.", + "ANY policy picks zones that have the highest capacity available." + ], + "type": "string" + }, "maxNodeCount": { "description": "Maximum number of nodes for one location in the NodePool. Must be \u003e= min_node_count. There has to be enough quota to scale up the cluster.", "format": "int32", @@ -4623,6 +4751,16 @@ "description": "Minimum number of nodes for one location in the NodePool. Must be \u003e= 1 and \u003c= max_node_count.", "format": "int32", "type": "integer" + }, + "totalMaxNodeCount": { + "description": "Maximum number of nodes in the node pool. Must be greater than total_min_node_count. There has to be enough quota to scale up the cluster. The total_*_node_count fields are mutually exclusive with the *_node_count fields.", + "format": "int32", + "type": "integer" + }, + "totalMinNodeCount": { + "description": "Minimum number of nodes in the node pool. Must be greater than 1 less than total_max_node_count. The total_*_node_count fields are mutually exclusive with the *_node_count fields.", + "format": "int32", + "type": "integer" } }, "type": "object" @@ -5095,6 +5233,10 @@ "description": "Deprecated. The Google Developers Console [project ID or project number](https://cloud.google.com/resource-manager/docs/creating-managing-projects). This field has been deprecated and replaced by the name field.", "type": "string" }, + "respectPdb": { + "description": "Option for rollback to ignore the PodDisruptionBudget. Default value is false.", + "type": "boolean" + }, "zone": { "description": "Deprecated. The name of the Google Compute Engine [zone](https://cloud.google.com/compute/docs/zones#available) in which the cluster resides. This field has been deprecated and replaced by the name field.", "type": "string" @@ -5620,6 +5762,28 @@ }, "type": "object" }, + "StandardRolloutPolicy": { + "description": "Standard rollout policy is the default policy for blue-green.", + "id": "StandardRolloutPolicy", + "properties": { + "batchNodeCount": { + "description": "Number of blue nodes to drain in a batch.", + "format": "int32", + "type": "integer" + }, + "batchPercentage": { + "description": "Percentage of the bool pool nodes to drain in a batch. The range of this field should be (0.0, 1.0].", + "format": "float", + "type": "number" + }, + "batchSoakDuration": { + "description": "Soak time after each batch gets drained. Default to zero.", + "format": "google-duration", + "type": "string" + } + }, + "type": "object" + }, "StartIPRotationRequest": { "description": "StartIPRotationRequest creates a new IP for the cluster and then performs a node upgrade on each node pool to point to the new IP.", "id": "StartIPRotationRequest", @@ -5797,6 +5961,17 @@ }, "type": "object" }, + "UpdateInfo": { + "description": "UpdateInfo contains resource (instance groups, etc), status and other intermediate information relevant to a node pool upgrade.", + "id": "UpdateInfo", + "properties": { + "blueGreenInfo": { + "$ref": "BlueGreenInfo", + "description": "Information of a blue-green upgrade." + } + }, + "type": "object" + }, "UpdateMasterRequest": { "description": "UpdateMasterRequest updates the master of the cluster.", "id": "UpdateMasterRequest", @@ -5871,6 +6046,10 @@ "description": "The name (project, location, cluster, node pool) of the node pool to update. Specified in the format `projects/*/locations/*/clusters/*/nodePools/*`.", "type": "string" }, + "nodeNetworkConfig": { + "$ref": "NodeNetworkConfig", + "description": "Node network config." + }, "nodePoolId": { "description": "Deprecated. The name of the node pool to upgrade. This field has been deprecated and replaced by the name field.", "type": "string" @@ -5982,9 +6161,13 @@ "type": "object" }, "UpgradeSettings": { - "description": "These upgrade settings control the level of parallelism and the level of disruption caused by an upgrade. maxUnavailable controls the number of nodes that can be simultaneously unavailable. maxSurge controls the number of additional nodes that can be added to the node pool temporarily for the time of the upgrade to increase the number of available nodes. (maxUnavailable + maxSurge) determines the level of parallelism (how many nodes are being upgraded at the same time). Note: upgrades inevitably introduce some disruption since workloads need to be moved from old nodes to new, upgraded ones. Even if maxUnavailable=0, this holds true. (Disruption stays within the limits of PodDisruptionBudget, if it is configured.) Consider a hypothetical node pool with 5 nodes having maxSurge=2, maxUnavailable=1. This means the upgrade process upgrades 3 nodes simultaneously. It creates 2 additional (upgraded) nodes, then it brings down 3 old (not yet upgraded) nodes at the same time. This ensures that there are always at least 4 nodes available.", + "description": "These upgrade settings control the level of parallelism and the level of disruption caused by an upgrade. maxUnavailable controls the number of nodes that can be simultaneously unavailable. maxSurge controls the number of additional nodes that can be added to the node pool temporarily for the time of the upgrade to increase the number of available nodes. (maxUnavailable + maxSurge) determines the level of parallelism (how many nodes are being upgraded at the same time). Note: upgrades inevitably introduce some disruption since workloads need to be moved from old nodes to new, upgraded ones. Even if maxUnavailable=0, this holds true. (Disruption stays within the limits of PodDisruptionBudget, if it is configured.) Consider a hypothetical node pool with 5 nodes having maxSurge=2, maxUnavailable=1. This means the upgrade process upgrades 3 nodes simultaneously. It creates 2 additional (upgraded) nodes, then it brings down 3 old (not yet upgraded) nodes at the same time. This ensures that there are always at least 4 nodes available. These upgrade settings configure the upgrade strategy for the node pool. Use strategy to switch between the strategies applied to the node pool. If the strategy is ROLLING, use max_surge and max_unavailable to control the level of parallelism and the level of disruption caused by upgrade. 1. maxSurge controls the number of additional nodes that can be added to the node pool temporarily for the time of the upgrade to increase the number of available nodes. 2. maxUnavailable controls the number of nodes that can be simultaneously unavailable. 3. (maxUnavailable + maxSurge) determines the level of parallelism (how many nodes are being upgraded at the same time). If the strategy is BLUE_GREEN, use blue_green_settings to configure the blue-green upgrade related settings. 1. standard_rollout_policy is the default policy. The policy is used to control the way blue pool gets drained. The draining is executed in the batch mode. The batch size could be specified as either percentage of the node pool size or the number of nodes. batch_soak_duration is the soak time after each batch gets drained. 2. node_pool_soak_duration is the soak time after all blue nodes are drained. After this period, the blue pool nodes will be deleted.", "id": "UpgradeSettings", "properties": { + "blueGreenSettings": { + "$ref": "BlueGreenSettings", + "description": "Settings for blue-green upgrade strategy." + }, "maxSurge": { "description": "The maximum number of nodes that can be created beyond the current size of the node pool during the upgrade process.", "format": "int32", @@ -5994,6 +6177,20 @@ "description": "The maximum number of nodes that can be simultaneously unavailable during the upgrade process. A node is considered available if its status is Ready.", "format": "int32", "type": "integer" + }, + "strategy": { + "description": "Update strategy of the node pool.", + "enum": [ + "NODE_POOL_UPDATE_STRATEGY_UNSPECIFIED", + "BLUE_GREEN", + "SURGE" + ], + "enumDescriptions": [ + "Default value.", + "blue-green upgrade.", + "SURGE is the traditional way of upgrade a node pool. max_surge and max_unavailable determines the level of upgrade parallelism." + ], + "type": "string" } }, "type": "object" diff --git a/container/v1/container-gen.go b/container/v1/container-gen.go index c7207c6e9d6..b0d12492b3b 100644 --- a/container/v1/container-gen.go +++ b/container/v1/container-gen.go @@ -677,6 +677,101 @@ func (s *BinaryAuthorization) MarshalJSON() ([]byte, error) { return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) } +// BlueGreenInfo: Information relevant to blue-green upgrade. +type BlueGreenInfo struct { + // BlueInstanceGroupUrls: The resource URLs of the [managed instance + // groups] + // (/compute/docs/instance-groups/creating-groups-of-managed-instances) + // associated with blue pool. + BlueInstanceGroupUrls []string `json:"blueInstanceGroupUrls,omitempty"` + + // BluePoolDeletionStartTime: Time to start deleting blue pool to + // complete blue-green upgrade, in RFC3339 + // (https://www.ietf.org/rfc/rfc3339.txt) text format. + BluePoolDeletionStartTime string `json:"bluePoolDeletionStartTime,omitempty"` + + // GreenInstanceGroupUrls: The resource URLs of the [managed instance + // groups] + // (/compute/docs/instance-groups/creating-groups-of-managed-instances) + // associated with green pool. + GreenInstanceGroupUrls []string `json:"greenInstanceGroupUrls,omitempty"` + + // GreenPoolVersion: Version of green pool. + GreenPoolVersion string `json:"greenPoolVersion,omitempty"` + + // Phase: Current blue-green upgrade phase. + // + // Possible values: + // "PHASE_UNSPECIFIED" - Unspecified phase. + // "UPDATE_STARTED" - blue-green upgrade has been initiated. + // "CREATING_GREEN_POOL" - Start creating green pool nodes. + // "CORDONING_BLUE_POOL" - Start cordoning blue pool nodes. + // "DRAINING_BLUE_POOL" - Start draining blue pool nodes. + // "NODE_POOL_SOAKING" - Start soaking time after draining entire blue + // pool. + // "DELETING_BLUE_POOL" - Start deleting blue nodes. + // "ROLLBACK_STARTED" - Rollback has been initiated. + Phase string `json:"phase,omitempty"` + + // ForceSendFields is a list of field names (e.g. + // "BlueInstanceGroupUrls") 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. "BlueInstanceGroupUrls") 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 *BlueGreenInfo) MarshalJSON() ([]byte, error) { + type NoMethod BlueGreenInfo + raw := NoMethod(*s) + return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) +} + +// BlueGreenSettings: Settings for blue-green upgrade. +type BlueGreenSettings struct { + // NodePoolSoakDuration: Time needed after draining entire blue pool. + // After this period, blue pool will be cleaned up. + NodePoolSoakDuration string `json:"nodePoolSoakDuration,omitempty"` + + // StandardRolloutPolicy: Standard policy for the blue-green upgrade. + StandardRolloutPolicy *StandardRolloutPolicy `json:"standardRolloutPolicy,omitempty"` + + // ForceSendFields is a list of field names (e.g. + // "NodePoolSoakDuration") 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. "NodePoolSoakDuration") 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 *BlueGreenSettings) MarshalJSON() ([]byte, error) { + type NoMethod BlueGreenSettings + raw := NoMethod(*s) + return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) +} + // CancelOperationRequest: CancelOperationRequest cancels a single // operation. type CancelOperationRequest struct { @@ -1492,6 +1587,11 @@ func (s *CompleteIPRotationRequest) MarshalJSON() ([]byte, error) { return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) } +// CompleteNodePoolUpgradeRequest: CompleteNodePoolUpgradeRequest sets +// the name of target node pool to complete upgrade. +type CompleteNodePoolUpgradeRequest struct { +} + // ConfidentialNodes: ConfidentialNodes is configuration for the // confidential nodes feature, which makes nodes run on confidential // VMs. @@ -3179,6 +3279,9 @@ type MonitoringComponentConfig struct { // Possible values: // "COMPONENT_UNSPECIFIED" - Default value. This shouldn't be used. // "SYSTEM_COMPONENTS" - system components + // "APISERVER" - kube-apiserver + // "SCHEDULER" - kube-scheduler + // "CONTROLLER_MANAGER" - kube-controller-manager EnableComponents []string `json:"enableComponents,omitempty"` // ForceSendFields is a list of field names (e.g. "EnableComponents") to @@ -3645,7 +3748,7 @@ func (s *NodeConfig) MarshalJSON() ([]byte, error) { // NodeConfigDefaults: Subset of NodeConfig message that has defaults. type NodeConfigDefaults struct { - // GcfsConfig: GCFS (Google Container File System, a.k.a Riptide) + // GcfsConfig: GCFS (Google Container File System, a.k.a. Riptide) // options. GcfsConfig *GcfsConfig `json:"gcfsConfig,omitempty"` @@ -3883,7 +3986,8 @@ type NodePool struct { // InstanceGroupUrls: [Output only] The resource URLs of the managed // instance groups // (https://cloud.google.com/compute/docs/instance-groups/creating-groups-of-managed-instances) - // associated with this node pool. + // associated with this node pool. During the node pool blue-green + // upgrade operation, the URLs contain both blue and green resources. InstanceGroupUrls []string `json:"instanceGroupUrls,omitempty"` // Locations: The list of Google Compute Engine zones @@ -3942,6 +4046,10 @@ type NodePool struct { // instance, if available. StatusMessage string `json:"statusMessage,omitempty"` + // UpdateInfo: Output only. [Output only] Update info contains relevant + // information during a node pool update. + UpdateInfo *UpdateInfo `json:"updateInfo,omitempty"` + // UpgradeSettings: Upgrade settings control disruption and speed of the // upgrade. UpgradeSettings *UpgradeSettings `json:"upgradeSettings,omitempty"` @@ -4019,6 +4127,16 @@ type NodePoolAutoscaling struct { // Enabled: Is autoscaling enabled for this node pool. Enabled bool `json:"enabled,omitempty"` + // LocationPolicy: Location policy used when scaling up a nodepool. + // + // Possible values: + // "LOCATION_POLICY_UNSPECIFIED" - Not set. + // "BALANCED" - BALANCED is a best effort policy that aims to balance + // the sizes of different zones. + // "ANY" - ANY policy picks zones that have the highest capacity + // available. + LocationPolicy string `json:"locationPolicy,omitempty"` + // MaxNodeCount: Maximum number of nodes for one location in the // NodePool. Must be >= min_node_count. There has to be enough quota to // scale up the cluster. @@ -4028,6 +4146,17 @@ type NodePoolAutoscaling struct { // NodePool. Must be >= 1 and <= max_node_count. MinNodeCount int64 `json:"minNodeCount,omitempty"` + // TotalMaxNodeCount: Maximum number of nodes in the node pool. Must be + // greater than total_min_node_count. There has to be enough quota to + // scale up the cluster. The total_*_node_count fields are mutually + // exclusive with the *_node_count fields. + TotalMaxNodeCount int64 `json:"totalMaxNodeCount,omitempty"` + + // TotalMinNodeCount: Minimum number of nodes in the node pool. Must be + // greater than 1 less than total_max_node_count. The total_*_node_count + // fields are mutually exclusive with the *_node_count fields. + TotalMinNodeCount int64 `json:"totalMinNodeCount,omitempty"` + // ForceSendFields is a list of field names (e.g. "Autoprovisioned") to // unconditionally include in API requests. By default, fields with // empty or default values are omitted from API requests. However, any @@ -4764,6 +4893,10 @@ type RollbackNodePoolUpgradeRequest struct { // This field has been deprecated and replaced by the name field. ProjectId string `json:"projectId,omitempty"` + // RespectPdb: Option for rollback to ignore the PodDisruptionBudget. + // Default value is false. + RespectPdb bool `json:"respectPdb,omitempty"` + // Zone: Deprecated. The name of the Google Compute Engine zone // (https://cloud.google.com/compute/docs/zones#available) in which the // cluster resides. This field has been deprecated and replaced by the @@ -5700,6 +5833,58 @@ func (s *ShieldedNodes) MarshalJSON() ([]byte, error) { return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) } +// StandardRolloutPolicy: Standard rollout policy is the default policy +// for blue-green. +type StandardRolloutPolicy struct { + // BatchNodeCount: Number of blue nodes to drain in a batch. + BatchNodeCount int64 `json:"batchNodeCount,omitempty"` + + // BatchPercentage: Percentage of the bool pool nodes to drain in a + // batch. The range of this field should be (0.0, 1.0]. + BatchPercentage float64 `json:"batchPercentage,omitempty"` + + // BatchSoakDuration: Soak time after each batch gets drained. Default + // to zero. + BatchSoakDuration string `json:"batchSoakDuration,omitempty"` + + // ForceSendFields is a list of field names (e.g. "BatchNodeCount") 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. "BatchNodeCount") 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 *StandardRolloutPolicy) MarshalJSON() ([]byte, error) { + type NoMethod StandardRolloutPolicy + raw := NoMethod(*s) + return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) +} + +func (s *StandardRolloutPolicy) UnmarshalJSON(data []byte) error { + type NoMethod StandardRolloutPolicy + var s1 struct { + BatchPercentage gensupport.JSONFloat64 `json:"batchPercentage"` + *NoMethod + } + s1.NoMethod = (*NoMethod)(s) + if err := json.Unmarshal(data, &s1); err != nil { + return err + } + s.BatchPercentage = float64(s1.BatchPercentage) + return nil +} + // StartIPRotationRequest: StartIPRotationRequest creates a new IP for // the cluster and then performs a node upgrade on each node pool to // point to the new IP. @@ -6018,6 +6203,36 @@ func (s *UpdateClusterRequest) MarshalJSON() ([]byte, error) { return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) } +// UpdateInfo: UpdateInfo contains resource (instance groups, etc), +// status and other intermediate information relevant to a node pool +// upgrade. +type UpdateInfo struct { + // BlueGreenInfo: Information of a blue-green upgrade. + BlueGreenInfo *BlueGreenInfo `json:"blueGreenInfo,omitempty"` + + // ForceSendFields is a list of field names (e.g. "BlueGreenInfo") 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. "BlueGreenInfo") 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 *UpdateInfo) MarshalJSON() ([]byte, error) { + type NoMethod UpdateInfo + raw := NoMethod(*s) + return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) +} + // UpdateMasterRequest: UpdateMasterRequest updates the master of the // cluster. type UpdateMasterRequest struct { @@ -6119,6 +6334,9 @@ type UpdateNodePoolRequest struct { // `projects/*/locations/*/clusters/*/nodePools/*`. Name string `json:"name,omitempty"` + // NodeNetworkConfig: Node network config. + NodeNetworkConfig *NodeNetworkConfig `json:"nodeNetworkConfig,omitempty"` + // NodePoolId: Deprecated. The name of the node pool to upgrade. This // field has been deprecated and replaced by the name field. NodePoolId string `json:"nodePoolId,omitempty"` @@ -6303,8 +6521,30 @@ func (s *UpgradeEvent) MarshalJSON() ([]byte, error) { // means the upgrade process upgrades 3 nodes simultaneously. It creates // 2 additional (upgraded) nodes, then it brings down 3 old (not yet // upgraded) nodes at the same time. This ensures that there are always -// at least 4 nodes available. +// at least 4 nodes available. These upgrade settings configure the +// upgrade strategy for the node pool. Use strategy to switch between +// the strategies applied to the node pool. If the strategy is ROLLING, +// use max_surge and max_unavailable to control the level of parallelism +// and the level of disruption caused by upgrade. 1. maxSurge controls +// the number of additional nodes that can be added to the node pool +// temporarily for the time of the upgrade to increase the number of +// available nodes. 2. maxUnavailable controls the number of nodes that +// can be simultaneously unavailable. 3. (maxUnavailable + maxSurge) +// determines the level of parallelism (how many nodes are being +// upgraded at the same time). If the strategy is BLUE_GREEN, use +// blue_green_settings to configure the blue-green upgrade related +// settings. 1. standard_rollout_policy is the default policy. The +// policy is used to control the way blue pool gets drained. The +// draining is executed in the batch mode. The batch size could be +// specified as either percentage of the node pool size or the number of +// nodes. batch_soak_duration is the soak time after each batch gets +// drained. 2. node_pool_soak_duration is the soak time after all blue +// nodes are drained. After this period, the blue pool nodes will be +// deleted. type UpgradeSettings struct { + // BlueGreenSettings: Settings for blue-green upgrade strategy. + BlueGreenSettings *BlueGreenSettings `json:"blueGreenSettings,omitempty"` + // MaxSurge: The maximum number of nodes that can be created beyond the // current size of the node pool during the upgrade process. MaxSurge int64 `json:"maxSurge,omitempty"` @@ -6314,20 +6554,31 @@ type UpgradeSettings struct { // considered available if its status is Ready. MaxUnavailable int64 `json:"maxUnavailable,omitempty"` - // ForceSendFields is a list of field names (e.g. "MaxSurge") to - // unconditionally include in API requests. By default, fields with + // Strategy: Update strategy of the node pool. + // + // Possible values: + // "NODE_POOL_UPDATE_STRATEGY_UNSPECIFIED" - Default value. + // "BLUE_GREEN" - blue-green upgrade. + // "SURGE" - SURGE is the traditional way of upgrade a node pool. + // max_surge and max_unavailable determines the level of upgrade + // parallelism. + Strategy string `json:"strategy,omitempty"` + + // ForceSendFields is a list of field names (e.g. "BlueGreenSettings") + // 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. "MaxSurge") to include in - // API requests with the JSON null value. By default, fields with empty - // values are omitted from API requests. However, any field with an - // empty value appearing in NullFields will be sent to the server as - // null. It is an error if a field in this list has a non-empty value. - // This may be used to include null fields in Patch requests. + // NullFields is a list of field names (e.g. "BlueGreenSettings") 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:"-"` } @@ -9679,6 +9930,151 @@ func (c *ProjectsLocationsClustersUpdateMasterCall) Do(opts ...googleapi.CallOpt } +// method id "container.projects.locations.clusters.nodePools.completeUpgrade": + +type ProjectsLocationsClustersNodePoolsCompleteUpgradeCall struct { + s *Service + name string + completenodepoolupgraderequest *CompleteNodePoolUpgradeRequest + urlParams_ gensupport.URLParams + ctx_ context.Context + header_ http.Header +} + +// CompleteUpgrade: CompleteNodePoolUpgrade will signal an on-going node +// pool upgrade to complete. +// +// - name: The name (project, location, cluster, node pool id) of the +// node pool to complete upgrade. Specified in the format +// 'projects/*/locations/*/clusters/*/nodePools/*'. +func (r *ProjectsLocationsClustersNodePoolsService) CompleteUpgrade(name string, completenodepoolupgraderequest *CompleteNodePoolUpgradeRequest) *ProjectsLocationsClustersNodePoolsCompleteUpgradeCall { + c := &ProjectsLocationsClustersNodePoolsCompleteUpgradeCall{s: r.s, urlParams_: make(gensupport.URLParams)} + c.name = name + c.completenodepoolupgraderequest = completenodepoolupgraderequest + 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 *ProjectsLocationsClustersNodePoolsCompleteUpgradeCall) Fields(s ...googleapi.Field) *ProjectsLocationsClustersNodePoolsCompleteUpgradeCall { + 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 *ProjectsLocationsClustersNodePoolsCompleteUpgradeCall) Context(ctx context.Context) *ProjectsLocationsClustersNodePoolsCompleteUpgradeCall { + 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 *ProjectsLocationsClustersNodePoolsCompleteUpgradeCall) Header() http.Header { + if c.header_ == nil { + c.header_ = make(http.Header) + } + return c.header_ +} + +func (c *ProjectsLocationsClustersNodePoolsCompleteUpgradeCall) 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.completenodepoolupgraderequest) + if err != nil { + return nil, err + } + reqHeaders.Set("Content-Type", "application/json") + c.urlParams_.Set("alt", alt) + c.urlParams_.Set("prettyPrint", "false") + urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}:completeUpgrade") + 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 "container.projects.locations.clusters.nodePools.completeUpgrade" call. +// Exactly one of *Empty or error will be non-nil. Any non-2xx status +// code is an error. Response headers are in either +// *Empty.ServerResponse.Header or (if a response was returned at all) +// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to +// check whether the returned error was because http.StatusNotModified +// was returned. +func (c *ProjectsLocationsClustersNodePoolsCompleteUpgradeCall) Do(opts ...googleapi.CallOption) (*Empty, error) { + gensupport.SetOptions(c.urlParams_, opts...) + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &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 := &Empty{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + target := &ret + if err := gensupport.DecodeResponse(target, res); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "CompleteNodePoolUpgrade will signal an on-going node pool upgrade to complete.", + // "flatPath": "v1/projects/{projectsId}/locations/{locationsId}/clusters/{clustersId}/nodePools/{nodePoolsId}:completeUpgrade", + // "httpMethod": "POST", + // "id": "container.projects.locations.clusters.nodePools.completeUpgrade", + // "parameterOrder": [ + // "name" + // ], + // "parameters": { + // "name": { + // "description": "The name (project, location, cluster, node pool id) of the node pool to complete upgrade. Specified in the format 'projects/*/locations/*/clusters/*/nodePools/*'.", + // "location": "path", + // "pattern": "^projects/[^/]+/locations/[^/]+/clusters/[^/]+/nodePools/[^/]+$", + // "required": true, + // "type": "string" + // } + // }, + // "path": "v1/{+name}:completeUpgrade", + // "request": { + // "$ref": "CompleteNodePoolUpgradeRequest" + // }, + // "response": { + // "$ref": "Empty" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/cloud-platform" + // ] + // } + +} + // method id "container.projects.locations.clusters.nodePools.create": type ProjectsLocationsClustersNodePoolsCreateCall struct { diff --git a/dns/v1/dns-api.json b/dns/v1/dns-api.json index 4869e459f0b..2a0f9342a22 100644 --- a/dns/v1/dns-api.json +++ b/dns/v1/dns-api.json @@ -1824,7 +1824,7 @@ } } }, - "revision": "20220518", + "revision": "20220629", "rootUrl": "https://dns.googleapis.com/", "schemas": { "Change": { @@ -3282,7 +3282,7 @@ ], "enumDescriptions": [ "", - "Skip a less-specific ResponsePolicyRule and continue normal query logic. This can be used in conjunction with a wildcard to exempt a subset of the wildcard ResponsePolicyRule from the ResponsePolicy behavior and e.g., query the public internet instead. For instance, if these rules exist: *.example.com -\u003e 1.2.3.4 foo.example.com -\u003e PASSTHRU Then a query for 'foo.example.com' skips the wildcard." + "Skip a less-specific ResponsePolicyRule and continue normal query logic. This can be used with a less-specific wildcard selector to exempt a subset of the wildcard ResponsePolicyRule from the ResponsePolicy behavior and query the public Internet instead. For instance, if these rules exist: *.example.com -\u003e LocalData 1.2.3.4 foo.example.com -\u003e Behavior 'bypassResponsePolicy' Then a query for 'foo.example.com' skips the wildcard." ], "type": "string" }, diff --git a/dns/v1/dns-gen.go b/dns/v1/dns-gen.go index 6454e0bc703..11e81a7ef91 100644 --- a/dns/v1/dns-gen.go +++ b/dns/v1/dns-gen.go @@ -2811,12 +2811,13 @@ type ResponsePolicyRule struct { // Possible values: // "behaviorUnspecified" // "bypassResponsePolicy" - Skip a less-specific ResponsePolicyRule - // and continue normal query logic. This can be used in conjunction with - // a wildcard to exempt a subset of the wildcard ResponsePolicyRule from - // the ResponsePolicy behavior and e.g., query the public internet - // instead. For instance, if these rules exist: *.example.com -> 1.2.3.4 - // foo.example.com -> PASSTHRU Then a query for 'foo.example.com' skips - // the wildcard. + // and continue normal query logic. This can be used with a + // less-specific wildcard selector to exempt a subset of the wildcard + // ResponsePolicyRule from the ResponsePolicy behavior and query the + // public Internet instead. For instance, if these rules exist: + // *.example.com -> LocalData 1.2.3.4 foo.example.com -> Behavior + // 'bypassResponsePolicy' Then a query for 'foo.example.com' skips the + // wildcard. Behavior string `json:"behavior,omitempty"` // DnsName: The DNS name (wildcard or exact) to apply this rule to. Must diff --git a/dns/v1beta2/dns-api.json b/dns/v1beta2/dns-api.json index b1ad4925be3..b9255cdfe52 100644 --- a/dns/v1beta2/dns-api.json +++ b/dns/v1beta2/dns-api.json @@ -1821,7 +1821,7 @@ } } }, - "revision": "20220518", + "revision": "20220629", "rootUrl": "https://dns.googleapis.com/", "schemas": { "Change": { @@ -3330,7 +3330,7 @@ ], "enumDescriptions": [ "", - "Skip a less-specific ResponsePolicyRule and continue normal query logic. This can be used in conjunction with a wildcard to exempt a subset of the wildcard ResponsePolicyRule from the ResponsePolicy behavior and e.g., query the public internet instead. For instance, if these rules exist: *.example.com -\u003e 1.2.3.4 foo.example.com -\u003e PASSTHRU Then a query for 'foo.example.com' skips the wildcard." + "Skip a less-specific ResponsePolicyRule and continue normal query logic. This can be used with a less-specific wildcard selector to exempt a subset of the wildcard ResponsePolicyRule from the ResponsePolicy behavior and query the public Internet instead. For instance, if these rules exist: *.example.com -\u003e LocalData 1.2.3.4 foo.example.com -\u003e Behavior 'bypassResponsePolicy' Then a query for 'foo.example.com' skips the wildcard." ], "type": "string" }, diff --git a/dns/v1beta2/dns-gen.go b/dns/v1beta2/dns-gen.go index fed6faa7469..0eca81e7b72 100644 --- a/dns/v1beta2/dns-gen.go +++ b/dns/v1beta2/dns-gen.go @@ -2893,12 +2893,13 @@ type ResponsePolicyRule struct { // Possible values: // "behaviorUnspecified" // "bypassResponsePolicy" - Skip a less-specific ResponsePolicyRule - // and continue normal query logic. This can be used in conjunction with - // a wildcard to exempt a subset of the wildcard ResponsePolicyRule from - // the ResponsePolicy behavior and e.g., query the public internet - // instead. For instance, if these rules exist: *.example.com -> 1.2.3.4 - // foo.example.com -> PASSTHRU Then a query for 'foo.example.com' skips - // the wildcard. + // and continue normal query logic. This can be used with a + // less-specific wildcard selector to exempt a subset of the wildcard + // ResponsePolicyRule from the ResponsePolicy behavior and query the + // public Internet instead. For instance, if these rules exist: + // *.example.com -> LocalData 1.2.3.4 foo.example.com -> Behavior + // 'bypassResponsePolicy' Then a query for 'foo.example.com' skips the + // wildcard. Behavior string `json:"behavior,omitempty"` // DnsName: The DNS name (wildcard or exact) to apply this rule to. Must diff --git a/firestore/v1/firestore-api.json b/firestore/v1/firestore-api.json index 6fc718cc64e..de3dfc27770 100644 --- a/firestore/v1/firestore-api.json +++ b/firestore/v1/firestore-api.json @@ -132,11 +132,6 @@ "pattern": "^projects/[^/]+$", "required": true, "type": "string" - }, - "validateOnly": { - "description": "If set, validate the request and preview the response, but do not actually create the database.", - "location": "query", - "type": "boolean" } }, "path": "v1/{+parent}/databases", @@ -1358,7 +1353,7 @@ } } }, - "revision": "20220604", + "revision": "20220625", "rootUrl": "https://firestore.googleapis.com/", "schemas": { "ArrayValue": { diff --git a/firestore/v1/firestore-gen.go b/firestore/v1/firestore-gen.go index ed53e20ab51..bb51a5e7fbf 100644 --- a/firestore/v1/firestore-gen.go +++ b/firestore/v1/firestore-gen.go @@ -3711,14 +3711,6 @@ func (c *ProjectsDatabasesCreateCall) DatabaseId(databaseId string) *ProjectsDat return c } -// ValidateOnly sets the optional parameter "validateOnly": If set, -// validate the request and preview the response, but do not actually -// create the database. -func (c *ProjectsDatabasesCreateCall) ValidateOnly(validateOnly bool) *ProjectsDatabasesCreateCall { - c.urlParams_.Set("validateOnly", fmt.Sprint(validateOnly)) - return c -} - // Fields allows partial responses to be retrieved. See // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse // for more information. @@ -3829,11 +3821,6 @@ func (c *ProjectsDatabasesCreateCall) Do(opts ...googleapi.CallOption) (*GoogleL // "pattern": "^projects/[^/]+$", // "required": true, // "type": "string" - // }, - // "validateOnly": { - // "description": "If set, validate the request and preview the response, but do not actually create the database.", - // "location": "query", - // "type": "boolean" // } // }, // "path": "v1/{+parent}/databases", diff --git a/logging/v2/logging-api.json b/logging/v2/logging-api.json index 0f898b7e2b0..370a72f0369 100644 --- a/logging/v2/logging-api.json +++ b/logging/v2/logging-api.json @@ -177,72 +177,6 @@ } }, "resources": { - "buckets": { - "methods": { - "get": { - "description": "Gets a log bucket.", - "flatPath": "v2/billingAccounts/{billingAccountsId}/buckets/{bucketsId}", - "httpMethod": "GET", - "id": "logging.billingAccounts.buckets.get", - "parameterOrder": [ - "name" - ], - "parameters": { - "name": { - "description": "Required. The resource name of the bucket: \"projects/[PROJECT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]\" \"organizations/[ORGANIZATION_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]\" \"billingAccounts/[BILLING_ACCOUNT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]\" \"folders/[FOLDER_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]\" For example:\"projects/my-project/locations/global/buckets/my-bucket\"", - "location": "path", - "pattern": "^billingAccounts/[^/]+/buckets/[^/]+$", - "required": true, - "type": "string" - } - }, - "path": "v2/{+name}", - "response": { - "$ref": "LogBucket" - }, - "scopes": [ - "https://www.googleapis.com/auth/cloud-platform", - "https://www.googleapis.com/auth/cloud-platform.read-only", - "https://www.googleapis.com/auth/logging.admin", - "https://www.googleapis.com/auth/logging.read" - ] - } - }, - "resources": { - "views": { - "methods": { - "get": { - "description": "Gets a view on a log bucket..", - "flatPath": "v2/billingAccounts/{billingAccountsId}/buckets/{bucketsId}/views/{viewsId}", - "httpMethod": "GET", - "id": "logging.billingAccounts.buckets.views.get", - "parameterOrder": [ - "name" - ], - "parameters": { - "name": { - "description": "Required. The resource name of the policy: \"projects/[PROJECT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/views/[VIEW_ID]\" For example:\"projects/my-project/locations/global/buckets/my-bucket/views/my-view\"", - "location": "path", - "pattern": "^billingAccounts/[^/]+/buckets/[^/]+/views/[^/]+$", - "required": true, - "type": "string" - } - }, - "path": "v2/{+name}", - "response": { - "$ref": "LogView" - }, - "scopes": [ - "https://www.googleapis.com/auth/cloud-platform", - "https://www.googleapis.com/auth/cloud-platform.read-only", - "https://www.googleapis.com/auth/logging.admin", - "https://www.googleapis.com/auth/logging.read" - ] - } - } - } - } - }, "exclusions": { "methods": { "create": { @@ -542,6 +476,34 @@ "https://www.googleapis.com/auth/logging.admin" ] }, + "get": { + "description": "Gets a log bucket.", + "flatPath": "v2/billingAccounts/{billingAccountsId}/locations/{locationsId}/buckets/{bucketsId}", + "httpMethod": "GET", + "id": "logging.billingAccounts.locations.buckets.get", + "parameterOrder": [ + "name" + ], + "parameters": { + "name": { + "description": "Required. The resource name of the bucket: \"projects/[PROJECT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]\" \"organizations/[ORGANIZATION_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]\" \"billingAccounts/[BILLING_ACCOUNT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]\" \"folders/[FOLDER_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]\" For example:\"projects/my-project/locations/global/buckets/my-bucket\"", + "location": "path", + "pattern": "^billingAccounts/[^/]+/locations/[^/]+/buckets/[^/]+$", + "required": true, + "type": "string" + } + }, + "path": "v2/{+name}", + "response": { + "$ref": "LogBucket" + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/cloud-platform.read-only", + "https://www.googleapis.com/auth/logging.admin", + "https://www.googleapis.com/auth/logging.read" + ] + }, "list": { "description": "Lists log buckets.", "flatPath": "v2/billingAccounts/{billingAccountsId}/locations/{locationsId}/buckets", @@ -709,6 +671,34 @@ "https://www.googleapis.com/auth/logging.admin" ] }, + "get": { + "description": "Gets a view on a log bucket..", + "flatPath": "v2/billingAccounts/{billingAccountsId}/locations/{locationsId}/buckets/{bucketsId}/views/{viewsId}", + "httpMethod": "GET", + "id": "logging.billingAccounts.locations.buckets.views.get", + "parameterOrder": [ + "name" + ], + "parameters": { + "name": { + "description": "Required. The resource name of the policy: \"projects/[PROJECT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/views/[VIEW_ID]\" For example:\"projects/my-project/locations/global/buckets/my-bucket/views/my-view\"", + "location": "path", + "pattern": "^billingAccounts/[^/]+/locations/[^/]+/buckets/[^/]+/views/[^/]+$", + "required": true, + "type": "string" + } + }, + "path": "v2/{+name}", + "response": { + "$ref": "LogView" + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/cloud-platform.read-only", + "https://www.googleapis.com/auth/logging.admin", + "https://www.googleapis.com/auth/logging.read" + ] + }, "list": { "description": "Lists views on a log bucket.", "flatPath": "v2/billingAccounts/{billingAccountsId}/locations/{locationsId}/buckets/{bucketsId}/views", @@ -869,6 +859,34 @@ "https://www.googleapis.com/auth/logging.admin" ] }, + "get": { + "description": "Gets the latest state of a long-running operation. Clients can use this method to poll the operation result at intervals as recommended by the API service.", + "flatPath": "v2/billingAccounts/{billingAccountsId}/locations/{locationsId}/operations/{operationsId}", + "httpMethod": "GET", + "id": "logging.billingAccounts.locations.operations.get", + "parameterOrder": [ + "name" + ], + "parameters": { + "name": { + "description": "The name of the operation resource.", + "location": "path", + "pattern": "^billingAccounts/[^/]+/locations/[^/]+/operations/[^/]+$", + "required": true, + "type": "string" + } + }, + "path": "v2/{+name}", + "response": { + "$ref": "Operation" + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/cloud-platform.read-only", + "https://www.googleapis.com/auth/logging.admin", + "https://www.googleapis.com/auth/logging.read" + ] + }, "list": { "description": "Lists operations that match the specified filter in the request. If the server doesn't support this method, it returns UNIMPLEMENTED.NOTE: the name binding allows API services to override the binding to use different resource name schemes, such as users/*/operations. To override the binding, API services can add a binding such as \"/v1/{name=users/*}/operations\" to their service configuration. For backwards compatibility, the default name includes the operations collection id, however overriding users must ensure the name binding is the parent resource, without the operations collection id.", "flatPath": "v2/billingAccounts/{billingAccountsId}/locations/{locationsId}/operations", @@ -992,38 +1010,6 @@ } } }, - "operations": { - "methods": { - "get": { - "description": "Gets the latest state of a long-running operation. Clients can use this method to poll the operation result at intervals as recommended by the API service.", - "flatPath": "v2/billingAccounts/{billingAccountsId}/operations/{operationsId}", - "httpMethod": "GET", - "id": "logging.billingAccounts.operations.get", - "parameterOrder": [ - "name" - ], - "parameters": { - "name": { - "description": "The name of the operation resource.", - "location": "path", - "pattern": "^billingAccounts/[^/]+/operations/[^/]+$", - "required": true, - "type": "string" - } - }, - "path": "v2/{+name}", - "response": { - "$ref": "Operation" - }, - "scopes": [ - "https://www.googleapis.com/auth/cloud-platform", - "https://www.googleapis.com/auth/cloud-platform.read-only", - "https://www.googleapis.com/auth/logging.admin", - "https://www.googleapis.com/auth/logging.read" - ] - } - } - }, "sinks": { "methods": { "create": { @@ -6021,7 +6007,7 @@ } } }, - "revision": "20220527", + "revision": "20220624", "rootUrl": "https://logging.googleapis.com/", "schemas": { "BigQueryOptions": { @@ -7756,7 +7742,7 @@ "type": "string" }, "partialSuccess": { - "description": "Optional. Whether a batch's valid entries should be written even if some other entry failed due to a permanent error such as INVALID_ARGUMENT or PERMISSION_DENIED. If any entry failed, then the response status is the response status is the status of one of the failed entries. The response will include error details keyed by the entries' zero-based index in the entries.write method.", + "description": "Optional. Whether a batch's valid entries should be written even if some other entry failed due to a permanent error such as INVALID_ARGUMENT or PERMISSION_DENIED. If any entry failed, then the response status is the response status of one of the failed entries. The response will include error details in WriteLogEntriesPartialErrors.log_entry_errors keyed by the entries' zero-based index in the entries. Failed requests for which no entries are written will not include per-entry errors.", "type": "boolean" }, "resource": { diff --git a/logging/v2/logging-gen.go b/logging/v2/logging-gen.go index 1751122d506..3691cf29a07 100644 --- a/logging/v2/logging-gen.go +++ b/logging/v2/logging-gen.go @@ -192,11 +192,9 @@ func (s *Service) userAgent() string { func NewBillingAccountsService(s *Service) *BillingAccountsService { rs := &BillingAccountsService{s: s} - rs.Buckets = NewBillingAccountsBucketsService(s) rs.Exclusions = NewBillingAccountsExclusionsService(s) rs.Locations = NewBillingAccountsLocationsService(s) rs.Logs = NewBillingAccountsLogsService(s) - rs.Operations = NewBillingAccountsOperationsService(s) rs.Sinks = NewBillingAccountsSinksService(s) return rs } @@ -204,40 +202,15 @@ func NewBillingAccountsService(s *Service) *BillingAccountsService { type BillingAccountsService struct { s *Service - Buckets *BillingAccountsBucketsService - Exclusions *BillingAccountsExclusionsService Locations *BillingAccountsLocationsService Logs *BillingAccountsLogsService - Operations *BillingAccountsOperationsService - Sinks *BillingAccountsSinksService } -func NewBillingAccountsBucketsService(s *Service) *BillingAccountsBucketsService { - rs := &BillingAccountsBucketsService{s: s} - rs.Views = NewBillingAccountsBucketsViewsService(s) - return rs -} - -type BillingAccountsBucketsService struct { - s *Service - - Views *BillingAccountsBucketsViewsService -} - -func NewBillingAccountsBucketsViewsService(s *Service) *BillingAccountsBucketsViewsService { - rs := &BillingAccountsBucketsViewsService{s: s} - return rs -} - -type BillingAccountsBucketsViewsService struct { - s *Service -} - func NewBillingAccountsExclusionsService(s *Service) *BillingAccountsExclusionsService { rs := &BillingAccountsExclusionsService{s: s} return rs @@ -313,15 +286,6 @@ type BillingAccountsLogsService struct { s *Service } -func NewBillingAccountsOperationsService(s *Service) *BillingAccountsOperationsService { - rs := &BillingAccountsOperationsService{s: s} - return rs -} - -type BillingAccountsOperationsService struct { - s *Service -} - func NewBillingAccountsSinksService(s *Service) *BillingAccountsSinksService { rs := &BillingAccountsSinksService{s: s} return rs @@ -3804,9 +3768,11 @@ type WriteLogEntriesRequest struct { // PartialSuccess: Optional. Whether a batch's valid entries should be // written even if some other entry failed due to a permanent error such // as INVALID_ARGUMENT or PERMISSION_DENIED. If any entry failed, then - // the response status is the response status is the status of one of - // the failed entries. The response will include error details keyed by - // the entries' zero-based index in the entries.write method. + // the response status is the response status of one of the failed + // entries. The response will include error details in + // WriteLogEntriesPartialErrors.log_entry_errors keyed by the entries' + // zero-based index in the entries. Failed requests for which no entries + // are written will not include per-entry errors. PartialSuccess bool `json:"partialSuccess,omitempty"` // Resource: Optional. A default monitored resource object that is @@ -4177,103 +4143,93 @@ func (c *BillingAccountsGetSettingsCall) Do(opts ...googleapi.CallOption) (*Sett } -// method id "logging.billingAccounts.buckets.get": +// method id "logging.billingAccounts.exclusions.create": -type BillingAccountsBucketsGetCall struct { +type BillingAccountsExclusionsCreateCall struct { s *Service - name string + parent string + logexclusion *LogExclusion urlParams_ gensupport.URLParams - ifNoneMatch_ string ctx_ context.Context header_ http.Header } -// Get: Gets a log bucket. +// Create: Creates a new exclusion in the _Default sink in a specified +// parent resource. Only log entries belonging to that resource can be +// excluded. You can have up to 10 exclusions in a resource. // -// - name: The resource name of the bucket: -// "projects/[PROJECT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]" -// "organizations/[ORGANIZATION_ID]/locations/[LOCATION_ID]/buckets/[BU -// CKET_ID]" -// "billingAccounts/[BILLING_ACCOUNT_ID]/locations/[LOCATION_ID]/bucket -// s/[BUCKET_ID]" -// "folders/[FOLDER_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]" -// For -// example:"projects/my-project/locations/global/buckets/my-bucket". -func (r *BillingAccountsBucketsService) Get(name string) *BillingAccountsBucketsGetCall { - c := &BillingAccountsBucketsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)} - c.name = name +// - parent: The parent resource in which to create the exclusion: +// "projects/[PROJECT_ID]" "organizations/[ORGANIZATION_ID]" +// "billingAccounts/[BILLING_ACCOUNT_ID]" "folders/[FOLDER_ID]" For +// examples:"projects/my-logging-project" "organizations/123456789". +func (r *BillingAccountsExclusionsService) Create(parent string, logexclusion *LogExclusion) *BillingAccountsExclusionsCreateCall { + c := &BillingAccountsExclusionsCreateCall{s: r.s, urlParams_: make(gensupport.URLParams)} + c.parent = parent + c.logexclusion = logexclusion 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 *BillingAccountsBucketsGetCall) Fields(s ...googleapi.Field) *BillingAccountsBucketsGetCall { +func (c *BillingAccountsExclusionsCreateCall) Fields(s ...googleapi.Field) *BillingAccountsExclusionsCreateCall { 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 *BillingAccountsBucketsGetCall) IfNoneMatch(entityTag string) *BillingAccountsBucketsGetCall { - 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 *BillingAccountsBucketsGetCall) Context(ctx context.Context) *BillingAccountsBucketsGetCall { +func (c *BillingAccountsExclusionsCreateCall) Context(ctx context.Context) *BillingAccountsExclusionsCreateCall { 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 *BillingAccountsBucketsGetCall) Header() http.Header { +func (c *BillingAccountsExclusionsCreateCall) Header() http.Header { if c.header_ == nil { c.header_ = make(http.Header) } return c.header_ } -func (c *BillingAccountsBucketsGetCall) doRequest(alt string) (*http.Response, error) { +func (c *BillingAccountsExclusionsCreateCall) 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.logexclusion) + if err != nil { + return nil, err + } + reqHeaders.Set("Content-Type", "application/json") c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") - urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+name}") + urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+parent}/exclusions") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("POST", urls, body) if err != nil { return nil, err } req.Header = reqHeaders googleapi.Expand(req.URL, map[string]string{ - "name": c.name, + "parent": c.parent, }) return gensupport.SendRequest(c.ctx_, c.s.client, req) } -// Do executes the "logging.billingAccounts.buckets.get" call. -// Exactly one of *LogBucket or error will be non-nil. Any non-2xx +// Do executes the "logging.billingAccounts.exclusions.create" call. +// Exactly one of *LogExclusion or error will be non-nil. Any non-2xx // status code is an error. Response headers are in either -// *LogBucket.ServerResponse.Header or (if a response was returned at +// *LogExclusion.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 *BillingAccountsBucketsGetCall) Do(opts ...googleapi.CallOption) (*LogBucket, error) { +func (c *BillingAccountsExclusionsCreateCall) Do(opts ...googleapi.CallOption) (*LogExclusion, error) { gensupport.SetOptions(c.urlParams_, opts...) res, err := c.doRequest("json") if res != nil && res.StatusCode == http.StatusNotModified { @@ -4292,7 +4248,7 @@ func (c *BillingAccountsBucketsGetCall) Do(opts ...googleapi.CallOption) (*LogBu if err := googleapi.CheckResponse(res); err != nil { return nil, err } - ret := &LogBucket{ + ret := &LogExclusion{ ServerResponse: googleapi.ServerResponse{ Header: res.Header, HTTPStatusCode: res.StatusCode, @@ -4304,56 +4260,57 @@ func (c *BillingAccountsBucketsGetCall) Do(opts ...googleapi.CallOption) (*LogBu } return ret, nil // { - // "description": "Gets a log bucket.", - // "flatPath": "v2/billingAccounts/{billingAccountsId}/buckets/{bucketsId}", - // "httpMethod": "GET", - // "id": "logging.billingAccounts.buckets.get", + // "description": "Creates a new exclusion in the _Default sink in a specified parent resource. Only log entries belonging to that resource can be excluded. You can have up to 10 exclusions in a resource.", + // "flatPath": "v2/billingAccounts/{billingAccountsId}/exclusions", + // "httpMethod": "POST", + // "id": "logging.billingAccounts.exclusions.create", // "parameterOrder": [ - // "name" + // "parent" // ], // "parameters": { - // "name": { - // "description": "Required. The resource name of the bucket: \"projects/[PROJECT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]\" \"organizations/[ORGANIZATION_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]\" \"billingAccounts/[BILLING_ACCOUNT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]\" \"folders/[FOLDER_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]\" For example:\"projects/my-project/locations/global/buckets/my-bucket\"", + // "parent": { + // "description": "Required. The parent resource in which to create the exclusion: \"projects/[PROJECT_ID]\" \"organizations/[ORGANIZATION_ID]\" \"billingAccounts/[BILLING_ACCOUNT_ID]\" \"folders/[FOLDER_ID]\" For examples:\"projects/my-logging-project\" \"organizations/123456789\"", // "location": "path", - // "pattern": "^billingAccounts/[^/]+/buckets/[^/]+$", + // "pattern": "^billingAccounts/[^/]+$", // "required": true, // "type": "string" // } // }, - // "path": "v2/{+name}", + // "path": "v2/{+parent}/exclusions", + // "request": { + // "$ref": "LogExclusion" + // }, // "response": { - // "$ref": "LogBucket" + // "$ref": "LogExclusion" // }, // "scopes": [ // "https://www.googleapis.com/auth/cloud-platform", - // "https://www.googleapis.com/auth/cloud-platform.read-only", - // "https://www.googleapis.com/auth/logging.admin", - // "https://www.googleapis.com/auth/logging.read" + // "https://www.googleapis.com/auth/logging.admin" // ] // } } -// method id "logging.billingAccounts.buckets.views.get": +// method id "logging.billingAccounts.exclusions.delete": -type BillingAccountsBucketsViewsGetCall struct { - s *Service - name string - urlParams_ gensupport.URLParams - ifNoneMatch_ string - ctx_ context.Context - header_ http.Header +type BillingAccountsExclusionsDeleteCall struct { + s *Service + name string + urlParams_ gensupport.URLParams + ctx_ context.Context + header_ http.Header } -// Get: Gets a view on a log bucket.. +// Delete: Deletes an exclusion in the _Default sink. // -// - name: The resource name of the policy: -// "projects/[PROJECT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/v -// iews/[VIEW_ID]" For -// example:"projects/my-project/locations/global/buckets/my-bucket/view -// s/my-view". -func (r *BillingAccountsBucketsViewsService) Get(name string) *BillingAccountsBucketsViewsGetCall { - c := &BillingAccountsBucketsViewsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)} +// - name: The resource name of an existing exclusion to delete: +// "projects/[PROJECT_ID]/exclusions/[EXCLUSION_ID]" +// "organizations/[ORGANIZATION_ID]/exclusions/[EXCLUSION_ID]" +// "billingAccounts/[BILLING_ACCOUNT_ID]/exclusions/[EXCLUSION_ID]" +// "folders/[FOLDER_ID]/exclusions/[EXCLUSION_ID]" For +// example:"projects/my-project/exclusions/my-exclusion". +func (r *BillingAccountsExclusionsService) Delete(name string) *BillingAccountsExclusionsDeleteCall { + c := &BillingAccountsExclusionsDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)} c.name = name return c } @@ -4361,54 +4318,41 @@ func (r *BillingAccountsBucketsViewsService) Get(name string) *BillingAccountsBu // Fields allows partial responses to be retrieved. See // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse // for more information. -func (c *BillingAccountsBucketsViewsGetCall) Fields(s ...googleapi.Field) *BillingAccountsBucketsViewsGetCall { +func (c *BillingAccountsExclusionsDeleteCall) Fields(s ...googleapi.Field) *BillingAccountsExclusionsDeleteCall { 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 *BillingAccountsBucketsViewsGetCall) IfNoneMatch(entityTag string) *BillingAccountsBucketsViewsGetCall { - 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 *BillingAccountsBucketsViewsGetCall) Context(ctx context.Context) *BillingAccountsBucketsViewsGetCall { +func (c *BillingAccountsExclusionsDeleteCall) Context(ctx context.Context) *BillingAccountsExclusionsDeleteCall { 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 *BillingAccountsBucketsViewsGetCall) Header() http.Header { +func (c *BillingAccountsExclusionsDeleteCall) Header() http.Header { if c.header_ == nil { c.header_ = make(http.Header) } return c.header_ } -func (c *BillingAccountsBucketsViewsGetCall) doRequest(alt string) (*http.Response, error) { +func (c *BillingAccountsExclusionsDeleteCall) 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) + req, err := http.NewRequest("DELETE", urls, body) if err != nil { return nil, err } @@ -4419,14 +4363,14 @@ func (c *BillingAccountsBucketsViewsGetCall) doRequest(alt string) (*http.Respon return gensupport.SendRequest(c.ctx_, c.s.client, req) } -// Do executes the "logging.billingAccounts.buckets.views.get" call. -// Exactly one of *LogView or error will be non-nil. Any non-2xx status +// Do executes the "logging.billingAccounts.exclusions.delete" call. +// Exactly one of *Empty or error will be non-nil. Any non-2xx status // code is an error. Response headers are in either -// *LogView.ServerResponse.Header or (if a response was returned at all) +// *Empty.ServerResponse.Header or (if a response was returned at all) // in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to // check whether the returned error was because http.StatusNotModified // was returned. -func (c *BillingAccountsBucketsViewsGetCall) Do(opts ...googleapi.CallOption) (*LogView, error) { +func (c *BillingAccountsExclusionsDeleteCall) Do(opts ...googleapi.CallOption) (*Empty, error) { gensupport.SetOptions(c.urlParams_, opts...) res, err := c.doRequest("json") if res != nil && res.StatusCode == http.StatusNotModified { @@ -4445,7 +4389,7 @@ func (c *BillingAccountsBucketsViewsGetCall) Do(opts ...googleapi.CallOption) (* if err := googleapi.CheckResponse(res); err != nil { return nil, err } - ret := &LogView{ + ret := &Empty{ ServerResponse: googleapi.ServerResponse{ Header: res.Header, HTTPStatusCode: res.StatusCode, @@ -4457,123 +4401,128 @@ func (c *BillingAccountsBucketsViewsGetCall) Do(opts ...googleapi.CallOption) (* } return ret, nil // { - // "description": "Gets a view on a log bucket..", - // "flatPath": "v2/billingAccounts/{billingAccountsId}/buckets/{bucketsId}/views/{viewsId}", - // "httpMethod": "GET", - // "id": "logging.billingAccounts.buckets.views.get", + // "description": "Deletes an exclusion in the _Default sink.", + // "flatPath": "v2/billingAccounts/{billingAccountsId}/exclusions/{exclusionsId}", + // "httpMethod": "DELETE", + // "id": "logging.billingAccounts.exclusions.delete", // "parameterOrder": [ // "name" // ], // "parameters": { // "name": { - // "description": "Required. The resource name of the policy: \"projects/[PROJECT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/views/[VIEW_ID]\" For example:\"projects/my-project/locations/global/buckets/my-bucket/views/my-view\"", + // "description": "Required. The resource name of an existing exclusion to delete: \"projects/[PROJECT_ID]/exclusions/[EXCLUSION_ID]\" \"organizations/[ORGANIZATION_ID]/exclusions/[EXCLUSION_ID]\" \"billingAccounts/[BILLING_ACCOUNT_ID]/exclusions/[EXCLUSION_ID]\" \"folders/[FOLDER_ID]/exclusions/[EXCLUSION_ID]\" For example:\"projects/my-project/exclusions/my-exclusion\"", // "location": "path", - // "pattern": "^billingAccounts/[^/]+/buckets/[^/]+/views/[^/]+$", + // "pattern": "^billingAccounts/[^/]+/exclusions/[^/]+$", // "required": true, // "type": "string" // } // }, // "path": "v2/{+name}", // "response": { - // "$ref": "LogView" + // "$ref": "Empty" // }, // "scopes": [ // "https://www.googleapis.com/auth/cloud-platform", - // "https://www.googleapis.com/auth/cloud-platform.read-only", - // "https://www.googleapis.com/auth/logging.admin", - // "https://www.googleapis.com/auth/logging.read" + // "https://www.googleapis.com/auth/logging.admin" // ] // } } -// method id "logging.billingAccounts.exclusions.create": +// method id "logging.billingAccounts.exclusions.get": -type BillingAccountsExclusionsCreateCall struct { +type BillingAccountsExclusionsGetCall struct { s *Service - parent string - logexclusion *LogExclusion + name string urlParams_ gensupport.URLParams + ifNoneMatch_ string ctx_ context.Context header_ http.Header } -// Create: Creates a new exclusion in the _Default sink in a specified -// parent resource. Only log entries belonging to that resource can be -// excluded. You can have up to 10 exclusions in a resource. +// Get: Gets the description of an exclusion in the _Default sink. // -// - parent: The parent resource in which to create the exclusion: -// "projects/[PROJECT_ID]" "organizations/[ORGANIZATION_ID]" -// "billingAccounts/[BILLING_ACCOUNT_ID]" "folders/[FOLDER_ID]" For -// examples:"projects/my-logging-project" "organizations/123456789". -func (r *BillingAccountsExclusionsService) Create(parent string, logexclusion *LogExclusion) *BillingAccountsExclusionsCreateCall { - c := &BillingAccountsExclusionsCreateCall{s: r.s, urlParams_: make(gensupport.URLParams)} - c.parent = parent - c.logexclusion = logexclusion +// - name: The resource name of an existing exclusion: +// "projects/[PROJECT_ID]/exclusions/[EXCLUSION_ID]" +// "organizations/[ORGANIZATION_ID]/exclusions/[EXCLUSION_ID]" +// "billingAccounts/[BILLING_ACCOUNT_ID]/exclusions/[EXCLUSION_ID]" +// "folders/[FOLDER_ID]/exclusions/[EXCLUSION_ID]" For +// example:"projects/my-project/exclusions/my-exclusion". +func (r *BillingAccountsExclusionsService) Get(name string) *BillingAccountsExclusionsGetCall { + c := &BillingAccountsExclusionsGetCall{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 *BillingAccountsExclusionsCreateCall) Fields(s ...googleapi.Field) *BillingAccountsExclusionsCreateCall { +func (c *BillingAccountsExclusionsGetCall) Fields(s ...googleapi.Field) *BillingAccountsExclusionsGetCall { 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 *BillingAccountsExclusionsGetCall) IfNoneMatch(entityTag string) *BillingAccountsExclusionsGetCall { + 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 *BillingAccountsExclusionsCreateCall) Context(ctx context.Context) *BillingAccountsExclusionsCreateCall { +func (c *BillingAccountsExclusionsGetCall) Context(ctx context.Context) *BillingAccountsExclusionsGetCall { 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 *BillingAccountsExclusionsCreateCall) Header() http.Header { +func (c *BillingAccountsExclusionsGetCall) Header() http.Header { if c.header_ == nil { c.header_ = make(http.Header) } return c.header_ } -func (c *BillingAccountsExclusionsCreateCall) doRequest(alt string) (*http.Response, error) { +func (c *BillingAccountsExclusionsGetCall) 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.logexclusion) - if err != nil { - return nil, err + if c.ifNoneMatch_ != "" { + reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - reqHeaders.Set("Content-Type", "application/json") + var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") - urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+parent}/exclusions") + urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("POST", urls, body) + 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, + "name": c.name, }) return gensupport.SendRequest(c.ctx_, c.s.client, req) } -// Do executes the "logging.billingAccounts.exclusions.create" call. +// Do executes the "logging.billingAccounts.exclusions.get" call. // Exactly one of *LogExclusion or error will be non-nil. Any non-2xx // status code is an error. Response headers are in either // *LogExclusion.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 *BillingAccountsExclusionsCreateCall) Do(opts ...googleapi.CallOption) (*LogExclusion, error) { +func (c *BillingAccountsExclusionsGetCall) Do(opts ...googleapi.CallOption) (*LogExclusion, error) { gensupport.SetOptions(c.urlParams_, opts...) res, err := c.doRequest("json") if res != nil && res.StatusCode == http.StatusNotModified { @@ -4604,309 +4553,16 @@ func (c *BillingAccountsExclusionsCreateCall) Do(opts ...googleapi.CallOption) ( } return ret, nil // { - // "description": "Creates a new exclusion in the _Default sink in a specified parent resource. Only log entries belonging to that resource can be excluded. You can have up to 10 exclusions in a resource.", - // "flatPath": "v2/billingAccounts/{billingAccountsId}/exclusions", - // "httpMethod": "POST", - // "id": "logging.billingAccounts.exclusions.create", + // "description": "Gets the description of an exclusion in the _Default sink.", + // "flatPath": "v2/billingAccounts/{billingAccountsId}/exclusions/{exclusionsId}", + // "httpMethod": "GET", + // "id": "logging.billingAccounts.exclusions.get", // "parameterOrder": [ - // "parent" + // "name" // ], // "parameters": { - // "parent": { - // "description": "Required. The parent resource in which to create the exclusion: \"projects/[PROJECT_ID]\" \"organizations/[ORGANIZATION_ID]\" \"billingAccounts/[BILLING_ACCOUNT_ID]\" \"folders/[FOLDER_ID]\" For examples:\"projects/my-logging-project\" \"organizations/123456789\"", - // "location": "path", - // "pattern": "^billingAccounts/[^/]+$", - // "required": true, - // "type": "string" - // } - // }, - // "path": "v2/{+parent}/exclusions", - // "request": { - // "$ref": "LogExclusion" - // }, - // "response": { - // "$ref": "LogExclusion" - // }, - // "scopes": [ - // "https://www.googleapis.com/auth/cloud-platform", - // "https://www.googleapis.com/auth/logging.admin" - // ] - // } - -} - -// method id "logging.billingAccounts.exclusions.delete": - -type BillingAccountsExclusionsDeleteCall struct { - s *Service - name string - urlParams_ gensupport.URLParams - ctx_ context.Context - header_ http.Header -} - -// Delete: Deletes an exclusion in the _Default sink. -// -// - name: The resource name of an existing exclusion to delete: -// "projects/[PROJECT_ID]/exclusions/[EXCLUSION_ID]" -// "organizations/[ORGANIZATION_ID]/exclusions/[EXCLUSION_ID]" -// "billingAccounts/[BILLING_ACCOUNT_ID]/exclusions/[EXCLUSION_ID]" -// "folders/[FOLDER_ID]/exclusions/[EXCLUSION_ID]" For -// example:"projects/my-project/exclusions/my-exclusion". -func (r *BillingAccountsExclusionsService) Delete(name string) *BillingAccountsExclusionsDeleteCall { - c := &BillingAccountsExclusionsDeleteCall{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 *BillingAccountsExclusionsDeleteCall) Fields(s ...googleapi.Field) *BillingAccountsExclusionsDeleteCall { - 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 *BillingAccountsExclusionsDeleteCall) Context(ctx context.Context) *BillingAccountsExclusionsDeleteCall { - 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 *BillingAccountsExclusionsDeleteCall) Header() http.Header { - if c.header_ == nil { - c.header_ = make(http.Header) - } - return c.header_ -} - -func (c *BillingAccountsExclusionsDeleteCall) 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 "logging.billingAccounts.exclusions.delete" call. -// Exactly one of *Empty or error will be non-nil. Any non-2xx status -// code is an error. Response headers are in either -// *Empty.ServerResponse.Header or (if a response was returned at all) -// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to -// check whether the returned error was because http.StatusNotModified -// was returned. -func (c *BillingAccountsExclusionsDeleteCall) Do(opts ...googleapi.CallOption) (*Empty, error) { - gensupport.SetOptions(c.urlParams_, opts...) - res, err := c.doRequest("json") - if res != nil && res.StatusCode == http.StatusNotModified { - if res.Body != nil { - res.Body.Close() - } - return nil, &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 := &Empty{ - ServerResponse: googleapi.ServerResponse{ - Header: res.Header, - HTTPStatusCode: res.StatusCode, - }, - } - target := &ret - if err := gensupport.DecodeResponse(target, res); err != nil { - return nil, err - } - return ret, nil - // { - // "description": "Deletes an exclusion in the _Default sink.", - // "flatPath": "v2/billingAccounts/{billingAccountsId}/exclusions/{exclusionsId}", - // "httpMethod": "DELETE", - // "id": "logging.billingAccounts.exclusions.delete", - // "parameterOrder": [ - // "name" - // ], - // "parameters": { - // "name": { - // "description": "Required. The resource name of an existing exclusion to delete: \"projects/[PROJECT_ID]/exclusions/[EXCLUSION_ID]\" \"organizations/[ORGANIZATION_ID]/exclusions/[EXCLUSION_ID]\" \"billingAccounts/[BILLING_ACCOUNT_ID]/exclusions/[EXCLUSION_ID]\" \"folders/[FOLDER_ID]/exclusions/[EXCLUSION_ID]\" For example:\"projects/my-project/exclusions/my-exclusion\"", - // "location": "path", - // "pattern": "^billingAccounts/[^/]+/exclusions/[^/]+$", - // "required": true, - // "type": "string" - // } - // }, - // "path": "v2/{+name}", - // "response": { - // "$ref": "Empty" - // }, - // "scopes": [ - // "https://www.googleapis.com/auth/cloud-platform", - // "https://www.googleapis.com/auth/logging.admin" - // ] - // } - -} - -// method id "logging.billingAccounts.exclusions.get": - -type BillingAccountsExclusionsGetCall struct { - s *Service - name string - urlParams_ gensupport.URLParams - ifNoneMatch_ string - ctx_ context.Context - header_ http.Header -} - -// Get: Gets the description of an exclusion in the _Default sink. -// -// - name: The resource name of an existing exclusion: -// "projects/[PROJECT_ID]/exclusions/[EXCLUSION_ID]" -// "organizations/[ORGANIZATION_ID]/exclusions/[EXCLUSION_ID]" -// "billingAccounts/[BILLING_ACCOUNT_ID]/exclusions/[EXCLUSION_ID]" -// "folders/[FOLDER_ID]/exclusions/[EXCLUSION_ID]" For -// example:"projects/my-project/exclusions/my-exclusion". -func (r *BillingAccountsExclusionsService) Get(name string) *BillingAccountsExclusionsGetCall { - c := &BillingAccountsExclusionsGetCall{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 *BillingAccountsExclusionsGetCall) Fields(s ...googleapi.Field) *BillingAccountsExclusionsGetCall { - 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 *BillingAccountsExclusionsGetCall) IfNoneMatch(entityTag string) *BillingAccountsExclusionsGetCall { - 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 *BillingAccountsExclusionsGetCall) Context(ctx context.Context) *BillingAccountsExclusionsGetCall { - 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 *BillingAccountsExclusionsGetCall) Header() http.Header { - if c.header_ == nil { - c.header_ = make(http.Header) - } - return c.header_ -} - -func (c *BillingAccountsExclusionsGetCall) 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 "logging.billingAccounts.exclusions.get" call. -// Exactly one of *LogExclusion or error will be non-nil. Any non-2xx -// status code is an error. Response headers are in either -// *LogExclusion.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 *BillingAccountsExclusionsGetCall) Do(opts ...googleapi.CallOption) (*LogExclusion, 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 := &LogExclusion{ - 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 description of an exclusion in the _Default sink.", - // "flatPath": "v2/billingAccounts/{billingAccountsId}/exclusions/{exclusionsId}", - // "httpMethod": "GET", - // "id": "logging.billingAccounts.exclusions.get", - // "parameterOrder": [ - // "name" - // ], - // "parameters": { - // "name": { - // "description": "Required. The resource name of an existing exclusion: \"projects/[PROJECT_ID]/exclusions/[EXCLUSION_ID]\" \"organizations/[ORGANIZATION_ID]/exclusions/[EXCLUSION_ID]\" \"billingAccounts/[BILLING_ACCOUNT_ID]/exclusions/[EXCLUSION_ID]\" \"folders/[FOLDER_ID]/exclusions/[EXCLUSION_ID]\" For example:\"projects/my-project/exclusions/my-exclusion\"", + // "name": { + // "description": "Required. The resource name of an existing exclusion: \"projects/[PROJECT_ID]/exclusions/[EXCLUSION_ID]\" \"organizations/[ORGANIZATION_ID]/exclusions/[EXCLUSION_ID]\" \"billingAccounts/[BILLING_ACCOUNT_ID]/exclusions/[EXCLUSION_ID]\" \"folders/[FOLDER_ID]/exclusions/[EXCLUSION_ID]\" For example:\"projects/my-project/exclusions/my-exclusion\"", // "location": "path", // "pattern": "^billingAccounts/[^/]+/exclusions/[^/]+$", // "required": true, @@ -5771,7 +5427,158 @@ func (c *BillingAccountsLocationsBucketsCreateCall) Do(opts ...googleapi.CallOpt if err := googleapi.CheckResponse(res); err != nil { return nil, err } - ret := &LogBucket{ + ret := &LogBucket{ + 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 log bucket that can be used to store log entries. After a bucket has been created, the bucket's location cannot be changed.", + // "flatPath": "v2/billingAccounts/{billingAccountsId}/locations/{locationsId}/buckets", + // "httpMethod": "POST", + // "id": "logging.billingAccounts.locations.buckets.create", + // "parameterOrder": [ + // "parent" + // ], + // "parameters": { + // "bucketId": { + // "description": "Required. A client-assigned identifier such as \"my-bucket\". Identifiers are limited to 100 characters and can include only letters, digits, underscores, hyphens, and periods.", + // "location": "query", + // "type": "string" + // }, + // "parent": { + // "description": "Required. The resource in which to create the log bucket: \"projects/[PROJECT_ID]/locations/[LOCATION_ID]\" For example:\"projects/my-project/locations/global\"", + // "location": "path", + // "pattern": "^billingAccounts/[^/]+/locations/[^/]+$", + // "required": true, + // "type": "string" + // } + // }, + // "path": "v2/{+parent}/buckets", + // "request": { + // "$ref": "LogBucket" + // }, + // "response": { + // "$ref": "LogBucket" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/cloud-platform", + // "https://www.googleapis.com/auth/logging.admin" + // ] + // } + +} + +// method id "logging.billingAccounts.locations.buckets.delete": + +type BillingAccountsLocationsBucketsDeleteCall struct { + s *Service + name string + urlParams_ gensupport.URLParams + ctx_ context.Context + header_ http.Header +} + +// Delete: Deletes a log bucket.Changes the bucket's lifecycle_state to +// the DELETE_REQUESTED state. After 7 days, the bucket will be purged +// and all log entries in the bucket will be permanently deleted. +// +// - name: The full resource name of the bucket to delete. +// "projects/[PROJECT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]" +// "organizations/[ORGANIZATION_ID]/locations/[LOCATION_ID]/buckets/[BU +// CKET_ID]" +// "billingAccounts/[BILLING_ACCOUNT_ID]/locations/[LOCATION_ID]/bucket +// s/[BUCKET_ID]" +// "folders/[FOLDER_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]" +// For +// example:"projects/my-project/locations/global/buckets/my-bucket". +func (r *BillingAccountsLocationsBucketsService) Delete(name string) *BillingAccountsLocationsBucketsDeleteCall { + c := &BillingAccountsLocationsBucketsDeleteCall{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 *BillingAccountsLocationsBucketsDeleteCall) Fields(s ...googleapi.Field) *BillingAccountsLocationsBucketsDeleteCall { + 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 *BillingAccountsLocationsBucketsDeleteCall) Context(ctx context.Context) *BillingAccountsLocationsBucketsDeleteCall { + 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 *BillingAccountsLocationsBucketsDeleteCall) Header() http.Header { + if c.header_ == nil { + c.header_ = make(http.Header) + } + return c.header_ +} + +func (c *BillingAccountsLocationsBucketsDeleteCall) 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 "logging.billingAccounts.locations.buckets.delete" call. +// Exactly one of *Empty or error will be non-nil. Any non-2xx status +// code is an error. Response headers are in either +// *Empty.ServerResponse.Header or (if a response was returned at all) +// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to +// check whether the returned error was because http.StatusNotModified +// was returned. +func (c *BillingAccountsLocationsBucketsDeleteCall) Do(opts ...googleapi.CallOption) (*Empty, error) { + gensupport.SetOptions(c.urlParams_, opts...) + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &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 := &Empty{ ServerResponse: googleapi.ServerResponse{ Header: res.Header, HTTPStatusCode: res.StatusCode, @@ -5783,33 +5590,25 @@ func (c *BillingAccountsLocationsBucketsCreateCall) Do(opts ...googleapi.CallOpt } return ret, nil // { - // "description": "Creates a log bucket that can be used to store log entries. After a bucket has been created, the bucket's location cannot be changed.", - // "flatPath": "v2/billingAccounts/{billingAccountsId}/locations/{locationsId}/buckets", - // "httpMethod": "POST", - // "id": "logging.billingAccounts.locations.buckets.create", + // "description": "Deletes a log bucket.Changes the bucket's lifecycle_state to the DELETE_REQUESTED state. After 7 days, the bucket will be purged and all log entries in the bucket will be permanently deleted.", + // "flatPath": "v2/billingAccounts/{billingAccountsId}/locations/{locationsId}/buckets/{bucketsId}", + // "httpMethod": "DELETE", + // "id": "logging.billingAccounts.locations.buckets.delete", // "parameterOrder": [ - // "parent" + // "name" // ], // "parameters": { - // "bucketId": { - // "description": "Required. A client-assigned identifier such as \"my-bucket\". Identifiers are limited to 100 characters and can include only letters, digits, underscores, hyphens, and periods.", - // "location": "query", - // "type": "string" - // }, - // "parent": { - // "description": "Required. The resource in which to create the log bucket: \"projects/[PROJECT_ID]/locations/[LOCATION_ID]\" For example:\"projects/my-project/locations/global\"", + // "name": { + // "description": "Required. The full resource name of the bucket to delete. \"projects/[PROJECT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]\" \"organizations/[ORGANIZATION_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]\" \"billingAccounts/[BILLING_ACCOUNT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]\" \"folders/[FOLDER_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]\" For example:\"projects/my-project/locations/global/buckets/my-bucket\"", // "location": "path", - // "pattern": "^billingAccounts/[^/]+/locations/[^/]+$", + // "pattern": "^billingAccounts/[^/]+/locations/[^/]+/buckets/[^/]+$", // "required": true, // "type": "string" // } // }, - // "path": "v2/{+parent}/buckets", - // "request": { - // "$ref": "LogBucket" - // }, + // "path": "v2/{+name}", // "response": { - // "$ref": "LogBucket" + // "$ref": "Empty" // }, // "scopes": [ // "https://www.googleapis.com/auth/cloud-platform", @@ -5819,21 +5618,20 @@ func (c *BillingAccountsLocationsBucketsCreateCall) Do(opts ...googleapi.CallOpt } -// method id "logging.billingAccounts.locations.buckets.delete": +// method id "logging.billingAccounts.locations.buckets.get": -type BillingAccountsLocationsBucketsDeleteCall struct { - s *Service - name string - urlParams_ gensupport.URLParams - ctx_ context.Context - header_ http.Header +type BillingAccountsLocationsBucketsGetCall struct { + s *Service + name string + urlParams_ gensupport.URLParams + ifNoneMatch_ string + ctx_ context.Context + header_ http.Header } -// Delete: Deletes a log bucket.Changes the bucket's lifecycle_state to -// the DELETE_REQUESTED state. After 7 days, the bucket will be purged -// and all log entries in the bucket will be permanently deleted. +// Get: Gets a log bucket. // -// - name: The full resource name of the bucket to delete. +// - name: The resource name of the bucket: // "projects/[PROJECT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]" // "organizations/[ORGANIZATION_ID]/locations/[LOCATION_ID]/buckets/[BU // CKET_ID]" @@ -5842,8 +5640,8 @@ type BillingAccountsLocationsBucketsDeleteCall struct { // "folders/[FOLDER_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]" // For // example:"projects/my-project/locations/global/buckets/my-bucket". -func (r *BillingAccountsLocationsBucketsService) Delete(name string) *BillingAccountsLocationsBucketsDeleteCall { - c := &BillingAccountsLocationsBucketsDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)} +func (r *BillingAccountsLocationsBucketsService) Get(name string) *BillingAccountsLocationsBucketsGetCall { + c := &BillingAccountsLocationsBucketsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)} c.name = name return c } @@ -5851,41 +5649,54 @@ func (r *BillingAccountsLocationsBucketsService) Delete(name string) *BillingAcc // Fields allows partial responses to be retrieved. See // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse // for more information. -func (c *BillingAccountsLocationsBucketsDeleteCall) Fields(s ...googleapi.Field) *BillingAccountsLocationsBucketsDeleteCall { +func (c *BillingAccountsLocationsBucketsGetCall) Fields(s ...googleapi.Field) *BillingAccountsLocationsBucketsGetCall { 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 *BillingAccountsLocationsBucketsGetCall) IfNoneMatch(entityTag string) *BillingAccountsLocationsBucketsGetCall { + 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 *BillingAccountsLocationsBucketsDeleteCall) Context(ctx context.Context) *BillingAccountsLocationsBucketsDeleteCall { +func (c *BillingAccountsLocationsBucketsGetCall) Context(ctx context.Context) *BillingAccountsLocationsBucketsGetCall { 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 *BillingAccountsLocationsBucketsDeleteCall) Header() http.Header { +func (c *BillingAccountsLocationsBucketsGetCall) Header() http.Header { if c.header_ == nil { c.header_ = make(http.Header) } return c.header_ } -func (c *BillingAccountsLocationsBucketsDeleteCall) doRequest(alt string) (*http.Response, error) { +func (c *BillingAccountsLocationsBucketsGetCall) 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("DELETE", urls, body) + req, err := http.NewRequest("GET", urls, body) if err != nil { return nil, err } @@ -5896,14 +5707,14 @@ func (c *BillingAccountsLocationsBucketsDeleteCall) doRequest(alt string) (*http return gensupport.SendRequest(c.ctx_, c.s.client, req) } -// Do executes the "logging.billingAccounts.locations.buckets.delete" call. -// Exactly one of *Empty or error will be non-nil. Any non-2xx status -// code is an error. Response headers are in either -// *Empty.ServerResponse.Header or (if a response was returned at all) -// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to -// check whether the returned error was because http.StatusNotModified -// was returned. -func (c *BillingAccountsLocationsBucketsDeleteCall) Do(opts ...googleapi.CallOption) (*Empty, error) { +// Do executes the "logging.billingAccounts.locations.buckets.get" call. +// Exactly one of *LogBucket or error will be non-nil. Any non-2xx +// status code is an error. Response headers are in either +// *LogBucket.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 *BillingAccountsLocationsBucketsGetCall) Do(opts ...googleapi.CallOption) (*LogBucket, error) { gensupport.SetOptions(c.urlParams_, opts...) res, err := c.doRequest("json") if res != nil && res.StatusCode == http.StatusNotModified { @@ -5922,7 +5733,7 @@ func (c *BillingAccountsLocationsBucketsDeleteCall) Do(opts ...googleapi.CallOpt if err := googleapi.CheckResponse(res); err != nil { return nil, err } - ret := &Empty{ + ret := &LogBucket{ ServerResponse: googleapi.ServerResponse{ Header: res.Header, HTTPStatusCode: res.StatusCode, @@ -5934,16 +5745,16 @@ func (c *BillingAccountsLocationsBucketsDeleteCall) Do(opts ...googleapi.CallOpt } return ret, nil // { - // "description": "Deletes a log bucket.Changes the bucket's lifecycle_state to the DELETE_REQUESTED state. After 7 days, the bucket will be purged and all log entries in the bucket will be permanently deleted.", + // "description": "Gets a log bucket.", // "flatPath": "v2/billingAccounts/{billingAccountsId}/locations/{locationsId}/buckets/{bucketsId}", - // "httpMethod": "DELETE", - // "id": "logging.billingAccounts.locations.buckets.delete", + // "httpMethod": "GET", + // "id": "logging.billingAccounts.locations.buckets.get", // "parameterOrder": [ // "name" // ], // "parameters": { // "name": { - // "description": "Required. The full resource name of the bucket to delete. \"projects/[PROJECT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]\" \"organizations/[ORGANIZATION_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]\" \"billingAccounts/[BILLING_ACCOUNT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]\" \"folders/[FOLDER_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]\" For example:\"projects/my-project/locations/global/buckets/my-bucket\"", + // "description": "Required. The resource name of the bucket: \"projects/[PROJECT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]\" \"organizations/[ORGANIZATION_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]\" \"billingAccounts/[BILLING_ACCOUNT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]\" \"folders/[FOLDER_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]\" For example:\"projects/my-project/locations/global/buckets/my-bucket\"", // "location": "path", // "pattern": "^billingAccounts/[^/]+/locations/[^/]+/buckets/[^/]+$", // "required": true, @@ -5952,11 +5763,13 @@ func (c *BillingAccountsLocationsBucketsDeleteCall) Do(opts ...googleapi.CallOpt // }, // "path": "v2/{+name}", // "response": { - // "$ref": "Empty" + // "$ref": "LogBucket" // }, // "scopes": [ // "https://www.googleapis.com/auth/cloud-platform", - // "https://www.googleapis.com/auth/logging.admin" + // "https://www.googleapis.com/auth/cloud-platform.read-only", + // "https://www.googleapis.com/auth/logging.admin", + // "https://www.googleapis.com/auth/logging.read" // ] // } @@ -6623,28 +6436,167 @@ func (c *BillingAccountsLocationsBucketsViewsCreateCall) Do(opts ...googleapi.Ca // "httpMethod": "POST", // "id": "logging.billingAccounts.locations.buckets.views.create", // "parameterOrder": [ - // "parent" + // "parent" + // ], + // "parameters": { + // "parent": { + // "description": "Required. The bucket in which to create the view `\"projects/[PROJECT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]\"` For example:\"projects/my-project/locations/global/buckets/my-bucket\"", + // "location": "path", + // "pattern": "^billingAccounts/[^/]+/locations/[^/]+/buckets/[^/]+$", + // "required": true, + // "type": "string" + // }, + // "viewId": { + // "description": "Required. The id to use for this view.", + // "location": "query", + // "type": "string" + // } + // }, + // "path": "v2/{+parent}/views", + // "request": { + // "$ref": "LogView" + // }, + // "response": { + // "$ref": "LogView" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/cloud-platform", + // "https://www.googleapis.com/auth/logging.admin" + // ] + // } + +} + +// method id "logging.billingAccounts.locations.buckets.views.delete": + +type BillingAccountsLocationsBucketsViewsDeleteCall struct { + s *Service + name string + urlParams_ gensupport.URLParams + ctx_ context.Context + header_ http.Header +} + +// Delete: Deletes a view on a log bucket. If an UNAVAILABLE error is +// returned, this indicates that system is not in a state where it can +// delete the view. If this occurs, please try again in a few minutes. +// +// - name: The full resource name of the view to delete: +// "projects/[PROJECT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/v +// iews/[VIEW_ID]" For +// example:"projects/my-project/locations/global/buckets/my-bucket/view +// s/my-view". +func (r *BillingAccountsLocationsBucketsViewsService) Delete(name string) *BillingAccountsLocationsBucketsViewsDeleteCall { + c := &BillingAccountsLocationsBucketsViewsDeleteCall{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 *BillingAccountsLocationsBucketsViewsDeleteCall) Fields(s ...googleapi.Field) *BillingAccountsLocationsBucketsViewsDeleteCall { + 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 *BillingAccountsLocationsBucketsViewsDeleteCall) Context(ctx context.Context) *BillingAccountsLocationsBucketsViewsDeleteCall { + 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 *BillingAccountsLocationsBucketsViewsDeleteCall) Header() http.Header { + if c.header_ == nil { + c.header_ = make(http.Header) + } + return c.header_ +} + +func (c *BillingAccountsLocationsBucketsViewsDeleteCall) 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 "logging.billingAccounts.locations.buckets.views.delete" call. +// Exactly one of *Empty or error will be non-nil. Any non-2xx status +// code is an error. Response headers are in either +// *Empty.ServerResponse.Header or (if a response was returned at all) +// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to +// check whether the returned error was because http.StatusNotModified +// was returned. +func (c *BillingAccountsLocationsBucketsViewsDeleteCall) Do(opts ...googleapi.CallOption) (*Empty, error) { + gensupport.SetOptions(c.urlParams_, opts...) + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &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 := &Empty{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + target := &ret + if err := gensupport.DecodeResponse(target, res); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Deletes a view on a log bucket. If an UNAVAILABLE error is returned, this indicates that system is not in a state where it can delete the view. If this occurs, please try again in a few minutes.", + // "flatPath": "v2/billingAccounts/{billingAccountsId}/locations/{locationsId}/buckets/{bucketsId}/views/{viewsId}", + // "httpMethod": "DELETE", + // "id": "logging.billingAccounts.locations.buckets.views.delete", + // "parameterOrder": [ + // "name" // ], // "parameters": { - // "parent": { - // "description": "Required. The bucket in which to create the view `\"projects/[PROJECT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]\"` For example:\"projects/my-project/locations/global/buckets/my-bucket\"", + // "name": { + // "description": "Required. The full resource name of the view to delete: \"projects/[PROJECT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/views/[VIEW_ID]\" For example:\"projects/my-project/locations/global/buckets/my-bucket/views/my-view\"", // "location": "path", - // "pattern": "^billingAccounts/[^/]+/locations/[^/]+/buckets/[^/]+$", + // "pattern": "^billingAccounts/[^/]+/locations/[^/]+/buckets/[^/]+/views/[^/]+$", // "required": true, // "type": "string" - // }, - // "viewId": { - // "description": "Required. The id to use for this view.", - // "location": "query", - // "type": "string" // } // }, - // "path": "v2/{+parent}/views", - // "request": { - // "$ref": "LogView" - // }, + // "path": "v2/{+name}", // "response": { - // "$ref": "LogView" + // "$ref": "Empty" // }, // "scopes": [ // "https://www.googleapis.com/auth/cloud-platform", @@ -6654,27 +6606,26 @@ func (c *BillingAccountsLocationsBucketsViewsCreateCall) Do(opts ...googleapi.Ca } -// method id "logging.billingAccounts.locations.buckets.views.delete": +// method id "logging.billingAccounts.locations.buckets.views.get": -type BillingAccountsLocationsBucketsViewsDeleteCall struct { - s *Service - name string - urlParams_ gensupport.URLParams - ctx_ context.Context - header_ http.Header +type BillingAccountsLocationsBucketsViewsGetCall struct { + s *Service + name string + urlParams_ gensupport.URLParams + ifNoneMatch_ string + ctx_ context.Context + header_ http.Header } -// Delete: Deletes a view on a log bucket. If an UNAVAILABLE error is -// returned, this indicates that system is not in a state where it can -// delete the view. If this occurs, please try again in a few minutes. +// Get: Gets a view on a log bucket.. // -// - name: The full resource name of the view to delete: +// - name: The resource name of the policy: // "projects/[PROJECT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/v // iews/[VIEW_ID]" For // example:"projects/my-project/locations/global/buckets/my-bucket/view // s/my-view". -func (r *BillingAccountsLocationsBucketsViewsService) Delete(name string) *BillingAccountsLocationsBucketsViewsDeleteCall { - c := &BillingAccountsLocationsBucketsViewsDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)} +func (r *BillingAccountsLocationsBucketsViewsService) Get(name string) *BillingAccountsLocationsBucketsViewsGetCall { + c := &BillingAccountsLocationsBucketsViewsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)} c.name = name return c } @@ -6682,41 +6633,54 @@ func (r *BillingAccountsLocationsBucketsViewsService) Delete(name string) *Billi // Fields allows partial responses to be retrieved. See // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse // for more information. -func (c *BillingAccountsLocationsBucketsViewsDeleteCall) Fields(s ...googleapi.Field) *BillingAccountsLocationsBucketsViewsDeleteCall { +func (c *BillingAccountsLocationsBucketsViewsGetCall) Fields(s ...googleapi.Field) *BillingAccountsLocationsBucketsViewsGetCall { 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 *BillingAccountsLocationsBucketsViewsGetCall) IfNoneMatch(entityTag string) *BillingAccountsLocationsBucketsViewsGetCall { + 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 *BillingAccountsLocationsBucketsViewsDeleteCall) Context(ctx context.Context) *BillingAccountsLocationsBucketsViewsDeleteCall { +func (c *BillingAccountsLocationsBucketsViewsGetCall) Context(ctx context.Context) *BillingAccountsLocationsBucketsViewsGetCall { 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 *BillingAccountsLocationsBucketsViewsDeleteCall) Header() http.Header { +func (c *BillingAccountsLocationsBucketsViewsGetCall) Header() http.Header { if c.header_ == nil { c.header_ = make(http.Header) } return c.header_ } -func (c *BillingAccountsLocationsBucketsViewsDeleteCall) doRequest(alt string) (*http.Response, error) { +func (c *BillingAccountsLocationsBucketsViewsGetCall) 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("DELETE", urls, body) + req, err := http.NewRequest("GET", urls, body) if err != nil { return nil, err } @@ -6727,14 +6691,14 @@ func (c *BillingAccountsLocationsBucketsViewsDeleteCall) doRequest(alt string) ( return gensupport.SendRequest(c.ctx_, c.s.client, req) } -// Do executes the "logging.billingAccounts.locations.buckets.views.delete" call. -// Exactly one of *Empty or error will be non-nil. Any non-2xx status +// Do executes the "logging.billingAccounts.locations.buckets.views.get" call. +// Exactly one of *LogView or error will be non-nil. Any non-2xx status // code is an error. Response headers are in either -// *Empty.ServerResponse.Header or (if a response was returned at all) +// *LogView.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 *BillingAccountsLocationsBucketsViewsDeleteCall) Do(opts ...googleapi.CallOption) (*Empty, error) { +func (c *BillingAccountsLocationsBucketsViewsGetCall) Do(opts ...googleapi.CallOption) (*LogView, error) { gensupport.SetOptions(c.urlParams_, opts...) res, err := c.doRequest("json") if res != nil && res.StatusCode == http.StatusNotModified { @@ -6753,7 +6717,7 @@ func (c *BillingAccountsLocationsBucketsViewsDeleteCall) Do(opts ...googleapi.Ca if err := googleapi.CheckResponse(res); err != nil { return nil, err } - ret := &Empty{ + ret := &LogView{ ServerResponse: googleapi.ServerResponse{ Header: res.Header, HTTPStatusCode: res.StatusCode, @@ -6765,16 +6729,16 @@ func (c *BillingAccountsLocationsBucketsViewsDeleteCall) Do(opts ...googleapi.Ca } return ret, nil // { - // "description": "Deletes a view on a log bucket. If an UNAVAILABLE error is returned, this indicates that system is not in a state where it can delete the view. If this occurs, please try again in a few minutes.", + // "description": "Gets a view on a log bucket..", // "flatPath": "v2/billingAccounts/{billingAccountsId}/locations/{locationsId}/buckets/{bucketsId}/views/{viewsId}", - // "httpMethod": "DELETE", - // "id": "logging.billingAccounts.locations.buckets.views.delete", + // "httpMethod": "GET", + // "id": "logging.billingAccounts.locations.buckets.views.get", // "parameterOrder": [ // "name" // ], // "parameters": { // "name": { - // "description": "Required. The full resource name of the view to delete: \"projects/[PROJECT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/views/[VIEW_ID]\" For example:\"projects/my-project/locations/global/buckets/my-bucket/views/my-view\"", + // "description": "Required. The resource name of the policy: \"projects/[PROJECT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/views/[VIEW_ID]\" For example:\"projects/my-project/locations/global/buckets/my-bucket/views/my-view\"", // "location": "path", // "pattern": "^billingAccounts/[^/]+/locations/[^/]+/buckets/[^/]+/views/[^/]+$", // "required": true, @@ -6783,11 +6747,13 @@ func (c *BillingAccountsLocationsBucketsViewsDeleteCall) Do(opts ...googleapi.Ca // }, // "path": "v2/{+name}", // "response": { - // "$ref": "Empty" + // "$ref": "LogView" // }, // "scopes": [ // "https://www.googleapis.com/auth/cloud-platform", - // "https://www.googleapis.com/auth/logging.admin" + // "https://www.googleapis.com/auth/cloud-platform.read-only", + // "https://www.googleapis.com/auth/logging.admin", + // "https://www.googleapis.com/auth/logging.read" // ] // } @@ -7356,112 +7322,264 @@ func (c *BillingAccountsLocationsBucketsViewsLogsListCall) Do(opts ...googleapi. // }, // "path": "v2/{+parent}/logs", // "response": { - // "$ref": "ListLogsResponse" + // "$ref": "ListLogsResponse" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/cloud-platform", + // "https://www.googleapis.com/auth/cloud-platform.read-only", + // "https://www.googleapis.com/auth/logging.admin", + // "https://www.googleapis.com/auth/logging.read" + // ] + // } + +} + +// 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 *BillingAccountsLocationsBucketsViewsLogsListCall) Pages(ctx context.Context, f func(*ListLogsResponse) 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 "logging.billingAccounts.locations.operations.cancel": + +type BillingAccountsLocationsOperationsCancelCall struct { + s *Service + name string + canceloperationrequest *CancelOperationRequest + urlParams_ gensupport.URLParams + ctx_ context.Context + header_ http.Header +} + +// Cancel: Starts asynchronous cancellation on a long-running operation. +// The server makes a best effort to cancel the operation, but success +// is not guaranteed. If the server doesn't support this method, it +// returns google.rpc.Code.UNIMPLEMENTED. Clients can use +// Operations.GetOperation or other methods to check whether the +// cancellation succeeded or whether the operation completed despite +// cancellation. On successful cancellation, the operation is not +// deleted; instead, it becomes an operation with an Operation.error +// value with a google.rpc.Status.code of 1, corresponding to +// Code.CANCELLED. +// +// - name: The name of the operation resource to be cancelled. +func (r *BillingAccountsLocationsOperationsService) Cancel(name string, canceloperationrequest *CancelOperationRequest) *BillingAccountsLocationsOperationsCancelCall { + c := &BillingAccountsLocationsOperationsCancelCall{s: r.s, urlParams_: make(gensupport.URLParams)} + c.name = name + c.canceloperationrequest = canceloperationrequest + 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 *BillingAccountsLocationsOperationsCancelCall) Fields(s ...googleapi.Field) *BillingAccountsLocationsOperationsCancelCall { + 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 *BillingAccountsLocationsOperationsCancelCall) Context(ctx context.Context) *BillingAccountsLocationsOperationsCancelCall { + 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 *BillingAccountsLocationsOperationsCancelCall) Header() http.Header { + if c.header_ == nil { + c.header_ = make(http.Header) + } + return c.header_ +} + +func (c *BillingAccountsLocationsOperationsCancelCall) 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.canceloperationrequest) + 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}:cancel") + 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 "logging.billingAccounts.locations.operations.cancel" call. +// Exactly one of *Empty or error will be non-nil. Any non-2xx status +// code is an error. Response headers are in either +// *Empty.ServerResponse.Header or (if a response was returned at all) +// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to +// check whether the returned error was because http.StatusNotModified +// was returned. +func (c *BillingAccountsLocationsOperationsCancelCall) Do(opts ...googleapi.CallOption) (*Empty, error) { + gensupport.SetOptions(c.urlParams_, opts...) + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &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 := &Empty{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + target := &ret + if err := gensupport.DecodeResponse(target, res); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Starts asynchronous cancellation on a long-running operation. The server makes a best effort to cancel the operation, but success is not guaranteed. If the server doesn't support this method, it returns google.rpc.Code.UNIMPLEMENTED. Clients can use Operations.GetOperation or other methods to check whether the cancellation succeeded or whether the operation completed despite cancellation. On successful cancellation, the operation is not deleted; instead, it becomes an operation with an Operation.error value with a google.rpc.Status.code of 1, corresponding to Code.CANCELLED.", + // "flatPath": "v2/billingAccounts/{billingAccountsId}/locations/{locationsId}/operations/{operationsId}:cancel", + // "httpMethod": "POST", + // "id": "logging.billingAccounts.locations.operations.cancel", + // "parameterOrder": [ + // "name" + // ], + // "parameters": { + // "name": { + // "description": "The name of the operation resource to be cancelled.", + // "location": "path", + // "pattern": "^billingAccounts/[^/]+/locations/[^/]+/operations/[^/]+$", + // "required": true, + // "type": "string" + // } + // }, + // "path": "v2/{+name}:cancel", + // "request": { + // "$ref": "CancelOperationRequest" + // }, + // "response": { + // "$ref": "Empty" // }, // "scopes": [ // "https://www.googleapis.com/auth/cloud-platform", - // "https://www.googleapis.com/auth/cloud-platform.read-only", - // "https://www.googleapis.com/auth/logging.admin", - // "https://www.googleapis.com/auth/logging.read" + // "https://www.googleapis.com/auth/logging.admin" // ] // } } -// 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 *BillingAccountsLocationsBucketsViewsLogsListCall) Pages(ctx context.Context, f func(*ListLogsResponse) 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 "logging.billingAccounts.locations.operations.cancel": +// method id "logging.billingAccounts.locations.operations.get": -type BillingAccountsLocationsOperationsCancelCall struct { - s *Service - name string - canceloperationrequest *CancelOperationRequest - urlParams_ gensupport.URLParams - ctx_ context.Context - header_ http.Header +type BillingAccountsLocationsOperationsGetCall struct { + s *Service + name string + urlParams_ gensupport.URLParams + ifNoneMatch_ string + ctx_ context.Context + header_ http.Header } -// Cancel: Starts asynchronous cancellation on a long-running operation. -// The server makes a best effort to cancel the operation, but success -// is not guaranteed. If the server doesn't support this method, it -// returns google.rpc.Code.UNIMPLEMENTED. Clients can use -// Operations.GetOperation or other methods to check whether the -// cancellation succeeded or whether the operation completed despite -// cancellation. On successful cancellation, the operation is not -// deleted; instead, it becomes an operation with an Operation.error -// value with a google.rpc.Status.code of 1, corresponding to -// Code.CANCELLED. +// Get: Gets the latest state of a long-running operation. Clients can +// use this method to poll the operation result at intervals as +// recommended by the API service. // -// - name: The name of the operation resource to be cancelled. -func (r *BillingAccountsLocationsOperationsService) Cancel(name string, canceloperationrequest *CancelOperationRequest) *BillingAccountsLocationsOperationsCancelCall { - c := &BillingAccountsLocationsOperationsCancelCall{s: r.s, urlParams_: make(gensupport.URLParams)} +// - name: The name of the operation resource. +func (r *BillingAccountsLocationsOperationsService) Get(name string) *BillingAccountsLocationsOperationsGetCall { + c := &BillingAccountsLocationsOperationsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)} c.name = name - c.canceloperationrequest = canceloperationrequest 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 *BillingAccountsLocationsOperationsCancelCall) Fields(s ...googleapi.Field) *BillingAccountsLocationsOperationsCancelCall { +func (c *BillingAccountsLocationsOperationsGetCall) Fields(s ...googleapi.Field) *BillingAccountsLocationsOperationsGetCall { 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 *BillingAccountsLocationsOperationsGetCall) IfNoneMatch(entityTag string) *BillingAccountsLocationsOperationsGetCall { + 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 *BillingAccountsLocationsOperationsCancelCall) Context(ctx context.Context) *BillingAccountsLocationsOperationsCancelCall { +func (c *BillingAccountsLocationsOperationsGetCall) Context(ctx context.Context) *BillingAccountsLocationsOperationsGetCall { 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 *BillingAccountsLocationsOperationsCancelCall) Header() http.Header { +func (c *BillingAccountsLocationsOperationsGetCall) Header() http.Header { if c.header_ == nil { c.header_ = make(http.Header) } return c.header_ } -func (c *BillingAccountsLocationsOperationsCancelCall) doRequest(alt string) (*http.Response, error) { +func (c *BillingAccountsLocationsOperationsGetCall) 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.canceloperationrequest) - if err != nil { - return nil, err + if c.ifNoneMatch_ != "" { + reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - reqHeaders.Set("Content-Type", "application/json") + var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") - urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+name}:cancel") + urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("POST", urls, body) + req, err := http.NewRequest("GET", urls, body) if err != nil { return nil, err } @@ -7472,14 +7590,14 @@ func (c *BillingAccountsLocationsOperationsCancelCall) doRequest(alt string) (*h return gensupport.SendRequest(c.ctx_, c.s.client, req) } -// Do executes the "logging.billingAccounts.locations.operations.cancel" call. -// Exactly one of *Empty or error will be non-nil. Any non-2xx status -// code is an error. Response headers are in either -// *Empty.ServerResponse.Header or (if a response was returned at all) -// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to -// check whether the returned error was because http.StatusNotModified -// was returned. -func (c *BillingAccountsLocationsOperationsCancelCall) Do(opts ...googleapi.CallOption) (*Empty, error) { +// Do executes the "logging.billingAccounts.locations.operations.get" 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 *BillingAccountsLocationsOperationsGetCall) Do(opts ...googleapi.CallOption) (*Operation, error) { gensupport.SetOptions(c.urlParams_, opts...) res, err := c.doRequest("json") if res != nil && res.StatusCode == http.StatusNotModified { @@ -7498,7 +7616,7 @@ func (c *BillingAccountsLocationsOperationsCancelCall) Do(opts ...googleapi.Call if err := googleapi.CheckResponse(res); err != nil { return nil, err } - ret := &Empty{ + ret := &Operation{ ServerResponse: googleapi.ServerResponse{ Header: res.Header, HTTPStatusCode: res.StatusCode, @@ -7510,32 +7628,31 @@ func (c *BillingAccountsLocationsOperationsCancelCall) Do(opts ...googleapi.Call } return ret, nil // { - // "description": "Starts asynchronous cancellation on a long-running operation. The server makes a best effort to cancel the operation, but success is not guaranteed. If the server doesn't support this method, it returns google.rpc.Code.UNIMPLEMENTED. Clients can use Operations.GetOperation or other methods to check whether the cancellation succeeded or whether the operation completed despite cancellation. On successful cancellation, the operation is not deleted; instead, it becomes an operation with an Operation.error value with a google.rpc.Status.code of 1, corresponding to Code.CANCELLED.", - // "flatPath": "v2/billingAccounts/{billingAccountsId}/locations/{locationsId}/operations/{operationsId}:cancel", - // "httpMethod": "POST", - // "id": "logging.billingAccounts.locations.operations.cancel", + // "description": "Gets the latest state of a long-running operation. Clients can use this method to poll the operation result at intervals as recommended by the API service.", + // "flatPath": "v2/billingAccounts/{billingAccountsId}/locations/{locationsId}/operations/{operationsId}", + // "httpMethod": "GET", + // "id": "logging.billingAccounts.locations.operations.get", // "parameterOrder": [ // "name" // ], // "parameters": { // "name": { - // "description": "The name of the operation resource to be cancelled.", + // "description": "The name of the operation resource.", // "location": "path", // "pattern": "^billingAccounts/[^/]+/locations/[^/]+/operations/[^/]+$", // "required": true, // "type": "string" // } // }, - // "path": "v2/{+name}:cancel", - // "request": { - // "$ref": "CancelOperationRequest" - // }, + // "path": "v2/{+name}", // "response": { - // "$ref": "Empty" + // "$ref": "Operation" // }, // "scopes": [ // "https://www.googleapis.com/auth/cloud-platform", - // "https://www.googleapis.com/auth/logging.admin" + // "https://www.googleapis.com/auth/cloud-platform.read-only", + // "https://www.googleapis.com/auth/logging.admin", + // "https://www.googleapis.com/auth/logging.read" // ] // } @@ -8127,157 +8244,6 @@ func (c *BillingAccountsLogsListCall) Pages(ctx context.Context, f func(*ListLog } } -// method id "logging.billingAccounts.operations.get": - -type BillingAccountsOperationsGetCall struct { - s *Service - name string - urlParams_ gensupport.URLParams - ifNoneMatch_ string - ctx_ context.Context - header_ http.Header -} - -// Get: Gets the latest state of a long-running operation. Clients can -// use this method to poll the operation result at intervals as -// recommended by the API service. -// -// - name: The name of the operation resource. -func (r *BillingAccountsOperationsService) Get(name string) *BillingAccountsOperationsGetCall { - c := &BillingAccountsOperationsGetCall{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 *BillingAccountsOperationsGetCall) Fields(s ...googleapi.Field) *BillingAccountsOperationsGetCall { - 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 *BillingAccountsOperationsGetCall) IfNoneMatch(entityTag string) *BillingAccountsOperationsGetCall { - 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 *BillingAccountsOperationsGetCall) Context(ctx context.Context) *BillingAccountsOperationsGetCall { - 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 *BillingAccountsOperationsGetCall) Header() http.Header { - if c.header_ == nil { - c.header_ = make(http.Header) - } - return c.header_ -} - -func (c *BillingAccountsOperationsGetCall) 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 "logging.billingAccounts.operations.get" 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 *BillingAccountsOperationsGetCall) 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": "Gets the latest state of a long-running operation. Clients can use this method to poll the operation result at intervals as recommended by the API service.", - // "flatPath": "v2/billingAccounts/{billingAccountsId}/operations/{operationsId}", - // "httpMethod": "GET", - // "id": "logging.billingAccounts.operations.get", - // "parameterOrder": [ - // "name" - // ], - // "parameters": { - // "name": { - // "description": "The name of the operation resource.", - // "location": "path", - // "pattern": "^billingAccounts/[^/]+/operations/[^/]+$", - // "required": true, - // "type": "string" - // } - // }, - // "path": "v2/{+name}", - // "response": { - // "$ref": "Operation" - // }, - // "scopes": [ - // "https://www.googleapis.com/auth/cloud-platform", - // "https://www.googleapis.com/auth/cloud-platform.read-only", - // "https://www.googleapis.com/auth/logging.admin", - // "https://www.googleapis.com/auth/logging.read" - // ] - // } - -} - // method id "logging.billingAccounts.sinks.create": type BillingAccountsSinksCreateCall struct { diff --git a/retail/v2alpha/retail-api.json b/retail/v2alpha/retail-api.json index 0b7765336b4..94f81721f36 100644 --- a/retail/v2alpha/retail-api.json +++ b/retail/v2alpha/retail-api.json @@ -1803,7 +1803,7 @@ } } }, - "revision": "20220617", + "revision": "20220623", "rootUrl": "https://retail.googleapis.com/", "schemas": { "GoogleApiHttpBody": { @@ -2416,7 +2416,7 @@ "type": "string" }, "key": { - "description": "Required. Attribute name. For example: `color`, `brands`, `attributes.custom_attribute`, such as `attributes.xyz`.", + "description": "Required. Attribute name. For example: `color`, `brands`, `attributes.custom_attribute`, such as `attributes.xyz`. To be indexable, the attribute name can contain only alpha-numeric characters and underscores. For example, an attribute named `attributes.abc_xyz` can be indexed, but an attribute named `attributes.abc-xyz` cannot be indexed.", "type": "string" }, "recommendationsFilteringOption": { diff --git a/retail/v2alpha/retail-gen.go b/retail/v2alpha/retail-gen.go index 53f8ffaae7b..926911d77a7 100644 --- a/retail/v2alpha/retail-gen.go +++ b/retail/v2alpha/retail-gen.go @@ -1447,7 +1447,11 @@ type GoogleCloudRetailV2alphaCatalogAttribute struct { IndexableOption string `json:"indexableOption,omitempty"` // Key: Required. Attribute name. For example: `color`, `brands`, - // `attributes.custom_attribute`, such as `attributes.xyz`. + // `attributes.custom_attribute`, such as `attributes.xyz`. To be + // indexable, the attribute name can contain only alpha-numeric + // characters and underscores. For example, an attribute named + // `attributes.abc_xyz` can be indexed, but an attribute named + // `attributes.abc-xyz` cannot be indexed. Key string `json:"key,omitempty"` // RecommendationsFilteringOption: When diff --git a/retail/v2beta/retail-api.json b/retail/v2beta/retail-api.json index 27be4109858..f34cc34c838 100644 --- a/retail/v2beta/retail-api.json +++ b/retail/v2beta/retail-api.json @@ -1770,7 +1770,7 @@ } } }, - "revision": "20220617", + "revision": "20220623", "rootUrl": "https://retail.googleapis.com/", "schemas": { "GoogleApiHttpBody": { @@ -2706,7 +2706,7 @@ "type": "string" }, "key": { - "description": "Required. Attribute name. For example: `color`, `brands`, `attributes.custom_attribute`, such as `attributes.xyz`.", + "description": "Required. Attribute name. For example: `color`, `brands`, `attributes.custom_attribute`, such as `attributes.xyz`. To be indexable, the attribute name can contain only alpha-numeric characters and underscores. For example, an attribute named `attributes.abc_xyz` can be indexed, but an attribute named `attributes.abc-xyz` cannot be indexed.", "type": "string" }, "recommendationsFilteringOption": { diff --git a/retail/v2beta/retail-gen.go b/retail/v2beta/retail-gen.go index 970d2e0114f..4a57f28a6f0 100644 --- a/retail/v2beta/retail-gen.go +++ b/retail/v2beta/retail-gen.go @@ -2035,7 +2035,11 @@ type GoogleCloudRetailV2betaCatalogAttribute struct { IndexableOption string `json:"indexableOption,omitempty"` // Key: Required. Attribute name. For example: `color`, `brands`, - // `attributes.custom_attribute`, such as `attributes.xyz`. + // `attributes.custom_attribute`, such as `attributes.xyz`. To be + // indexable, the attribute name can contain only alpha-numeric + // characters and underscores. For example, an attribute named + // `attributes.abc_xyz` can be indexed, but an attribute named + // `attributes.abc-xyz` cannot be indexed. Key string `json:"key,omitempty"` // RecommendationsFilteringOption: When diff --git a/servicedirectory/v1beta1/servicedirectory-api.json b/servicedirectory/v1beta1/servicedirectory-api.json index dd64703d4b6..273f8bcd36e 100644 --- a/servicedirectory/v1beta1/servicedirectory-api.json +++ b/servicedirectory/v1beta1/servicedirectory-api.json @@ -399,7 +399,7 @@ ] }, "testIamPermissions": { - "description": "Tests IAM permissions for a resource (namespace or service only).", + "description": "Tests IAM permissions for a resource (namespace, service or service workload only).", "flatPath": "v1beta1/projects/{projectsId}/locations/{locationsId}/namespaces/{namespacesId}:testIamPermissions", "httpMethod": "POST", "id": "servicedirectory.projects.locations.namespaces.testIamPermissions", @@ -428,6 +428,94 @@ } }, "resources": { + "serviceWorkloads": { + "methods": { + "getIamPolicy": { + "description": "Gets the IAM Policy for a resource (namespace or service only).", + "flatPath": "v1beta1/projects/{projectsId}/locations/{locationsId}/namespaces/{namespacesId}/serviceWorkloads/{serviceWorkloadsId}:getIamPolicy", + "httpMethod": "POST", + "id": "servicedirectory.projects.locations.namespaces.serviceWorkloads.getIamPolicy", + "parameterOrder": [ + "resource" + ], + "parameters": { + "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/[^/]+/namespaces/[^/]+/serviceWorkloads/[^/]+$", + "required": true, + "type": "string" + } + }, + "path": "v1beta1/{+resource}:getIamPolicy", + "request": { + "$ref": "GetIamPolicyRequest" + }, + "response": { + "$ref": "Policy" + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform" + ] + }, + "setIamPolicy": { + "description": "Sets the IAM Policy for a resource (namespace or service only).", + "flatPath": "v1beta1/projects/{projectsId}/locations/{locationsId}/namespaces/{namespacesId}/serviceWorkloads/{serviceWorkloadsId}:setIamPolicy", + "httpMethod": "POST", + "id": "servicedirectory.projects.locations.namespaces.serviceWorkloads.setIamPolicy", + "parameterOrder": [ + "resource" + ], + "parameters": { + "resource": { + "description": "REQUIRED: The resource for which the policy is being specified. See [Resource names](https://cloud.google.com/apis/design/resource_names) for the appropriate value for this field.", + "location": "path", + "pattern": "^projects/[^/]+/locations/[^/]+/namespaces/[^/]+/serviceWorkloads/[^/]+$", + "required": true, + "type": "string" + } + }, + "path": "v1beta1/{+resource}:setIamPolicy", + "request": { + "$ref": "SetIamPolicyRequest" + }, + "response": { + "$ref": "Policy" + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform" + ] + }, + "testIamPermissions": { + "description": "Tests IAM permissions for a resource (namespace, service or service workload only).", + "flatPath": "v1beta1/projects/{projectsId}/locations/{locationsId}/namespaces/{namespacesId}/serviceWorkloads/{serviceWorkloadsId}:testIamPermissions", + "httpMethod": "POST", + "id": "servicedirectory.projects.locations.namespaces.serviceWorkloads.testIamPermissions", + "parameterOrder": [ + "resource" + ], + "parameters": { + "resource": { + "description": "REQUIRED: The resource for which the policy detail is being requested. See [Resource names](https://cloud.google.com/apis/design/resource_names) for the appropriate value for this field.", + "location": "path", + "pattern": "^projects/[^/]+/locations/[^/]+/namespaces/[^/]+/serviceWorkloads/[^/]+$", + "required": true, + "type": "string" + } + }, + "path": "v1beta1/{+resource}:testIamPermissions", + "request": { + "$ref": "TestIamPermissionsRequest" + }, + "response": { + "$ref": "TestIamPermissionsResponse" + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform" + ] + } + } + }, "services": { "methods": { "create": { @@ -678,7 +766,7 @@ ] }, "testIamPermissions": { - "description": "Tests IAM permissions for a resource (namespace or service only).", + "description": "Tests IAM permissions for a resource (namespace, service or service workload only).", "flatPath": "v1beta1/projects/{projectsId}/locations/{locationsId}/namespaces/{namespacesId}/services/{servicesId}:testIamPermissions", "httpMethod": "POST", "id": "servicedirectory.projects.locations.namespaces.services.testIamPermissions", @@ -883,7 +971,7 @@ } } }, - "revision": "20220608", + "revision": "20220622", "rootUrl": "https://servicedirectory.googleapis.com/", "schemas": { "Binding": { diff --git a/servicedirectory/v1beta1/servicedirectory-gen.go b/servicedirectory/v1beta1/servicedirectory-gen.go index f269bc2021a..3844098f15d 100644 --- a/servicedirectory/v1beta1/servicedirectory-gen.go +++ b/servicedirectory/v1beta1/servicedirectory-gen.go @@ -163,6 +163,7 @@ type ProjectsLocationsService struct { func NewProjectsLocationsNamespacesService(s *APIService) *ProjectsLocationsNamespacesService { rs := &ProjectsLocationsNamespacesService{s: s} + rs.ServiceWorkloads = NewProjectsLocationsNamespacesServiceWorkloadsService(s) rs.Services = NewProjectsLocationsNamespacesServicesService(s) return rs } @@ -170,9 +171,20 @@ func NewProjectsLocationsNamespacesService(s *APIService) *ProjectsLocationsName type ProjectsLocationsNamespacesService struct { s *APIService + ServiceWorkloads *ProjectsLocationsNamespacesServiceWorkloadsService + Services *ProjectsLocationsNamespacesServicesService } +func NewProjectsLocationsNamespacesServiceWorkloadsService(s *APIService) *ProjectsLocationsNamespacesServiceWorkloadsService { + rs := &ProjectsLocationsNamespacesServiceWorkloadsService{s: s} + return rs +} + +type ProjectsLocationsNamespacesServiceWorkloadsService struct { + s *APIService +} + func NewProjectsLocationsNamespacesServicesService(s *APIService) *ProjectsLocationsNamespacesServicesService { rs := &ProjectsLocationsNamespacesServicesService{s: s} rs.Endpoints = NewProjectsLocationsNamespacesServicesEndpointsService(s) @@ -2583,8 +2595,8 @@ type ProjectsLocationsNamespacesTestIamPermissionsCall struct { header_ http.Header } -// TestIamPermissions: Tests IAM permissions for a resource (namespace -// or service only). +// TestIamPermissions: Tests IAM permissions for a resource (namespace, +// service or service workload only). // // - resource: REQUIRED: The resource for which the policy detail is // being requested. See Resource names @@ -2688,7 +2700,7 @@ func (c *ProjectsLocationsNamespacesTestIamPermissionsCall) Do(opts ...googleapi } return ret, nil // { - // "description": "Tests IAM permissions for a resource (namespace or service only).", + // "description": "Tests IAM permissions for a resource (namespace, service or service workload only).", // "flatPath": "v1beta1/projects/{projectsId}/locations/{locationsId}/namespaces/{namespacesId}:testIamPermissions", // "httpMethod": "POST", // "id": "servicedirectory.projects.locations.namespaces.testIamPermissions", @@ -2718,6 +2730,444 @@ func (c *ProjectsLocationsNamespacesTestIamPermissionsCall) Do(opts ...googleapi } +// method id "servicedirectory.projects.locations.namespaces.serviceWorkloads.getIamPolicy": + +type ProjectsLocationsNamespacesServiceWorkloadsGetIamPolicyCall struct { + s *APIService + resource string + getiampolicyrequest *GetIamPolicyRequest + urlParams_ gensupport.URLParams + ctx_ context.Context + header_ http.Header +} + +// GetIamPolicy: Gets the IAM Policy for a resource (namespace or +// service only). +// +// - 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 *ProjectsLocationsNamespacesServiceWorkloadsService) GetIamPolicy(resource string, getiampolicyrequest *GetIamPolicyRequest) *ProjectsLocationsNamespacesServiceWorkloadsGetIamPolicyCall { + c := &ProjectsLocationsNamespacesServiceWorkloadsGetIamPolicyCall{s: r.s, urlParams_: make(gensupport.URLParams)} + c.resource = resource + c.getiampolicyrequest = getiampolicyrequest + 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 *ProjectsLocationsNamespacesServiceWorkloadsGetIamPolicyCall) Fields(s ...googleapi.Field) *ProjectsLocationsNamespacesServiceWorkloadsGetIamPolicyCall { + 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 *ProjectsLocationsNamespacesServiceWorkloadsGetIamPolicyCall) Context(ctx context.Context) *ProjectsLocationsNamespacesServiceWorkloadsGetIamPolicyCall { + 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 *ProjectsLocationsNamespacesServiceWorkloadsGetIamPolicyCall) Header() http.Header { + if c.header_ == nil { + c.header_ = make(http.Header) + } + return c.header_ +} + +func (c *ProjectsLocationsNamespacesServiceWorkloadsGetIamPolicyCall) 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.getiampolicyrequest) + 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, "v1beta1/{+resource}:getIamPolicy") + 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{ + "resource": c.resource, + }) + return gensupport.SendRequest(c.ctx_, c.s.client, req) +} + +// Do executes the "servicedirectory.projects.locations.namespaces.serviceWorkloads.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 *ProjectsLocationsNamespacesServiceWorkloadsGetIamPolicyCall) 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 IAM Policy for a resource (namespace or service only).", + // "flatPath": "v1beta1/projects/{projectsId}/locations/{locationsId}/namespaces/{namespacesId}/serviceWorkloads/{serviceWorkloadsId}:getIamPolicy", + // "httpMethod": "POST", + // "id": "servicedirectory.projects.locations.namespaces.serviceWorkloads.getIamPolicy", + // "parameterOrder": [ + // "resource" + // ], + // "parameters": { + // "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/[^/]+/namespaces/[^/]+/serviceWorkloads/[^/]+$", + // "required": true, + // "type": "string" + // } + // }, + // "path": "v1beta1/{+resource}:getIamPolicy", + // "request": { + // "$ref": "GetIamPolicyRequest" + // }, + // "response": { + // "$ref": "Policy" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/cloud-platform" + // ] + // } + +} + +// method id "servicedirectory.projects.locations.namespaces.serviceWorkloads.setIamPolicy": + +type ProjectsLocationsNamespacesServiceWorkloadsSetIamPolicyCall struct { + s *APIService + resource string + setiampolicyrequest *SetIamPolicyRequest + urlParams_ gensupport.URLParams + ctx_ context.Context + header_ http.Header +} + +// SetIamPolicy: Sets the IAM Policy for a resource (namespace or +// service only). +// +// - resource: REQUIRED: The resource for which the policy is being +// specified. See Resource names +// (https://cloud.google.com/apis/design/resource_names) for the +// appropriate value for this field. +func (r *ProjectsLocationsNamespacesServiceWorkloadsService) SetIamPolicy(resource string, setiampolicyrequest *SetIamPolicyRequest) *ProjectsLocationsNamespacesServiceWorkloadsSetIamPolicyCall { + c := &ProjectsLocationsNamespacesServiceWorkloadsSetIamPolicyCall{s: r.s, urlParams_: make(gensupport.URLParams)} + c.resource = resource + c.setiampolicyrequest = setiampolicyrequest + 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 *ProjectsLocationsNamespacesServiceWorkloadsSetIamPolicyCall) Fields(s ...googleapi.Field) *ProjectsLocationsNamespacesServiceWorkloadsSetIamPolicyCall { + 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 *ProjectsLocationsNamespacesServiceWorkloadsSetIamPolicyCall) Context(ctx context.Context) *ProjectsLocationsNamespacesServiceWorkloadsSetIamPolicyCall { + 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 *ProjectsLocationsNamespacesServiceWorkloadsSetIamPolicyCall) Header() http.Header { + if c.header_ == nil { + c.header_ = make(http.Header) + } + return c.header_ +} + +func (c *ProjectsLocationsNamespacesServiceWorkloadsSetIamPolicyCall) 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.setiampolicyrequest) + 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, "v1beta1/{+resource}:setIamPolicy") + 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{ + "resource": c.resource, + }) + return gensupport.SendRequest(c.ctx_, c.s.client, req) +} + +// Do executes the "servicedirectory.projects.locations.namespaces.serviceWorkloads.setIamPolicy" 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 *ProjectsLocationsNamespacesServiceWorkloadsSetIamPolicyCall) 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": "Sets the IAM Policy for a resource (namespace or service only).", + // "flatPath": "v1beta1/projects/{projectsId}/locations/{locationsId}/namespaces/{namespacesId}/serviceWorkloads/{serviceWorkloadsId}:setIamPolicy", + // "httpMethod": "POST", + // "id": "servicedirectory.projects.locations.namespaces.serviceWorkloads.setIamPolicy", + // "parameterOrder": [ + // "resource" + // ], + // "parameters": { + // "resource": { + // "description": "REQUIRED: The resource for which the policy is being specified. See [Resource names](https://cloud.google.com/apis/design/resource_names) for the appropriate value for this field.", + // "location": "path", + // "pattern": "^projects/[^/]+/locations/[^/]+/namespaces/[^/]+/serviceWorkloads/[^/]+$", + // "required": true, + // "type": "string" + // } + // }, + // "path": "v1beta1/{+resource}:setIamPolicy", + // "request": { + // "$ref": "SetIamPolicyRequest" + // }, + // "response": { + // "$ref": "Policy" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/cloud-platform" + // ] + // } + +} + +// method id "servicedirectory.projects.locations.namespaces.serviceWorkloads.testIamPermissions": + +type ProjectsLocationsNamespacesServiceWorkloadsTestIamPermissionsCall struct { + s *APIService + resource string + testiampermissionsrequest *TestIamPermissionsRequest + urlParams_ gensupport.URLParams + ctx_ context.Context + header_ http.Header +} + +// TestIamPermissions: Tests IAM permissions for a resource (namespace, +// service or service workload only). +// +// - resource: REQUIRED: The resource for which the policy detail is +// being requested. See Resource names +// (https://cloud.google.com/apis/design/resource_names) for the +// appropriate value for this field. +func (r *ProjectsLocationsNamespacesServiceWorkloadsService) TestIamPermissions(resource string, testiampermissionsrequest *TestIamPermissionsRequest) *ProjectsLocationsNamespacesServiceWorkloadsTestIamPermissionsCall { + c := &ProjectsLocationsNamespacesServiceWorkloadsTestIamPermissionsCall{s: r.s, urlParams_: make(gensupport.URLParams)} + c.resource = resource + c.testiampermissionsrequest = testiampermissionsrequest + 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 *ProjectsLocationsNamespacesServiceWorkloadsTestIamPermissionsCall) Fields(s ...googleapi.Field) *ProjectsLocationsNamespacesServiceWorkloadsTestIamPermissionsCall { + 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 *ProjectsLocationsNamespacesServiceWorkloadsTestIamPermissionsCall) Context(ctx context.Context) *ProjectsLocationsNamespacesServiceWorkloadsTestIamPermissionsCall { + 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 *ProjectsLocationsNamespacesServiceWorkloadsTestIamPermissionsCall) Header() http.Header { + if c.header_ == nil { + c.header_ = make(http.Header) + } + return c.header_ +} + +func (c *ProjectsLocationsNamespacesServiceWorkloadsTestIamPermissionsCall) 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.testiampermissionsrequest) + 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, "v1beta1/{+resource}:testIamPermissions") + 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{ + "resource": c.resource, + }) + return gensupport.SendRequest(c.ctx_, c.s.client, req) +} + +// Do executes the "servicedirectory.projects.locations.namespaces.serviceWorkloads.testIamPermissions" call. +// Exactly one of *TestIamPermissionsResponse or error will be non-nil. +// Any non-2xx status code is an error. Response headers are in either +// *TestIamPermissionsResponse.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 *ProjectsLocationsNamespacesServiceWorkloadsTestIamPermissionsCall) Do(opts ...googleapi.CallOption) (*TestIamPermissionsResponse, 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 := &TestIamPermissionsResponse{ + 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": "Tests IAM permissions for a resource (namespace, service or service workload only).", + // "flatPath": "v1beta1/projects/{projectsId}/locations/{locationsId}/namespaces/{namespacesId}/serviceWorkloads/{serviceWorkloadsId}:testIamPermissions", + // "httpMethod": "POST", + // "id": "servicedirectory.projects.locations.namespaces.serviceWorkloads.testIamPermissions", + // "parameterOrder": [ + // "resource" + // ], + // "parameters": { + // "resource": { + // "description": "REQUIRED: The resource for which the policy detail is being requested. See [Resource names](https://cloud.google.com/apis/design/resource_names) for the appropriate value for this field.", + // "location": "path", + // "pattern": "^projects/[^/]+/locations/[^/]+/namespaces/[^/]+/serviceWorkloads/[^/]+$", + // "required": true, + // "type": "string" + // } + // }, + // "path": "v1beta1/{+resource}:testIamPermissions", + // "request": { + // "$ref": "TestIamPermissionsRequest" + // }, + // "response": { + // "$ref": "TestIamPermissionsResponse" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/cloud-platform" + // ] + // } + +} + // method id "servicedirectory.projects.locations.namespaces.services.create": type ProjectsLocationsNamespacesServicesCreateCall struct { @@ -3998,8 +4448,8 @@ type ProjectsLocationsNamespacesServicesTestIamPermissionsCall struct { header_ http.Header } -// TestIamPermissions: Tests IAM permissions for a resource (namespace -// or service only). +// TestIamPermissions: Tests IAM permissions for a resource (namespace, +// service or service workload only). // // - resource: REQUIRED: The resource for which the policy detail is // being requested. See Resource names @@ -4103,7 +4553,7 @@ func (c *ProjectsLocationsNamespacesServicesTestIamPermissionsCall) Do(opts ...g } return ret, nil // { - // "description": "Tests IAM permissions for a resource (namespace or service only).", + // "description": "Tests IAM permissions for a resource (namespace, service or service workload only).", // "flatPath": "v1beta1/projects/{projectsId}/locations/{locationsId}/namespaces/{namespacesId}/services/{servicesId}:testIamPermissions", // "httpMethod": "POST", // "id": "servicedirectory.projects.locations.namespaces.services.testIamPermissions", diff --git a/sqladmin/v1/sqladmin-api.json b/sqladmin/v1/sqladmin-api.json index 623c5f2bf82..82020ddbabe 100644 --- a/sqladmin/v1/sqladmin-api.json +++ b/sqladmin/v1/sqladmin-api.json @@ -1762,6 +1762,45 @@ "https://www.googleapis.com/auth/sqlservice.admin" ] }, + "get": { + "description": "Retrieves a resource containing information about a user.", + "flatPath": "v1/projects/{project}/instances/{instance}/users/{name}", + "httpMethod": "GET", + "id": "sql.users.get", + "parameterOrder": [ + "project", + "instance", + "name" + ], + "parameters": { + "instance": { + "description": "Database instance ID. This does not include the project ID.", + "location": "path", + "required": true, + "type": "string" + }, + "name": { + "description": "User of the instance. If the database user has a host, this is specified as {username}@{host} else as {username}.", + "location": "path", + "required": true, + "type": "string" + }, + "project": { + "description": "Project ID of the project that contains the instance.", + "location": "path", + "required": true, + "type": "string" + } + }, + "path": "v1/projects/{project}/instances/{instance}/users/{name}", + "response": { + "$ref": "User" + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/sqlservice.admin" + ] + }, "insert": { "description": "Creates a new user in a Cloud SQL instance.", "flatPath": "v1/projects/{project}/instances/{instance}/users", @@ -1877,7 +1916,7 @@ } } }, - "revision": "20220609", + "revision": "20220623", "rootUrl": "https://sqladmin.googleapis.com/", "schemas": { "AclEntry": { @@ -3687,7 +3726,8 @@ "CREATE_CLONE", "RESCHEDULE_MAINTENANCE", "START_EXTERNAL_SYNC", - "LOG_CLEANUP" + "LOG_CLEANUP", + "AUTO_RESTART" ], "enumDescriptions": [ "Unknown operation type.", @@ -3725,7 +3765,8 @@ "Creates clone instance.", "Reschedule maintenance to another time.", "Starts external sync of a Cloud SQL EM replica to an external primary instance.", - "Recovers logs from an instance's old data disk." + "Recovers logs from an instance's old data disk.", + "Performs auto-restart of an HA-enabled Cloud SQL database for auto recovery." ], "type": "string" }, @@ -4666,6 +4707,22 @@ "description": "A Cloud SQL user resource.", "id": "User", "properties": { + "dualPasswordType": { + "description": "Dual password status for the user.", + "enum": [ + "DUAL_PASSWORD_TYPE_UNSPECIFIED", + "NO_MODIFY_DUAL_PASSWORD", + "NO_DUAL_PASSWORD", + "DUAL_PASSWORD" + ], + "enumDescriptions": [ + "The default value.", + "Do not update the user's dual password status.", + "No dual password usable for connecting using this user.", + "Dual password usable for connecting using this user." + ], + "type": "string" + }, "etag": { "description": "This field is deprecated and will be removed from a future version of the API.", "type": "string" @@ -4731,6 +4788,10 @@ "description": "If true, failed login attempts check will be enabled.", "type": "boolean" }, + "enablePasswordVerification": { + "description": "If true, the user must specify the current password before changing the password. This flag is supported only for MySQL.", + "type": "boolean" + }, "passwordExpirationDuration": { "description": "Expiration duration after password is updated.", "format": "google-duration", diff --git a/sqladmin/v1/sqladmin-gen.go b/sqladmin/v1/sqladmin-gen.go index 1f413d4aaf7..9e9d9620b1f 100644 --- a/sqladmin/v1/sqladmin-gen.go +++ b/sqladmin/v1/sqladmin-gen.go @@ -3000,6 +3000,8 @@ type Operation struct { // "START_EXTERNAL_SYNC" - Starts external sync of a Cloud SQL EM // replica to an external primary instance. // "LOG_CLEANUP" - Recovers logs from an instance's old data disk. + // "AUTO_RESTART" - Performs auto-restart of an HA-enabled Cloud SQL + // database for auto recovery. OperationType string `json:"operationType,omitempty"` // SelfLink: The URI of this resource. @@ -4432,6 +4434,18 @@ func (s *TruncateLogContext) MarshalJSON() ([]byte, error) { // User: A Cloud SQL user resource. type User struct { + // DualPasswordType: Dual password status for the user. + // + // Possible values: + // "DUAL_PASSWORD_TYPE_UNSPECIFIED" - The default value. + // "NO_MODIFY_DUAL_PASSWORD" - Do not update the user's dual password + // status. + // "NO_DUAL_PASSWORD" - No dual password usable for connecting using + // this user. + // "DUAL_PASSWORD" - Dual password usable for connecting using this + // user. + DualPasswordType string `json:"dualPasswordType,omitempty"` + // Etag: This field is deprecated and will be removed from a future // version of the API. Etag string `json:"etag,omitempty"` @@ -4477,7 +4491,11 @@ type User struct { // "CLOUD_IAM_SERVICE_ACCOUNT" - Cloud IAM service account. Type string `json:"type,omitempty"` - // ForceSendFields is a list of field names (e.g. "Etag") to + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "DualPasswordType") 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 @@ -4485,12 +4503,13 @@ type User struct { // This may be used to include empty fields in Patch requests. ForceSendFields []string `json:"-"` - // NullFields is a list of field names (e.g. "Etag") to include in API - // requests with the JSON null value. By default, fields with empty - // values are omitted from API requests. However, any field with an - // empty value appearing in NullFields will be sent to the server as - // null. It is an error if a field in this list has a non-empty value. - // This may be used to include null fields in Patch requests. + // NullFields is a list of field names (e.g. "DualPasswordType") 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:"-"` } @@ -4510,6 +4529,11 @@ type UserPasswordValidationPolicy struct { // be enabled. EnableFailedAttemptsCheck bool `json:"enableFailedAttemptsCheck,omitempty"` + // EnablePasswordVerification: If true, the user must specify the + // current password before changing the password. This flag is supported + // only for MySQL. + EnablePasswordVerification bool `json:"enablePasswordVerification,omitempty"` + // PasswordExpirationDuration: Expiration duration after password is // updated. PasswordExpirationDuration string `json:"passwordExpirationDuration,omitempty"` @@ -11908,6 +11932,176 @@ func (c *UsersDeleteCall) Do(opts ...googleapi.CallOption) (*Operation, error) { } +// method id "sql.users.get": + +type UsersGetCall struct { + s *Service + project string + instance string + name string + urlParams_ gensupport.URLParams + ifNoneMatch_ string + ctx_ context.Context + header_ http.Header +} + +// Get: Retrieves a resource containing information about a user. +// +// - instance: Database instance ID. This does not include the project +// ID. +// - name: User of the instance. If the database user has a host, this +// is specified as {username}@{host} else as {username}. +// - project: Project ID of the project that contains the instance. +func (r *UsersService) Get(project string, instance string, name string) *UsersGetCall { + c := &UsersGetCall{s: r.s, urlParams_: make(gensupport.URLParams)} + c.project = project + c.instance = instance + 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 *UsersGetCall) Fields(s ...googleapi.Field) *UsersGetCall { + 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 *UsersGetCall) IfNoneMatch(entityTag string) *UsersGetCall { + 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 *UsersGetCall) Context(ctx context.Context) *UsersGetCall { + 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 *UsersGetCall) Header() http.Header { + if c.header_ == nil { + c.header_ = make(http.Header) + } + return c.header_ +} + +func (c *UsersGetCall) doRequest(alt string) (*http.Response, error) { + reqHeaders := make(http.Header) + reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version) + for k, v := range c.header_ { + reqHeaders[k] = v + } + reqHeaders.Set("User-Agent", c.s.userAgent()) + if c.ifNoneMatch_ != "" { + reqHeaders.Set("If-None-Match", c.ifNoneMatch_) + } + var body io.Reader = nil + c.urlParams_.Set("alt", alt) + c.urlParams_.Set("prettyPrint", "false") + urls := googleapi.ResolveRelative(c.s.BasePath, "v1/projects/{project}/instances/{instance}/users/{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{ + "project": c.project, + "instance": c.instance, + "name": c.name, + }) + return gensupport.SendRequest(c.ctx_, c.s.client, req) +} + +// Do executes the "sql.users.get" call. +// Exactly one of *User or error will be non-nil. Any non-2xx status +// code is an error. Response headers are in either +// *User.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 *UsersGetCall) Do(opts ...googleapi.CallOption) (*User, 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 := &User{ + 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": "Retrieves a resource containing information about a user.", + // "flatPath": "v1/projects/{project}/instances/{instance}/users/{name}", + // "httpMethod": "GET", + // "id": "sql.users.get", + // "parameterOrder": [ + // "project", + // "instance", + // "name" + // ], + // "parameters": { + // "instance": { + // "description": "Database instance ID. This does not include the project ID.", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "name": { + // "description": "User of the instance. If the database user has a host, this is specified as {username}@{host} else as {username}.", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "project": { + // "description": "Project ID of the project that contains the instance.", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "v1/projects/{project}/instances/{instance}/users/{name}", + // "response": { + // "$ref": "User" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/cloud-platform", + // "https://www.googleapis.com/auth/sqlservice.admin" + // ] + // } + +} + // method id "sql.users.insert": type UsersInsertCall struct { diff --git a/sqladmin/v1beta4/sqladmin-api.json b/sqladmin/v1beta4/sqladmin-api.json index 364e76b3c4a..974a8e0db8c 100644 --- a/sqladmin/v1beta4/sqladmin-api.json +++ b/sqladmin/v1beta4/sqladmin-api.json @@ -1762,6 +1762,45 @@ "https://www.googleapis.com/auth/sqlservice.admin" ] }, + "get": { + "description": "Retrieves a resource containing information about a user.", + "flatPath": "sql/v1beta4/projects/{project}/instances/{instance}/users/{name}", + "httpMethod": "GET", + "id": "sql.users.get", + "parameterOrder": [ + "project", + "instance", + "name" + ], + "parameters": { + "instance": { + "description": "Database instance ID. This does not include the project ID.", + "location": "path", + "required": true, + "type": "string" + }, + "name": { + "description": "User of the instance. If the database user has a host, this is specified as {username}@{host} else as {username}.", + "location": "path", + "required": true, + "type": "string" + }, + "project": { + "description": "Project ID of the project that contains the instance.", + "location": "path", + "required": true, + "type": "string" + } + }, + "path": "sql/v1beta4/projects/{project}/instances/{instance}/users/{name}", + "response": { + "$ref": "User" + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/sqlservice.admin" + ] + }, "insert": { "description": "Creates a new user in a Cloud SQL instance.", "flatPath": "sql/v1beta4/projects/{project}/instances/{instance}/users", @@ -1877,7 +1916,7 @@ } } }, - "revision": "20220609", + "revision": "20220623", "rootUrl": "https://sqladmin.googleapis.com/", "schemas": { "AclEntry": { @@ -3687,7 +3726,8 @@ "CREATE_CLONE", "RESCHEDULE_MAINTENANCE", "START_EXTERNAL_SYNC", - "LOG_CLEANUP" + "LOG_CLEANUP", + "AUTO_RESTART" ], "enumDescriptions": [ "Unknown operation type.", @@ -3725,7 +3765,8 @@ "Creates clone instance.", "Reschedule maintenance to another time.", "Starts external sync of a Cloud SQL EM replica to an external primary instance.", - "Recovers logs from an instance's old data disk." + "Recovers logs from an instance's old data disk.", + "Performs auto-restart of an HA-enabled Cloud SQL database for auto recovery." ], "type": "string" }, @@ -4664,6 +4705,22 @@ "description": "A Cloud SQL user resource.", "id": "User", "properties": { + "dualPasswordType": { + "description": "Dual password status for the user.", + "enum": [ + "DUAL_PASSWORD_TYPE_UNSPECIFIED", + "NO_MODIFY_DUAL_PASSWORD", + "NO_DUAL_PASSWORD", + "DUAL_PASSWORD" + ], + "enumDescriptions": [ + "The default value.", + "Do not update the user's dual password status.", + "No dual password usable for connecting using this user.", + "Dual password usable for connecting using this user." + ], + "type": "string" + }, "etag": { "description": "This field is deprecated and will be removed from a future version of the API.", "type": "string" @@ -4729,6 +4786,10 @@ "description": "If true, failed login attempts check will be enabled.", "type": "boolean" }, + "enablePasswordVerification": { + "description": "If true, the user must specify the current password before changing the password. This flag is supported only for MySQL.", + "type": "boolean" + }, "passwordExpirationDuration": { "description": "Expiration duration after password is updated.", "format": "google-duration", diff --git a/sqladmin/v1beta4/sqladmin-gen.go b/sqladmin/v1beta4/sqladmin-gen.go index cbc1cef09b0..1d83475ed9b 100644 --- a/sqladmin/v1beta4/sqladmin-gen.go +++ b/sqladmin/v1beta4/sqladmin-gen.go @@ -3000,6 +3000,8 @@ type Operation struct { // "START_EXTERNAL_SYNC" - Starts external sync of a Cloud SQL EM // replica to an external primary instance. // "LOG_CLEANUP" - Recovers logs from an instance's old data disk. + // "AUTO_RESTART" - Performs auto-restart of an HA-enabled Cloud SQL + // database for auto recovery. OperationType string `json:"operationType,omitempty"` // SelfLink: The URI of this resource. @@ -4428,6 +4430,18 @@ func (s *TruncateLogContext) MarshalJSON() ([]byte, error) { // User: A Cloud SQL user resource. type User struct { + // DualPasswordType: Dual password status for the user. + // + // Possible values: + // "DUAL_PASSWORD_TYPE_UNSPECIFIED" - The default value. + // "NO_MODIFY_DUAL_PASSWORD" - Do not update the user's dual password + // status. + // "NO_DUAL_PASSWORD" - No dual password usable for connecting using + // this user. + // "DUAL_PASSWORD" - Dual password usable for connecting using this + // user. + DualPasswordType string `json:"dualPasswordType,omitempty"` + // Etag: This field is deprecated and will be removed from a future // version of the API. Etag string `json:"etag,omitempty"` @@ -4473,7 +4487,11 @@ type User struct { // "CLOUD_IAM_SERVICE_ACCOUNT" - Cloud IAM service account. Type string `json:"type,omitempty"` - // ForceSendFields is a list of field names (e.g. "Etag") to + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "DualPasswordType") 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 @@ -4481,12 +4499,13 @@ type User struct { // This may be used to include empty fields in Patch requests. ForceSendFields []string `json:"-"` - // NullFields is a list of field names (e.g. "Etag") to include in API - // requests with the JSON null value. By default, fields with empty - // values are omitted from API requests. However, any field with an - // empty value appearing in NullFields will be sent to the server as - // null. It is an error if a field in this list has a non-empty value. - // This may be used to include null fields in Patch requests. + // NullFields is a list of field names (e.g. "DualPasswordType") 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:"-"` } @@ -4506,6 +4525,11 @@ type UserPasswordValidationPolicy struct { // be enabled. EnableFailedAttemptsCheck bool `json:"enableFailedAttemptsCheck,omitempty"` + // EnablePasswordVerification: If true, the user must specify the + // current password before changing the password. This flag is supported + // only for MySQL. + EnablePasswordVerification bool `json:"enablePasswordVerification,omitempty"` + // PasswordExpirationDuration: Expiration duration after password is // updated. PasswordExpirationDuration string `json:"passwordExpirationDuration,omitempty"` @@ -11904,6 +11928,176 @@ func (c *UsersDeleteCall) Do(opts ...googleapi.CallOption) (*Operation, error) { } +// method id "sql.users.get": + +type UsersGetCall struct { + s *Service + project string + instance string + name string + urlParams_ gensupport.URLParams + ifNoneMatch_ string + ctx_ context.Context + header_ http.Header +} + +// Get: Retrieves a resource containing information about a user. +// +// - instance: Database instance ID. This does not include the project +// ID. +// - name: User of the instance. If the database user has a host, this +// is specified as {username}@{host} else as {username}. +// - project: Project ID of the project that contains the instance. +func (r *UsersService) Get(project string, instance string, name string) *UsersGetCall { + c := &UsersGetCall{s: r.s, urlParams_: make(gensupport.URLParams)} + c.project = project + c.instance = instance + 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 *UsersGetCall) Fields(s ...googleapi.Field) *UsersGetCall { + 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 *UsersGetCall) IfNoneMatch(entityTag string) *UsersGetCall { + 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 *UsersGetCall) Context(ctx context.Context) *UsersGetCall { + 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 *UsersGetCall) Header() http.Header { + if c.header_ == nil { + c.header_ = make(http.Header) + } + return c.header_ +} + +func (c *UsersGetCall) 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, "sql/v1beta4/projects/{project}/instances/{instance}/users/{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{ + "project": c.project, + "instance": c.instance, + "name": c.name, + }) + return gensupport.SendRequest(c.ctx_, c.s.client, req) +} + +// Do executes the "sql.users.get" call. +// Exactly one of *User or error will be non-nil. Any non-2xx status +// code is an error. Response headers are in either +// *User.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 *UsersGetCall) Do(opts ...googleapi.CallOption) (*User, 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 := &User{ + 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": "Retrieves a resource containing information about a user.", + // "flatPath": "sql/v1beta4/projects/{project}/instances/{instance}/users/{name}", + // "httpMethod": "GET", + // "id": "sql.users.get", + // "parameterOrder": [ + // "project", + // "instance", + // "name" + // ], + // "parameters": { + // "instance": { + // "description": "Database instance ID. This does not include the project ID.", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "name": { + // "description": "User of the instance. If the database user has a host, this is specified as {username}@{host} else as {username}.", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "project": { + // "description": "Project ID of the project that contains the instance.", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "sql/v1beta4/projects/{project}/instances/{instance}/users/{name}", + // "response": { + // "$ref": "User" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/cloud-platform", + // "https://www.googleapis.com/auth/sqlservice.admin" + // ] + // } + +} + // method id "sql.users.insert": type UsersInsertCall struct { diff --git a/verifiedaccess/v1/verifiedaccess-api.json b/verifiedaccess/v1/verifiedaccess-api.json index b7d39a79cb6..68d8692d5b9 100644 --- a/verifiedaccess/v1/verifiedaccess-api.json +++ b/verifiedaccess/v1/verifiedaccess-api.json @@ -146,7 +146,7 @@ } } }, - "revision": "20200828", + "revision": "20220519", "rootUrl": "https://verifiedaccess.googleapis.com/", "schemas": { "Challenge": { @@ -165,7 +165,7 @@ "type": "object" }, "Empty": { - "description": "A generic empty message that you can re-use to avoid defining duplicated empty messages in your APIs. A typical example is to use it as the request or the response type of an API method. For instance: service Foo { rpc Bar(google.protobuf.Empty) returns (google.protobuf.Empty); } The JSON representation for `Empty` is empty JSON object `{}`.", + "description": "A generic empty message that you can re-use to avoid defining duplicated empty messages in your APIs. A typical example is to use it as the request or the response type of an API method. For instance: service Foo { rpc Bar(google.protobuf.Empty) returns (google.protobuf.Empty); }", "id": "Empty", "properties": {}, "type": "object" diff --git a/verifiedaccess/v1/verifiedaccess-gen.go b/verifiedaccess/v1/verifiedaccess-gen.go index 2cc0ef8a1be..5d4d3ee7633 100644 --- a/verifiedaccess/v1/verifiedaccess-gen.go +++ b/verifiedaccess/v1/verifiedaccess-gen.go @@ -187,8 +187,7 @@ func (s *Challenge) MarshalJSON() ([]byte, error) { // duplicated empty messages in your APIs. A typical example is to use // it as the request or the response type of an API method. For // instance: service Foo { rpc Bar(google.protobuf.Empty) returns -// (google.protobuf.Empty); } The JSON representation for `Empty` is -// empty JSON object `{}`. +// (google.protobuf.Empty); } type Empty struct { } diff --git a/verifiedaccess/v2/verifiedaccess-api.json b/verifiedaccess/v2/verifiedaccess-api.json index 5b2af611f8c..b04eb8916f7 100644 --- a/verifiedaccess/v2/verifiedaccess-api.json +++ b/verifiedaccess/v2/verifiedaccess-api.json @@ -146,7 +146,7 @@ } } }, - "revision": "20220215", + "revision": "20220519", "rootUrl": "https://verifiedaccess.googleapis.com/", "schemas": { "Challenge": { @@ -167,7 +167,7 @@ "type": "object" }, "Empty": { - "description": "A generic empty message that you can re-use to avoid defining duplicated empty messages in your APIs. A typical example is to use it as the request or the response type of an API method. For instance: service Foo { rpc Bar(google.protobuf.Empty) returns (google.protobuf.Empty); } The JSON representation for `Empty` is empty JSON object `{}`.", + "description": "A generic empty message that you can re-use to avoid defining duplicated empty messages in your APIs. A typical example is to use it as the request or the response type of an API method. For instance: service Foo { rpc Bar(google.protobuf.Empty) returns (google.protobuf.Empty); }", "id": "Empty", "properties": {}, "type": "object" diff --git a/verifiedaccess/v2/verifiedaccess-gen.go b/verifiedaccess/v2/verifiedaccess-gen.go index 60e214e93a5..0ddda825aa5 100644 --- a/verifiedaccess/v2/verifiedaccess-gen.go +++ b/verifiedaccess/v2/verifiedaccess-gen.go @@ -189,8 +189,7 @@ func (s *Challenge) MarshalJSON() ([]byte, error) { // duplicated empty messages in your APIs. A typical example is to use // it as the request or the response type of an API method. For // instance: service Foo { rpc Bar(google.protobuf.Empty) returns -// (google.protobuf.Empty); } The JSON representation for `Empty` is -// empty JSON object `{}`. +// (google.protobuf.Empty); } type Empty struct { } diff --git a/webrisk/v1/webrisk-api.json b/webrisk/v1/webrisk-api.json index 73aa9755e92..57b46558648 100644 --- a/webrisk/v1/webrisk-api.json +++ b/webrisk/v1/webrisk-api.json @@ -126,13 +126,15 @@ "THREAT_TYPE_UNSPECIFIED", "MALWARE", "SOCIAL_ENGINEERING", - "UNWANTED_SOFTWARE" + "UNWANTED_SOFTWARE", + "HIGH_RECALL" ], "enumDescriptions": [ "No entries should match this threat type. This threat type is unused.", "Malware targeting any platform.", "Social engineering targeting any platform.", - "Unwanted software targeting any platform." + "Unwanted software targeting any platform.", + "High Recall Social Engineering list targeting any platform." ], "location": "query", "repeated": true, @@ -374,13 +376,15 @@ "THREAT_TYPE_UNSPECIFIED", "MALWARE", "SOCIAL_ENGINEERING", - "UNWANTED_SOFTWARE" + "UNWANTED_SOFTWARE", + "HIGH_RECALL" ], "enumDescriptions": [ "No entries should match this threat type. This threat type is unused.", "Malware targeting any platform.", "Social engineering targeting any platform.", - "Unwanted software targeting any platform." + "Unwanted software targeting any platform.", + "High Recall Social Engineering list targeting any platform." ], "location": "query", "type": "string" @@ -417,13 +421,15 @@ "THREAT_TYPE_UNSPECIFIED", "MALWARE", "SOCIAL_ENGINEERING", - "UNWANTED_SOFTWARE" + "UNWANTED_SOFTWARE", + "HIGH_RECALL" ], "enumDescriptions": [ "No entries should match this threat type. This threat type is unused.", "Malware targeting any platform.", "Social engineering targeting any platform.", - "Unwanted software targeting any platform." + "Unwanted software targeting any platform.", + "High Recall Social Engineering list targeting any platform." ], "location": "query", "repeated": true, @@ -446,7 +452,7 @@ } } }, - "revision": "20220319", + "revision": "20220625", "rootUrl": "https://webrisk.googleapis.com/", "schemas": { "GoogleCloudWebriskV1ComputeThreatListDiffResponse": { @@ -601,13 +607,15 @@ "THREAT_TYPE_UNSPECIFIED", "MALWARE", "SOCIAL_ENGINEERING", - "UNWANTED_SOFTWARE" + "UNWANTED_SOFTWARE", + "HIGH_RECALL" ], "enumDescriptions": [ "No entries should match this threat type. This threat type is unused.", "Malware targeting any platform.", "Social engineering targeting any platform.", - "Unwanted software targeting any platform." + "Unwanted software targeting any platform.", + "High Recall Social Engineering list targeting any platform." ], "type": "string" }, @@ -642,13 +650,15 @@ "THREAT_TYPE_UNSPECIFIED", "MALWARE", "SOCIAL_ENGINEERING", - "UNWANTED_SOFTWARE" + "UNWANTED_SOFTWARE", + "HIGH_RECALL" ], "enumDescriptions": [ "No entries should match this threat type. This threat type is unused.", "Malware targeting any platform.", "Social engineering targeting any platform.", - "Unwanted software targeting any platform." + "Unwanted software targeting any platform.", + "High Recall Social Engineering list targeting any platform." ], "type": "string" }, @@ -668,13 +678,15 @@ "THREAT_TYPE_UNSPECIFIED", "MALWARE", "SOCIAL_ENGINEERING", - "UNWANTED_SOFTWARE" + "UNWANTED_SOFTWARE", + "HIGH_RECALL" ], "enumDescriptions": [ "No entries should match this threat type. This threat type is unused.", "Malware targeting any platform.", "Social engineering targeting any platform.", - "Unwanted software targeting any platform." + "Unwanted software targeting any platform.", + "High Recall Social Engineering list targeting any platform." ], "type": "string" }, diff --git a/webrisk/v1/webrisk-gen.go b/webrisk/v1/webrisk-gen.go index 3e4950b1c4c..e05b0ef76c5 100644 --- a/webrisk/v1/webrisk-gen.go +++ b/webrisk/v1/webrisk-gen.go @@ -489,6 +489,8 @@ type GoogleCloudWebriskV1SearchHashesResponseThreatHash struct { // "MALWARE" - Malware targeting any platform. // "SOCIAL_ENGINEERING" - Social engineering targeting any platform. // "UNWANTED_SOFTWARE" - Unwanted software targeting any platform. + // "HIGH_RECALL" - High Recall Social Engineering list targeting any + // platform. ThreatTypes []string `json:"threatTypes,omitempty"` // ForceSendFields is a list of field names (e.g. "ExpireTime") to @@ -561,6 +563,8 @@ type GoogleCloudWebriskV1SearchUrisResponseThreatUri struct { // "MALWARE" - Malware targeting any platform. // "SOCIAL_ENGINEERING" - Social engineering targeting any platform. // "UNWANTED_SOFTWARE" - Unwanted software targeting any platform. + // "HIGH_RECALL" - High Recall Social Engineering list targeting any + // platform. ThreatTypes []string `json:"threatTypes,omitempty"` // ForceSendFields is a list of field names (e.g. "ExpireTime") to @@ -599,6 +603,8 @@ type GoogleCloudWebriskV1Submission struct { // "MALWARE" - Malware targeting any platform. // "SOCIAL_ENGINEERING" - Social engineering targeting any platform. // "UNWANTED_SOFTWARE" - Unwanted software targeting any platform. + // "HIGH_RECALL" - High Recall Social Engineering list targeting any + // platform. ThreatTypes []string `json:"threatTypes,omitempty"` // Uri: Required. The URI that is being reported for malicious content @@ -974,6 +980,8 @@ func (c *HashesSearchCall) HashPrefix(hashPrefix string) *HashesSearchCall { // "MALWARE" - Malware targeting any platform. // "SOCIAL_ENGINEERING" - Social engineering targeting any platform. // "UNWANTED_SOFTWARE" - Unwanted software targeting any platform. +// "HIGH_RECALL" - High Recall Social Engineering list targeting any +// platform. func (c *HashesSearchCall) ThreatTypes(threatTypes ...string) *HashesSearchCall { c.urlParams_.SetMulti("threatTypes", append([]string{}, threatTypes...)) return c @@ -1095,13 +1103,15 @@ func (c *HashesSearchCall) Do(opts ...googleapi.CallOption) (*GoogleCloudWebrisk // "THREAT_TYPE_UNSPECIFIED", // "MALWARE", // "SOCIAL_ENGINEERING", - // "UNWANTED_SOFTWARE" + // "UNWANTED_SOFTWARE", + // "HIGH_RECALL" // ], // "enumDescriptions": [ // "No entries should match this threat type. This threat type is unused.", // "Malware targeting any platform.", // "Social engineering targeting any platform.", - // "Unwanted software targeting any platform." + // "Unwanted software targeting any platform.", + // "High Recall Social Engineering list targeting any platform." // ], // "location": "query", // "repeated": true, @@ -2127,6 +2137,8 @@ func (c *ThreatListsComputeDiffCall) ConstraintsSupportedCompressions(constraint // "MALWARE" - Malware targeting any platform. // "SOCIAL_ENGINEERING" - Social engineering targeting any platform. // "UNWANTED_SOFTWARE" - Unwanted software targeting any platform. +// "HIGH_RECALL" - High Recall Social Engineering list targeting any +// platform. func (c *ThreatListsComputeDiffCall) ThreatType(threatType string) *ThreatListsComputeDiffCall { c.urlParams_.Set("threatType", threatType) return c @@ -2281,13 +2293,15 @@ func (c *ThreatListsComputeDiffCall) Do(opts ...googleapi.CallOption) (*GoogleCl // "THREAT_TYPE_UNSPECIFIED", // "MALWARE", // "SOCIAL_ENGINEERING", - // "UNWANTED_SOFTWARE" + // "UNWANTED_SOFTWARE", + // "HIGH_RECALL" // ], // "enumDescriptions": [ // "No entries should match this threat type. This threat type is unused.", // "Malware targeting any platform.", // "Social engineering targeting any platform.", - // "Unwanted software targeting any platform." + // "Unwanted software targeting any platform.", + // "High Recall Social Engineering list targeting any platform." // ], // "location": "query", // "type": "string" @@ -2339,6 +2353,8 @@ func (r *UrisService) Search() *UrisSearchCall { // "MALWARE" - Malware targeting any platform. // "SOCIAL_ENGINEERING" - Social engineering targeting any platform. // "UNWANTED_SOFTWARE" - Unwanted software targeting any platform. +// "HIGH_RECALL" - High Recall Social Engineering list targeting any +// platform. func (c *UrisSearchCall) ThreatTypes(threatTypes ...string) *UrisSearchCall { c.urlParams_.SetMulti("threatTypes", append([]string{}, threatTypes...)) return c @@ -2460,13 +2476,15 @@ func (c *UrisSearchCall) Do(opts ...googleapi.CallOption) (*GoogleCloudWebriskV1 // "THREAT_TYPE_UNSPECIFIED", // "MALWARE", // "SOCIAL_ENGINEERING", - // "UNWANTED_SOFTWARE" + // "UNWANTED_SOFTWARE", + // "HIGH_RECALL" // ], // "enumDescriptions": [ // "No entries should match this threat type. This threat type is unused.", // "Malware targeting any platform.", // "Social engineering targeting any platform.", - // "Unwanted software targeting any platform." + // "Unwanted software targeting any platform.", + // "High Recall Social Engineering list targeting any platform." // ], // "location": "query", // "repeated": true, diff --git a/youtube/v3/youtube-api.json b/youtube/v3/youtube-api.json index 8be34bb5829..61e4ef47d5e 100644 --- a/youtube/v3/youtube-api.json +++ b/youtube/v3/youtube-api.json @@ -1379,6 +1379,79 @@ "https://www.googleapis.com/auth/youtube.force-ssl" ] }, + "insertCuepoint": { + "description": "Insert cuepoints in a broadcast", + "flatPath": "youtube/v3/liveBroadcasts/cuepoint", + "httpMethod": "POST", + "id": "youtube.liveBroadcasts.insertCuepoint", + "parameterOrder": [], + "parameters": { + "id": { + "description": "Broadcast to insert ads to, or equivalently `external_video_id` for internal use.", + "location": "query", + "type": "string" + }, + "onBehalfOfContentOwner": { + "description": "*Note:* This parameter is intended exclusively for YouTube content partners. The *onBehalfOfContentOwner* parameter indicates that the request's authorization credentials identify a YouTube CMS user who is acting on behalf of the content owner specified in the parameter value. This parameter is intended for YouTube content partners that own and manage many different YouTube channels. It allows content owners to authenticate once and get access to all their video and channel data, without having to provide authentication credentials for each individual channel. The CMS account that the user authenticates with must be linked to the specified YouTube content owner.", + "location": "query", + "type": "string" + }, + "onBehalfOfContentOwnerChannel": { + "description": "This parameter can only be used in a properly authorized request. *Note:* This parameter is intended exclusively for YouTube content partners. The *onBehalfOfContentOwnerChannel* parameter specifies the YouTube channel ID of the channel to which a video is being added. This parameter is required when a request specifies a value for the onBehalfOfContentOwner parameter, and it can only be used in conjunction with that parameter. In addition, the request must be authorized using a CMS account that is linked to the content owner that the onBehalfOfContentOwner parameter specifies. Finally, the channel that the onBehalfOfContentOwnerChannel parameter value specifies must be linked to the content owner that the onBehalfOfContentOwner parameter specifies. This parameter is intended for YouTube content partners that own and manage many different YouTube channels. It allows content owners to authenticate once and perform actions on behalf of the channel specified in the parameter value, without having to provide authentication credentials for each separate channel.", + "location": "query", + "type": "string" + }, + "part": { + "description": "The *part* parameter specifies a comma-separated list of one or more liveBroadcast resource properties that the API response will include. The part names that you can include in the parameter value are id, snippet, contentDetails, and status.", + "location": "query", + "repeated": true, + "type": "string" + }, + "resource.cueType": { + "enum": [ + "cueTypeUnspecified", + "cueTypeAd" + ], + "enumDescriptions": [ + "", + "" + ], + "location": "query", + "type": "string" + }, + "resource.durationSecs": { + "description": "The duration of this cuepoint.", + "format": "uint32", + "location": "query", + "type": "integer" + }, + "resource.etag": { + "location": "query", + "type": "string" + }, + "resource.id": { + "description": "The identifier for cuepoint resource.", + "location": "query", + "type": "string" + }, + "resource.insertionOffsetTimeMs": { + "description": "The time when the cuepoint should be inserted by offset to the broadcast actual start time.", + "format": "int64", + "location": "query", + "type": "string" + }, + "resource.walltimeMs": { + "description": "The wall clock time at which the cuepoint should be inserted. Only one of insertion_offset_time_ms and walltime_ms may be set at a time.", + "format": "uint64", + "location": "query", + "type": "string" + } + }, + "path": "youtube/v3/liveBroadcasts/cuepoint", + "response": { + "$ref": "Cuepoint" + } + }, "list": { "description": "Retrieve the list of broadcasts associated with the given channel.", "flatPath": "youtube/v3/liveBroadcasts", @@ -3784,91 +3857,12 @@ "$ref": "CommentThread" } } - }, - "resources": { - "liveBroadcasts": { - "resources": { - "cuepoint": { - "methods": { - "create": { - "description": "Insert cuepoints in a broadcast", - "flatPath": "youtube/v3/liveBroadcasts/cuepoint", - "httpMethod": "POST", - "id": "youtube.youtube.v3.liveBroadcasts.cuepoint.create", - "parameterOrder": [], - "parameters": { - "id": { - "description": "Broadcast to insert ads to, or equivalently `external_video_id` for internal use.", - "location": "query", - "type": "string" - }, - "onBehalfOfContentOwner": { - "description": "*Note:* This parameter is intended exclusively for YouTube content partners. The *onBehalfOfContentOwner* parameter indicates that the request's authorization credentials identify a YouTube CMS user who is acting on behalf of the content owner specified in the parameter value. This parameter is intended for YouTube content partners that own and manage many different YouTube channels. It allows content owners to authenticate once and get access to all their video and channel data, without having to provide authentication credentials for each individual channel. The CMS account that the user authenticates with must be linked to the specified YouTube content owner.", - "location": "query", - "type": "string" - }, - "onBehalfOfContentOwnerChannel": { - "description": "This parameter can only be used in a properly authorized request. *Note:* This parameter is intended exclusively for YouTube content partners. The *onBehalfOfContentOwnerChannel* parameter specifies the YouTube channel ID of the channel to which a video is being added. This parameter is required when a request specifies a value for the onBehalfOfContentOwner parameter, and it can only be used in conjunction with that parameter. In addition, the request must be authorized using a CMS account that is linked to the content owner that the onBehalfOfContentOwner parameter specifies. Finally, the channel that the onBehalfOfContentOwnerChannel parameter value specifies must be linked to the content owner that the onBehalfOfContentOwner parameter specifies. This parameter is intended for YouTube content partners that own and manage many different YouTube channels. It allows content owners to authenticate once and perform actions on behalf of the channel specified in the parameter value, without having to provide authentication credentials for each separate channel.", - "location": "query", - "type": "string" - }, - "part": { - "description": "The *part* parameter specifies a comma-separated list of one or more liveBroadcast resource properties that the API response will include. The part names that you can include in the parameter value are id, snippet, contentDetails, and status.", - "location": "query", - "repeated": true, - "type": "string" - }, - "resource.cueType": { - "enum": [ - "cueTypeUnspecified", - "cueTypeAd" - ], - "enumDescriptions": [ - "", - "" - ], - "location": "query", - "type": "string" - }, - "resource.durationSecs": { - "description": "The duration of this cuepoint.", - "format": "uint32", - "location": "query", - "type": "integer" - }, - "resource.id": { - "description": "The identifier for cuepoint resource.", - "location": "query", - "type": "string" - }, - "resource.insertionOffsetTimeMs": { - "description": "The time when the cuepoint should be inserted by offset to the broadcast actual start time.", - "format": "int64", - "location": "query", - "type": "string" - }, - "resource.walltimeMs": { - "description": "The wall clock time at which the cuepoint should be inserted. Only one of insertion_offset_time_ms and walltime_ms may be set at a time.", - "format": "uint64", - "location": "query", - "type": "string" - } - }, - "path": "youtube/v3/liveBroadcasts/cuepoint", - "response": { - "$ref": "Cuepoint" - } - } - } - } - } - } } } } } }, - "revision": "20220612", + "revision": "20220628", "rootUrl": "https://youtube.googleapis.com/", "schemas": { "AbuseReport": { @@ -7378,6 +7372,9 @@ "format": "uint32", "type": "integer" }, + "etag": { + "type": "string" + }, "id": { "description": "The identifier for cuepoint resource.", "type": "string" diff --git a/youtube/v3/youtube-gen.go b/youtube/v3/youtube-gen.go index 3872da55d40..63190cf4bc7 100644 --- a/youtube/v3/youtube-gen.go +++ b/youtube/v3/youtube-gen.go @@ -529,35 +529,11 @@ type YoutubeService struct { func NewYoutubeV3Service(s *Service) *YoutubeV3Service { rs := &YoutubeV3Service{s: s} - rs.LiveBroadcasts = NewYoutubeV3LiveBroadcastsService(s) return rs } type YoutubeV3Service struct { s *Service - - LiveBroadcasts *YoutubeV3LiveBroadcastsService -} - -func NewYoutubeV3LiveBroadcastsService(s *Service) *YoutubeV3LiveBroadcastsService { - rs := &YoutubeV3LiveBroadcastsService{s: s} - rs.Cuepoint = NewYoutubeV3LiveBroadcastsCuepointService(s) - return rs -} - -type YoutubeV3LiveBroadcastsService struct { - s *Service - - Cuepoint *YoutubeV3LiveBroadcastsCuepointService -} - -func NewYoutubeV3LiveBroadcastsCuepointService(s *Service) *YoutubeV3LiveBroadcastsCuepointService { - rs := &YoutubeV3LiveBroadcastsCuepointService{s: s} - return rs -} - -type YoutubeV3LiveBroadcastsCuepointService struct { - s *Service } type AbuseReport struct { @@ -4124,6 +4100,8 @@ type Cuepoint struct { // DurationSecs: The duration of this cuepoint. DurationSecs int64 `json:"durationSecs,omitempty"` + Etag string `json:"etag,omitempty"` + // Id: The identifier for cuepoint resource. Id string `json:"id,omitempty"` @@ -15608,74 +15586,25 @@ func (c *LiveBroadcastsInsertCall) Do(opts ...googleapi.CallOption) (*LiveBroadc } -// method id "youtube.liveBroadcasts.list": - -type LiveBroadcastsListCall struct { - s *Service - urlParams_ gensupport.URLParams - ifNoneMatch_ string - ctx_ context.Context - header_ http.Header -} - -// List: Retrieve the list of broadcasts associated with the given -// channel. -// -// - part: The *part* parameter specifies a comma-separated list of one -// or more liveBroadcast resource properties that the API response -// will include. The part names that you can include in the parameter -// value are id, snippet, contentDetails, status and statistics. -func (r *LiveBroadcastsService) List(part []string) *LiveBroadcastsListCall { - c := &LiveBroadcastsListCall{s: r.s, urlParams_: make(gensupport.URLParams)} - c.urlParams_.SetMulti("part", append([]string{}, part...)) - return c -} - -// BroadcastStatus sets the optional parameter "broadcastStatus": Return -// broadcasts with a certain status, e.g. active broadcasts. -// -// Possible values: -// "broadcastStatusFilterUnspecified" -// "all" - Return all broadcasts. -// "active" - Return current live broadcasts. -// "upcoming" - Return broadcasts that have not yet started. -// "completed" - Return broadcasts that have already ended. -func (c *LiveBroadcastsListCall) BroadcastStatus(broadcastStatus string) *LiveBroadcastsListCall { - c.urlParams_.Set("broadcastStatus", broadcastStatus) - return c -} - -// BroadcastType sets the optional parameter "broadcastType": Return -// only broadcasts with the selected type. -// -// Possible values: -// "broadcastTypeFilterUnspecified" -// "all" - Return all broadcasts. -// "event" (default) - Return only scheduled event broadcasts. -// "persistent" - Return only persistent broadcasts. -func (c *LiveBroadcastsListCall) BroadcastType(broadcastType string) *LiveBroadcastsListCall { - c.urlParams_.Set("broadcastType", broadcastType) - return c -} +// method id "youtube.liveBroadcasts.insertCuepoint": -// Id sets the optional parameter "id": Return broadcasts with the given -// ids from Stubby or Apiary. -func (c *LiveBroadcastsListCall) Id(id ...string) *LiveBroadcastsListCall { - c.urlParams_.SetMulti("id", append([]string{}, id...)) - return c +type LiveBroadcastsInsertCuepointCall struct { + s *Service + urlParams_ gensupport.URLParams + ctx_ context.Context + header_ http.Header } -// MaxResults sets the optional parameter "maxResults": The *maxResults* -// parameter specifies the maximum number of items that should be -// returned in the result set. -func (c *LiveBroadcastsListCall) MaxResults(maxResults int64) *LiveBroadcastsListCall { - c.urlParams_.Set("maxResults", fmt.Sprint(maxResults)) +// InsertCuepoint: Insert cuepoints in a broadcast +func (r *LiveBroadcastsService) InsertCuepoint() *LiveBroadcastsInsertCuepointCall { + c := &LiveBroadcastsInsertCuepointCall{s: r.s, urlParams_: make(gensupport.URLParams)} return c } -// Mine sets the optional parameter "mine": -func (c *LiveBroadcastsListCall) Mine(mine bool) *LiveBroadcastsListCall { - c.urlParams_.Set("mine", fmt.Sprint(mine)) +// Id sets the optional parameter "id": Broadcast to insert ads to, or +// equivalently `external_video_id` for internal use. +func (c *LiveBroadcastsInsertCuepointCall) Id(id string) *LiveBroadcastsInsertCuepointCall { + c.urlParams_.Set("id", id) return c } @@ -15691,7 +15620,7 @@ func (c *LiveBroadcastsListCall) Mine(mine bool) *LiveBroadcastsListCall { // without having to provide authentication credentials for each // individual channel. The CMS account that the user authenticates with // must be linked to the specified YouTube content owner. -func (c *LiveBroadcastsListCall) OnBehalfOfContentOwner(onBehalfOfContentOwner string) *LiveBroadcastsListCall { +func (c *LiveBroadcastsInsertCuepointCall) OnBehalfOfContentOwner(onBehalfOfContentOwner string) *LiveBroadcastsInsertCuepointCall { c.urlParams_.Set("onBehalfOfContentOwner", onBehalfOfContentOwner) return c } @@ -15715,71 +15644,105 @@ func (c *LiveBroadcastsListCall) OnBehalfOfContentOwner(onBehalfOfContentOwner s // once and perform actions on behalf of the channel specified in the // parameter value, without having to provide authentication credentials // for each separate channel. -func (c *LiveBroadcastsListCall) OnBehalfOfContentOwnerChannel(onBehalfOfContentOwnerChannel string) *LiveBroadcastsListCall { +func (c *LiveBroadcastsInsertCuepointCall) OnBehalfOfContentOwnerChannel(onBehalfOfContentOwnerChannel string) *LiveBroadcastsInsertCuepointCall { c.urlParams_.Set("onBehalfOfContentOwnerChannel", onBehalfOfContentOwnerChannel) return c } -// PageToken sets the optional parameter "pageToken": The *pageToken* -// parameter identifies a specific page in the result set that should be -// returned. In an API response, the nextPageToken and prevPageToken -// properties identify other pages that could be retrieved. -func (c *LiveBroadcastsListCall) PageToken(pageToken string) *LiveBroadcastsListCall { - c.urlParams_.Set("pageToken", pageToken) +// Part sets the optional parameter "part": The *part* parameter +// specifies a comma-separated list of one or more liveBroadcast +// resource properties that the API response will include. The part +// names that you can include in the parameter value are id, snippet, +// contentDetails, and status. +func (c *LiveBroadcastsInsertCuepointCall) Part(part ...string) *LiveBroadcastsInsertCuepointCall { + c.urlParams_.SetMulti("part", append([]string{}, part...)) + return c +} + +// ResourceCueType sets the optional parameter "resource.cueType": +// +// Possible values: +// "cueTypeUnspecified" +// "cueTypeAd" +func (c *LiveBroadcastsInsertCuepointCall) ResourceCueType(resourceCueType string) *LiveBroadcastsInsertCuepointCall { + c.urlParams_.Set("resource.cueType", resourceCueType) + return c +} + +// ResourceDurationSecs sets the optional parameter +// "resource.durationSecs": The duration of this cuepoint. +func (c *LiveBroadcastsInsertCuepointCall) ResourceDurationSecs(resourceDurationSecs int64) *LiveBroadcastsInsertCuepointCall { + c.urlParams_.Set("resource.durationSecs", fmt.Sprint(resourceDurationSecs)) + return c +} + +// ResourceEtag sets the optional parameter "resource.etag": +func (c *LiveBroadcastsInsertCuepointCall) ResourceEtag(resourceEtag string) *LiveBroadcastsInsertCuepointCall { + c.urlParams_.Set("resource.etag", resourceEtag) + return c +} + +// ResourceId sets the optional parameter "resource.id": The identifier +// for cuepoint resource. +func (c *LiveBroadcastsInsertCuepointCall) ResourceId(resourceId string) *LiveBroadcastsInsertCuepointCall { + c.urlParams_.Set("resource.id", resourceId) + return c +} + +// ResourceInsertionOffsetTimeMs sets the optional parameter +// "resource.insertionOffsetTimeMs": The time when the cuepoint should +// be inserted by offset to the broadcast actual start time. +func (c *LiveBroadcastsInsertCuepointCall) ResourceInsertionOffsetTimeMs(resourceInsertionOffsetTimeMs int64) *LiveBroadcastsInsertCuepointCall { + c.urlParams_.Set("resource.insertionOffsetTimeMs", fmt.Sprint(resourceInsertionOffsetTimeMs)) + return c +} + +// ResourceWalltimeMs sets the optional parameter "resource.walltimeMs": +// The wall clock time at which the cuepoint should be inserted. Only +// one of insertion_offset_time_ms and walltime_ms may be set at a time. +func (c *LiveBroadcastsInsertCuepointCall) ResourceWalltimeMs(resourceWalltimeMs uint64) *LiveBroadcastsInsertCuepointCall { + c.urlParams_.Set("resource.walltimeMs", fmt.Sprint(resourceWalltimeMs)) 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 *LiveBroadcastsListCall) Fields(s ...googleapi.Field) *LiveBroadcastsListCall { +func (c *LiveBroadcastsInsertCuepointCall) Fields(s ...googleapi.Field) *LiveBroadcastsInsertCuepointCall { 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 *LiveBroadcastsListCall) IfNoneMatch(entityTag string) *LiveBroadcastsListCall { - 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 *LiveBroadcastsListCall) Context(ctx context.Context) *LiveBroadcastsListCall { +func (c *LiveBroadcastsInsertCuepointCall) Context(ctx context.Context) *LiveBroadcastsInsertCuepointCall { 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 *LiveBroadcastsListCall) Header() http.Header { +func (c *LiveBroadcastsInsertCuepointCall) Header() http.Header { if c.header_ == nil { c.header_ = make(http.Header) } return c.header_ } -func (c *LiveBroadcastsListCall) doRequest(alt string) (*http.Response, error) { +func (c *LiveBroadcastsInsertCuepointCall) 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, "youtube/v3/liveBroadcasts") + urls := googleapi.ResolveRelative(c.s.BasePath, "youtube/v3/liveBroadcasts/cuepoint") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("POST", urls, body) if err != nil { return nil, err } @@ -15787,14 +15750,14 @@ func (c *LiveBroadcastsListCall) doRequest(alt string) (*http.Response, error) { return gensupport.SendRequest(c.ctx_, c.s.client, req) } -// Do executes the "youtube.liveBroadcasts.list" call. -// Exactly one of *LiveBroadcastListResponse or error will be non-nil. -// Any non-2xx status code is an error. Response headers are in either -// *LiveBroadcastListResponse.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 *LiveBroadcastsListCall) Do(opts ...googleapi.CallOption) (*LiveBroadcastListResponse, error) { +// Do executes the "youtube.liveBroadcasts.insertCuepoint" call. +// Exactly one of *Cuepoint or error will be non-nil. Any non-2xx status +// code is an error. Response headers are in either +// *Cuepoint.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 *LiveBroadcastsInsertCuepointCall) Do(opts ...googleapi.CallOption) (*Cuepoint, error) { gensupport.SetOptions(c.urlParams_, opts...) res, err := c.doRequest("json") if res != nil && res.StatusCode == http.StatusNotModified { @@ -15813,7 +15776,7 @@ func (c *LiveBroadcastsListCall) Do(opts ...googleapi.CallOption) (*LiveBroadcas if err := googleapi.CheckResponse(res); err != nil { return nil, err } - ret := &LiveBroadcastListResponse{ + ret := &Cuepoint{ ServerResponse: googleapi.ServerResponse{ Header: res.Header, HTTPStatusCode: res.StatusCode, @@ -15825,77 +15788,369 @@ func (c *LiveBroadcastsListCall) Do(opts ...googleapi.CallOption) (*LiveBroadcas } return ret, nil // { - // "description": "Retrieve the list of broadcasts associated with the given channel.", - // "flatPath": "youtube/v3/liveBroadcasts", - // "httpMethod": "GET", - // "id": "youtube.liveBroadcasts.list", - // "parameterOrder": [ - // "part" - // ], + // "description": "Insert cuepoints in a broadcast", + // "flatPath": "youtube/v3/liveBroadcasts/cuepoint", + // "httpMethod": "POST", + // "id": "youtube.liveBroadcasts.insertCuepoint", + // "parameterOrder": [], // "parameters": { - // "broadcastStatus": { - // "description": "Return broadcasts with a certain status, e.g. active broadcasts.", - // "enum": [ - // "broadcastStatusFilterUnspecified", - // "all", - // "active", - // "upcoming", - // "completed" - // ], - // "enumDescriptions": [ - // "", - // "Return all broadcasts.", - // "Return current live broadcasts.", - // "Return broadcasts that have not yet started.", - // "Return broadcasts that have already ended." - // ], + // "id": { + // "description": "Broadcast to insert ads to, or equivalently `external_video_id` for internal use.", // "location": "query", // "type": "string" // }, - // "broadcastType": { - // "default": "event", - // "description": "Return only broadcasts with the selected type.", + // "onBehalfOfContentOwner": { + // "description": "*Note:* This parameter is intended exclusively for YouTube content partners. The *onBehalfOfContentOwner* parameter indicates that the request's authorization credentials identify a YouTube CMS user who is acting on behalf of the content owner specified in the parameter value. This parameter is intended for YouTube content partners that own and manage many different YouTube channels. It allows content owners to authenticate once and get access to all their video and channel data, without having to provide authentication credentials for each individual channel. The CMS account that the user authenticates with must be linked to the specified YouTube content owner.", + // "location": "query", + // "type": "string" + // }, + // "onBehalfOfContentOwnerChannel": { + // "description": "This parameter can only be used in a properly authorized request. *Note:* This parameter is intended exclusively for YouTube content partners. The *onBehalfOfContentOwnerChannel* parameter specifies the YouTube channel ID of the channel to which a video is being added. This parameter is required when a request specifies a value for the onBehalfOfContentOwner parameter, and it can only be used in conjunction with that parameter. In addition, the request must be authorized using a CMS account that is linked to the content owner that the onBehalfOfContentOwner parameter specifies. Finally, the channel that the onBehalfOfContentOwnerChannel parameter value specifies must be linked to the content owner that the onBehalfOfContentOwner parameter specifies. This parameter is intended for YouTube content partners that own and manage many different YouTube channels. It allows content owners to authenticate once and perform actions on behalf of the channel specified in the parameter value, without having to provide authentication credentials for each separate channel.", + // "location": "query", + // "type": "string" + // }, + // "part": { + // "description": "The *part* parameter specifies a comma-separated list of one or more liveBroadcast resource properties that the API response will include. The part names that you can include in the parameter value are id, snippet, contentDetails, and status.", + // "location": "query", + // "repeated": true, + // "type": "string" + // }, + // "resource.cueType": { // "enum": [ - // "broadcastTypeFilterUnspecified", - // "all", - // "event", - // "persistent" + // "cueTypeUnspecified", + // "cueTypeAd" // ], // "enumDescriptions": [ // "", - // "Return all broadcasts.", - // "Return only scheduled event broadcasts.", - // "Return only persistent broadcasts." + // "" // ], // "location": "query", // "type": "string" // }, - // "id": { - // "description": "Return broadcasts with the given ids from Stubby or Apiary.", - // "location": "query", - // "repeated": true, - // "type": "string" - // }, - // "maxResults": { - // "default": "5", - // "description": "The *maxResults* parameter specifies the maximum number of items that should be returned in the result set.", + // "resource.durationSecs": { + // "description": "The duration of this cuepoint.", // "format": "uint32", // "location": "query", - // "maximum": "50", - // "minimum": "0", // "type": "integer" // }, - // "mine": { - // "location": "query", - // "type": "boolean" - // }, - // "onBehalfOfContentOwner": { - // "description": "*Note:* This parameter is intended exclusively for YouTube content partners. The *onBehalfOfContentOwner* parameter indicates that the request's authorization credentials identify a YouTube CMS user who is acting on behalf of the content owner specified in the parameter value. This parameter is intended for YouTube content partners that own and manage many different YouTube channels. It allows content owners to authenticate once and get access to all their video and channel data, without having to provide authentication credentials for each individual channel. The CMS account that the user authenticates with must be linked to the specified YouTube content owner.", + // "resource.etag": { // "location": "query", // "type": "string" // }, - // "onBehalfOfContentOwnerChannel": { - // "description": "This parameter can only be used in a properly authorized request. *Note:* This parameter is intended exclusively for YouTube content partners. The *onBehalfOfContentOwnerChannel* parameter specifies the YouTube channel ID of the channel to which a video is being added. This parameter is required when a request specifies a value for the onBehalfOfContentOwner parameter, and it can only be used in conjunction with that parameter. In addition, the request must be authorized using a CMS account that is linked to the content owner that the onBehalfOfContentOwner parameter specifies. Finally, the channel that the onBehalfOfContentOwnerChannel parameter value specifies must be linked to the content owner that the onBehalfOfContentOwner parameter specifies. This parameter is intended for YouTube content partners that own and manage many different YouTube channels. It allows content owners to authenticate once and perform actions on behalf of the channel specified in the parameter value, without having to provide authentication credentials for each separate channel.", + // "resource.id": { + // "description": "The identifier for cuepoint resource.", + // "location": "query", + // "type": "string" + // }, + // "resource.insertionOffsetTimeMs": { + // "description": "The time when the cuepoint should be inserted by offset to the broadcast actual start time.", + // "format": "int64", + // "location": "query", + // "type": "string" + // }, + // "resource.walltimeMs": { + // "description": "The wall clock time at which the cuepoint should be inserted. Only one of insertion_offset_time_ms and walltime_ms may be set at a time.", + // "format": "uint64", + // "location": "query", + // "type": "string" + // } + // }, + // "path": "youtube/v3/liveBroadcasts/cuepoint", + // "response": { + // "$ref": "Cuepoint" + // } + // } + +} + +// method id "youtube.liveBroadcasts.list": + +type LiveBroadcastsListCall struct { + s *Service + urlParams_ gensupport.URLParams + ifNoneMatch_ string + ctx_ context.Context + header_ http.Header +} + +// List: Retrieve the list of broadcasts associated with the given +// channel. +// +// - part: The *part* parameter specifies a comma-separated list of one +// or more liveBroadcast resource properties that the API response +// will include. The part names that you can include in the parameter +// value are id, snippet, contentDetails, status and statistics. +func (r *LiveBroadcastsService) List(part []string) *LiveBroadcastsListCall { + c := &LiveBroadcastsListCall{s: r.s, urlParams_: make(gensupport.URLParams)} + c.urlParams_.SetMulti("part", append([]string{}, part...)) + return c +} + +// BroadcastStatus sets the optional parameter "broadcastStatus": Return +// broadcasts with a certain status, e.g. active broadcasts. +// +// Possible values: +// "broadcastStatusFilterUnspecified" +// "all" - Return all broadcasts. +// "active" - Return current live broadcasts. +// "upcoming" - Return broadcasts that have not yet started. +// "completed" - Return broadcasts that have already ended. +func (c *LiveBroadcastsListCall) BroadcastStatus(broadcastStatus string) *LiveBroadcastsListCall { + c.urlParams_.Set("broadcastStatus", broadcastStatus) + return c +} + +// BroadcastType sets the optional parameter "broadcastType": Return +// only broadcasts with the selected type. +// +// Possible values: +// "broadcastTypeFilterUnspecified" +// "all" - Return all broadcasts. +// "event" (default) - Return only scheduled event broadcasts. +// "persistent" - Return only persistent broadcasts. +func (c *LiveBroadcastsListCall) BroadcastType(broadcastType string) *LiveBroadcastsListCall { + c.urlParams_.Set("broadcastType", broadcastType) + return c +} + +// Id sets the optional parameter "id": Return broadcasts with the given +// ids from Stubby or Apiary. +func (c *LiveBroadcastsListCall) Id(id ...string) *LiveBroadcastsListCall { + c.urlParams_.SetMulti("id", append([]string{}, id...)) + return c +} + +// MaxResults sets the optional parameter "maxResults": The *maxResults* +// parameter specifies the maximum number of items that should be +// returned in the result set. +func (c *LiveBroadcastsListCall) MaxResults(maxResults int64) *LiveBroadcastsListCall { + c.urlParams_.Set("maxResults", fmt.Sprint(maxResults)) + return c +} + +// Mine sets the optional parameter "mine": +func (c *LiveBroadcastsListCall) Mine(mine bool) *LiveBroadcastsListCall { + c.urlParams_.Set("mine", fmt.Sprint(mine)) + return c +} + +// OnBehalfOfContentOwner sets the optional parameter +// "onBehalfOfContentOwner": *Note:* This parameter is intended +// exclusively for YouTube content partners. The +// *onBehalfOfContentOwner* parameter indicates that the request's +// authorization credentials identify a YouTube CMS user who is acting +// on behalf of the content owner specified in the parameter value. This +// parameter is intended for YouTube content partners that own and +// manage many different YouTube channels. It allows content owners to +// authenticate once and get access to all their video and channel data, +// without having to provide authentication credentials for each +// individual channel. The CMS account that the user authenticates with +// must be linked to the specified YouTube content owner. +func (c *LiveBroadcastsListCall) OnBehalfOfContentOwner(onBehalfOfContentOwner string) *LiveBroadcastsListCall { + c.urlParams_.Set("onBehalfOfContentOwner", onBehalfOfContentOwner) + return c +} + +// OnBehalfOfContentOwnerChannel sets the optional parameter +// "onBehalfOfContentOwnerChannel": This parameter can only be used in a +// properly authorized request. *Note:* This parameter is intended +// exclusively for YouTube content partners. The +// *onBehalfOfContentOwnerChannel* parameter specifies the YouTube +// channel ID of the channel to which a video is being added. This +// parameter is required when a request specifies a value for the +// onBehalfOfContentOwner parameter, and it can only be used in +// conjunction with that parameter. In addition, the request must be +// authorized using a CMS account that is linked to the content owner +// that the onBehalfOfContentOwner parameter specifies. Finally, the +// channel that the onBehalfOfContentOwnerChannel parameter value +// specifies must be linked to the content owner that the +// onBehalfOfContentOwner parameter specifies. This parameter is +// intended for YouTube content partners that own and manage many +// different YouTube channels. It allows content owners to authenticate +// once and perform actions on behalf of the channel specified in the +// parameter value, without having to provide authentication credentials +// for each separate channel. +func (c *LiveBroadcastsListCall) OnBehalfOfContentOwnerChannel(onBehalfOfContentOwnerChannel string) *LiveBroadcastsListCall { + c.urlParams_.Set("onBehalfOfContentOwnerChannel", onBehalfOfContentOwnerChannel) + return c +} + +// PageToken sets the optional parameter "pageToken": The *pageToken* +// parameter identifies a specific page in the result set that should be +// returned. In an API response, the nextPageToken and prevPageToken +// properties identify other pages that could be retrieved. +func (c *LiveBroadcastsListCall) PageToken(pageToken string) *LiveBroadcastsListCall { + 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 *LiveBroadcastsListCall) Fields(s ...googleapi.Field) *LiveBroadcastsListCall { + 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 *LiveBroadcastsListCall) IfNoneMatch(entityTag string) *LiveBroadcastsListCall { + 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 *LiveBroadcastsListCall) Context(ctx context.Context) *LiveBroadcastsListCall { + 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 *LiveBroadcastsListCall) Header() http.Header { + if c.header_ == nil { + c.header_ = make(http.Header) + } + return c.header_ +} + +func (c *LiveBroadcastsListCall) 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, "youtube/v3/liveBroadcasts") + urls += "?" + c.urlParams_.Encode() + req, err := http.NewRequest("GET", urls, body) + if err != nil { + return nil, err + } + req.Header = reqHeaders + return gensupport.SendRequest(c.ctx_, c.s.client, req) +} + +// Do executes the "youtube.liveBroadcasts.list" call. +// Exactly one of *LiveBroadcastListResponse or error will be non-nil. +// Any non-2xx status code is an error. Response headers are in either +// *LiveBroadcastListResponse.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 *LiveBroadcastsListCall) Do(opts ...googleapi.CallOption) (*LiveBroadcastListResponse, 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 := &LiveBroadcastListResponse{ + 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": "Retrieve the list of broadcasts associated with the given channel.", + // "flatPath": "youtube/v3/liveBroadcasts", + // "httpMethod": "GET", + // "id": "youtube.liveBroadcasts.list", + // "parameterOrder": [ + // "part" + // ], + // "parameters": { + // "broadcastStatus": { + // "description": "Return broadcasts with a certain status, e.g. active broadcasts.", + // "enum": [ + // "broadcastStatusFilterUnspecified", + // "all", + // "active", + // "upcoming", + // "completed" + // ], + // "enumDescriptions": [ + // "", + // "Return all broadcasts.", + // "Return current live broadcasts.", + // "Return broadcasts that have not yet started.", + // "Return broadcasts that have already ended." + // ], + // "location": "query", + // "type": "string" + // }, + // "broadcastType": { + // "default": "event", + // "description": "Return only broadcasts with the selected type.", + // "enum": [ + // "broadcastTypeFilterUnspecified", + // "all", + // "event", + // "persistent" + // ], + // "enumDescriptions": [ + // "", + // "Return all broadcasts.", + // "Return only scheduled event broadcasts.", + // "Return only persistent broadcasts." + // ], + // "location": "query", + // "type": "string" + // }, + // "id": { + // "description": "Return broadcasts with the given ids from Stubby or Apiary.", + // "location": "query", + // "repeated": true, + // "type": "string" + // }, + // "maxResults": { + // "default": "5", + // "description": "The *maxResults* parameter specifies the maximum number of items that should be returned in the result set.", + // "format": "uint32", + // "location": "query", + // "maximum": "50", + // "minimum": "0", + // "type": "integer" + // }, + // "mine": { + // "location": "query", + // "type": "boolean" + // }, + // "onBehalfOfContentOwner": { + // "description": "*Note:* This parameter is intended exclusively for YouTube content partners. The *onBehalfOfContentOwner* parameter indicates that the request's authorization credentials identify a YouTube CMS user who is acting on behalf of the content owner specified in the parameter value. This parameter is intended for YouTube content partners that own and manage many different YouTube channels. It allows content owners to authenticate once and get access to all their video and channel data, without having to provide authentication credentials for each individual channel. The CMS account that the user authenticates with must be linked to the specified YouTube content owner.", + // "location": "query", + // "type": "string" + // }, + // "onBehalfOfContentOwnerChannel": { + // "description": "This parameter can only be used in a properly authorized request. *Note:* This parameter is intended exclusively for YouTube content partners. The *onBehalfOfContentOwnerChannel* parameter specifies the YouTube channel ID of the channel to which a video is being added. This parameter is required when a request specifies a value for the onBehalfOfContentOwner parameter, and it can only be used in conjunction with that parameter. In addition, the request must be authorized using a CMS account that is linked to the content owner that the onBehalfOfContentOwner parameter specifies. Finally, the channel that the onBehalfOfContentOwnerChannel parameter value specifies must be linked to the content owner that the onBehalfOfContentOwner parameter specifies. This parameter is intended for YouTube content partners that own and manage many different YouTube channels. It allows content owners to authenticate once and perform actions on behalf of the channel specified in the parameter value, without having to provide authentication credentials for each separate channel.", // "location": "query", // "type": "string" // }, @@ -25092,270 +25347,3 @@ func (c *YoutubeV3UpdateCommentThreadsCall) Do(opts ...googleapi.CallOption) (*C // } } - -// method id "youtube.youtube.v3.liveBroadcasts.cuepoint.create": - -type YoutubeV3LiveBroadcastsCuepointCreateCall struct { - s *Service - urlParams_ gensupport.URLParams - ctx_ context.Context - header_ http.Header -} - -// Create: Insert cuepoints in a broadcast -func (r *YoutubeV3LiveBroadcastsCuepointService) Create() *YoutubeV3LiveBroadcastsCuepointCreateCall { - c := &YoutubeV3LiveBroadcastsCuepointCreateCall{s: r.s, urlParams_: make(gensupport.URLParams)} - return c -} - -// Id sets the optional parameter "id": Broadcast to insert ads to, or -// equivalently `external_video_id` for internal use. -func (c *YoutubeV3LiveBroadcastsCuepointCreateCall) Id(id string) *YoutubeV3LiveBroadcastsCuepointCreateCall { - c.urlParams_.Set("id", id) - return c -} - -// OnBehalfOfContentOwner sets the optional parameter -// "onBehalfOfContentOwner": *Note:* This parameter is intended -// exclusively for YouTube content partners. The -// *onBehalfOfContentOwner* parameter indicates that the request's -// authorization credentials identify a YouTube CMS user who is acting -// on behalf of the content owner specified in the parameter value. This -// parameter is intended for YouTube content partners that own and -// manage many different YouTube channels. It allows content owners to -// authenticate once and get access to all their video and channel data, -// without having to provide authentication credentials for each -// individual channel. The CMS account that the user authenticates with -// must be linked to the specified YouTube content owner. -func (c *YoutubeV3LiveBroadcastsCuepointCreateCall) OnBehalfOfContentOwner(onBehalfOfContentOwner string) *YoutubeV3LiveBroadcastsCuepointCreateCall { - c.urlParams_.Set("onBehalfOfContentOwner", onBehalfOfContentOwner) - return c -} - -// OnBehalfOfContentOwnerChannel sets the optional parameter -// "onBehalfOfContentOwnerChannel": This parameter can only be used in a -// properly authorized request. *Note:* This parameter is intended -// exclusively for YouTube content partners. The -// *onBehalfOfContentOwnerChannel* parameter specifies the YouTube -// channel ID of the channel to which a video is being added. This -// parameter is required when a request specifies a value for the -// onBehalfOfContentOwner parameter, and it can only be used in -// conjunction with that parameter. In addition, the request must be -// authorized using a CMS account that is linked to the content owner -// that the onBehalfOfContentOwner parameter specifies. Finally, the -// channel that the onBehalfOfContentOwnerChannel parameter value -// specifies must be linked to the content owner that the -// onBehalfOfContentOwner parameter specifies. This parameter is -// intended for YouTube content partners that own and manage many -// different YouTube channels. It allows content owners to authenticate -// once and perform actions on behalf of the channel specified in the -// parameter value, without having to provide authentication credentials -// for each separate channel. -func (c *YoutubeV3LiveBroadcastsCuepointCreateCall) OnBehalfOfContentOwnerChannel(onBehalfOfContentOwnerChannel string) *YoutubeV3LiveBroadcastsCuepointCreateCall { - c.urlParams_.Set("onBehalfOfContentOwnerChannel", onBehalfOfContentOwnerChannel) - return c -} - -// Part sets the optional parameter "part": The *part* parameter -// specifies a comma-separated list of one or more liveBroadcast -// resource properties that the API response will include. The part -// names that you can include in the parameter value are id, snippet, -// contentDetails, and status. -func (c *YoutubeV3LiveBroadcastsCuepointCreateCall) Part(part ...string) *YoutubeV3LiveBroadcastsCuepointCreateCall { - c.urlParams_.SetMulti("part", append([]string{}, part...)) - return c -} - -// ResourceCueType sets the optional parameter "resource.cueType": -// -// Possible values: -// "cueTypeUnspecified" -// "cueTypeAd" -func (c *YoutubeV3LiveBroadcastsCuepointCreateCall) ResourceCueType(resourceCueType string) *YoutubeV3LiveBroadcastsCuepointCreateCall { - c.urlParams_.Set("resource.cueType", resourceCueType) - return c -} - -// ResourceDurationSecs sets the optional parameter -// "resource.durationSecs": The duration of this cuepoint. -func (c *YoutubeV3LiveBroadcastsCuepointCreateCall) ResourceDurationSecs(resourceDurationSecs int64) *YoutubeV3LiveBroadcastsCuepointCreateCall { - c.urlParams_.Set("resource.durationSecs", fmt.Sprint(resourceDurationSecs)) - return c -} - -// ResourceId sets the optional parameter "resource.id": The identifier -// for cuepoint resource. -func (c *YoutubeV3LiveBroadcastsCuepointCreateCall) ResourceId(resourceId string) *YoutubeV3LiveBroadcastsCuepointCreateCall { - c.urlParams_.Set("resource.id", resourceId) - return c -} - -// ResourceInsertionOffsetTimeMs sets the optional parameter -// "resource.insertionOffsetTimeMs": The time when the cuepoint should -// be inserted by offset to the broadcast actual start time. -func (c *YoutubeV3LiveBroadcastsCuepointCreateCall) ResourceInsertionOffsetTimeMs(resourceInsertionOffsetTimeMs int64) *YoutubeV3LiveBroadcastsCuepointCreateCall { - c.urlParams_.Set("resource.insertionOffsetTimeMs", fmt.Sprint(resourceInsertionOffsetTimeMs)) - return c -} - -// ResourceWalltimeMs sets the optional parameter "resource.walltimeMs": -// The wall clock time at which the cuepoint should be inserted. Only -// one of insertion_offset_time_ms and walltime_ms may be set at a time. -func (c *YoutubeV3LiveBroadcastsCuepointCreateCall) ResourceWalltimeMs(resourceWalltimeMs uint64) *YoutubeV3LiveBroadcastsCuepointCreateCall { - c.urlParams_.Set("resource.walltimeMs", fmt.Sprint(resourceWalltimeMs)) - 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 *YoutubeV3LiveBroadcastsCuepointCreateCall) Fields(s ...googleapi.Field) *YoutubeV3LiveBroadcastsCuepointCreateCall { - 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 *YoutubeV3LiveBroadcastsCuepointCreateCall) Context(ctx context.Context) *YoutubeV3LiveBroadcastsCuepointCreateCall { - 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 *YoutubeV3LiveBroadcastsCuepointCreateCall) Header() http.Header { - if c.header_ == nil { - c.header_ = make(http.Header) - } - return c.header_ -} - -func (c *YoutubeV3LiveBroadcastsCuepointCreateCall) 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, "youtube/v3/liveBroadcasts/cuepoint") - urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("POST", urls, body) - if err != nil { - return nil, err - } - req.Header = reqHeaders - return gensupport.SendRequest(c.ctx_, c.s.client, req) -} - -// Do executes the "youtube.youtube.v3.liveBroadcasts.cuepoint.create" call. -// Exactly one of *Cuepoint or error will be non-nil. Any non-2xx status -// code is an error. Response headers are in either -// *Cuepoint.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 *YoutubeV3LiveBroadcastsCuepointCreateCall) Do(opts ...googleapi.CallOption) (*Cuepoint, 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 := &Cuepoint{ - 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": "Insert cuepoints in a broadcast", - // "flatPath": "youtube/v3/liveBroadcasts/cuepoint", - // "httpMethod": "POST", - // "id": "youtube.youtube.v3.liveBroadcasts.cuepoint.create", - // "parameterOrder": [], - // "parameters": { - // "id": { - // "description": "Broadcast to insert ads to, or equivalently `external_video_id` for internal use.", - // "location": "query", - // "type": "string" - // }, - // "onBehalfOfContentOwner": { - // "description": "*Note:* This parameter is intended exclusively for YouTube content partners. The *onBehalfOfContentOwner* parameter indicates that the request's authorization credentials identify a YouTube CMS user who is acting on behalf of the content owner specified in the parameter value. This parameter is intended for YouTube content partners that own and manage many different YouTube channels. It allows content owners to authenticate once and get access to all their video and channel data, without having to provide authentication credentials for each individual channel. The CMS account that the user authenticates with must be linked to the specified YouTube content owner.", - // "location": "query", - // "type": "string" - // }, - // "onBehalfOfContentOwnerChannel": { - // "description": "This parameter can only be used in a properly authorized request. *Note:* This parameter is intended exclusively for YouTube content partners. The *onBehalfOfContentOwnerChannel* parameter specifies the YouTube channel ID of the channel to which a video is being added. This parameter is required when a request specifies a value for the onBehalfOfContentOwner parameter, and it can only be used in conjunction with that parameter. In addition, the request must be authorized using a CMS account that is linked to the content owner that the onBehalfOfContentOwner parameter specifies. Finally, the channel that the onBehalfOfContentOwnerChannel parameter value specifies must be linked to the content owner that the onBehalfOfContentOwner parameter specifies. This parameter is intended for YouTube content partners that own and manage many different YouTube channels. It allows content owners to authenticate once and perform actions on behalf of the channel specified in the parameter value, without having to provide authentication credentials for each separate channel.", - // "location": "query", - // "type": "string" - // }, - // "part": { - // "description": "The *part* parameter specifies a comma-separated list of one or more liveBroadcast resource properties that the API response will include. The part names that you can include in the parameter value are id, snippet, contentDetails, and status.", - // "location": "query", - // "repeated": true, - // "type": "string" - // }, - // "resource.cueType": { - // "enum": [ - // "cueTypeUnspecified", - // "cueTypeAd" - // ], - // "enumDescriptions": [ - // "", - // "" - // ], - // "location": "query", - // "type": "string" - // }, - // "resource.durationSecs": { - // "description": "The duration of this cuepoint.", - // "format": "uint32", - // "location": "query", - // "type": "integer" - // }, - // "resource.id": { - // "description": "The identifier for cuepoint resource.", - // "location": "query", - // "type": "string" - // }, - // "resource.insertionOffsetTimeMs": { - // "description": "The time when the cuepoint should be inserted by offset to the broadcast actual start time.", - // "format": "int64", - // "location": "query", - // "type": "string" - // }, - // "resource.walltimeMs": { - // "description": "The wall clock time at which the cuepoint should be inserted. Only one of insertion_offset_time_ms and walltime_ms may be set at a time.", - // "format": "uint64", - // "location": "query", - // "type": "string" - // } - // }, - // "path": "youtube/v3/liveBroadcasts/cuepoint", - // "response": { - // "$ref": "Cuepoint" - // } - // } - -}