all: regen
Includes a re-pin of go-genproto after
https://github.com/google/go-genproto/pull/155.
Manually removed firestore/apiv1beta1 changes due to
https://github.com/googleapis/gapic-generator/issues/2676.
Manually removed talent/apiv1beta1's resume_client.go and
resume_client_example_test.go since these were removed from the service
definition (the generator does not remove files, just adds / updates).
Change-Id: I64bedf5563b4abf49999990d7270b8025d11322f
Reviewed-on: https://code-review.googlesource.com/c/gocloud/+/39510
Reviewed-by: kokoro <noreply+kokoro@google.com>
Reviewed-by: Tyler Bui-Palsulich <tbp@google.com>
diff --git a/asset/apiv1/asset_client.go b/asset/apiv1/asset_client.go
index ca92590..af28f72 100644
--- a/asset/apiv1/asset_client.go
+++ b/asset/apiv1/asset_client.go
@@ -18,6 +18,7 @@
import (
"context"
+ "fmt"
"time"
"cloud.google.com/go/longrunning"
@@ -142,7 +143,8 @@
// This API implements the [google.longrunning.Operation][google.longrunning.Operation] API allowing you
// to keep track of the export.
func (c *Client) ExportAssets(ctx context.Context, req *assetpb.ExportAssetsRequest, opts ...gax.CallOption) (*ExportAssetsOperation, error) {
- ctx = insertMetadata(ctx, c.xGoogMetadata)
+ md := metadata.Pairs("x-goog-request-params", fmt.Sprintf("%s=%v", "parent", req.GetParent()))
+ ctx = insertMetadata(ctx, c.xGoogMetadata, md)
opts = append(c.CallOptions.ExportAssets[0:len(c.CallOptions.ExportAssets):len(c.CallOptions.ExportAssets)], opts...)
var resp *longrunningpb.Operation
err := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error {
@@ -166,7 +168,8 @@
// If a specified asset does not exist, this API returns an INVALID_ARGUMENT
// error.
func (c *Client) BatchGetAssetsHistory(ctx context.Context, req *assetpb.BatchGetAssetsHistoryRequest, opts ...gax.CallOption) (*assetpb.BatchGetAssetsHistoryResponse, error) {
- ctx = insertMetadata(ctx, c.xGoogMetadata)
+ md := metadata.Pairs("x-goog-request-params", fmt.Sprintf("%s=%v", "parent", req.GetParent()))
+ ctx = insertMetadata(ctx, c.xGoogMetadata, md)
opts = append(c.CallOptions.BatchGetAssetsHistory[0:len(c.CallOptions.BatchGetAssetsHistory):len(c.CallOptions.BatchGetAssetsHistory)], opts...)
var resp *assetpb.BatchGetAssetsHistoryResponse
err := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error {
diff --git a/asset/apiv1/doc.go b/asset/apiv1/doc.go
index 7074de7..b1126ea 100644
--- a/asset/apiv1/doc.go
+++ b/asset/apiv1/doc.go
@@ -97,4 +97,4 @@
return "UNKNOWN"
}
-const versionClient = "20190326"
+const versionClient = "20190401"
diff --git a/asset/apiv1beta1/asset_client.go b/asset/apiv1beta1/asset_client.go
index 02f423f..6a0301f 100644
--- a/asset/apiv1beta1/asset_client.go
+++ b/asset/apiv1beta1/asset_client.go
@@ -18,6 +18,7 @@
import (
"context"
+ "fmt"
"time"
"cloud.google.com/go/longrunning"
@@ -143,7 +144,8 @@
// [google.longrunning.Operation][google.longrunning.Operation] API allowing
// you to keep track of the export.
func (c *Client) ExportAssets(ctx context.Context, req *assetpb.ExportAssetsRequest, opts ...gax.CallOption) (*ExportAssetsOperation, error) {
- ctx = insertMetadata(ctx, c.xGoogMetadata)
+ md := metadata.Pairs("x-goog-request-params", fmt.Sprintf("%s=%v", "parent", req.GetParent()))
+ ctx = insertMetadata(ctx, c.xGoogMetadata, md)
opts = append(c.CallOptions.ExportAssets[0:len(c.CallOptions.ExportAssets):len(c.CallOptions.ExportAssets)], opts...)
var resp *longrunningpb.Operation
err := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error {
@@ -165,7 +167,8 @@
// For IAM_POLICY content, this API outputs history when the asset and its
// attached IAM POLICY both exist. This can create gaps in the output history.
func (c *Client) BatchGetAssetsHistory(ctx context.Context, req *assetpb.BatchGetAssetsHistoryRequest, opts ...gax.CallOption) (*assetpb.BatchGetAssetsHistoryResponse, error) {
- ctx = insertMetadata(ctx, c.xGoogMetadata)
+ md := metadata.Pairs("x-goog-request-params", fmt.Sprintf("%s=%v", "parent", req.GetParent()))
+ ctx = insertMetadata(ctx, c.xGoogMetadata, md)
opts = append(c.CallOptions.BatchGetAssetsHistory[0:len(c.CallOptions.BatchGetAssetsHistory):len(c.CallOptions.BatchGetAssetsHistory)], opts...)
var resp *assetpb.BatchGetAssetsHistoryResponse
err := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error {
diff --git a/asset/apiv1beta1/doc.go b/asset/apiv1beta1/doc.go
index 9bb5580..d18ed2f 100644
--- a/asset/apiv1beta1/doc.go
+++ b/asset/apiv1beta1/doc.go
@@ -97,4 +97,4 @@
return "UNKNOWN"
}
-const versionClient = "20190322"
+const versionClient = "20190401"
diff --git a/bigquery/datatransfer/apiv1/doc.go b/bigquery/datatransfer/apiv1/doc.go
index 67a2d7a..ccc8aa0 100644
--- a/bigquery/datatransfer/apiv1/doc.go
+++ b/bigquery/datatransfer/apiv1/doc.go
@@ -98,4 +98,4 @@
return "UNKNOWN"
}
-const versionClient = "20190322"
+const versionClient = "20190401"
diff --git a/bigquery/storage/apiv1beta1/doc.go b/bigquery/storage/apiv1beta1/doc.go
index ca44564..91a1ba8 100644
--- a/bigquery/storage/apiv1beta1/doc.go
+++ b/bigquery/storage/apiv1beta1/doc.go
@@ -97,4 +97,4 @@
return "UNKNOWN"
}
-const versionClient = "20190322"
+const versionClient = "20190401"
diff --git a/cloudtasks/apiv2/doc.go b/cloudtasks/apiv2/doc.go
index 19e255f..704f16d 100644
--- a/cloudtasks/apiv2/doc.go
+++ b/cloudtasks/apiv2/doc.go
@@ -97,4 +97,4 @@
return "UNKNOWN"
}
-const versionClient = "20190326"
+const versionClient = "20190401"
diff --git a/cloudtasks/apiv2beta2/doc.go b/cloudtasks/apiv2beta2/doc.go
index 9821724..6f8c397 100644
--- a/cloudtasks/apiv2beta2/doc.go
+++ b/cloudtasks/apiv2beta2/doc.go
@@ -97,4 +97,4 @@
return "UNKNOWN"
}
-const versionClient = "20190322"
+const versionClient = "20190401"
diff --git a/cloudtasks/apiv2beta3/doc.go b/cloudtasks/apiv2beta3/doc.go
index 8eb7343..227a536 100644
--- a/cloudtasks/apiv2beta3/doc.go
+++ b/cloudtasks/apiv2beta3/doc.go
@@ -97,4 +97,4 @@
return "UNKNOWN"
}
-const versionClient = "20190322"
+const versionClient = "20190401"
diff --git a/containeranalysis/apiv1beta1/container_analysis_v1_beta1_client.go b/containeranalysis/apiv1beta1/container_analysis_v1_beta1_client.go
index 758df60..3c18744 100644
--- a/containeranalysis/apiv1beta1/container_analysis_v1_beta1_client.go
+++ b/containeranalysis/apiv1beta1/container_analysis_v1_beta1_client.go
@@ -18,6 +18,7 @@
import (
"context"
+ "fmt"
"math"
"time"
@@ -151,7 +152,8 @@
// notes and projects/[PROJECT_ID]/occurrences/[OCCURRENCE_ID] for
// occurrences.
func (c *ContainerAnalysisV1Beta1Client) SetIamPolicy(ctx context.Context, req *iampb.SetIamPolicyRequest, opts ...gax.CallOption) (*iampb.Policy, error) {
- ctx = insertMetadata(ctx, c.xGoogMetadata)
+ md := metadata.Pairs("x-goog-request-params", fmt.Sprintf("%s=%v", "resource", req.GetResource()))
+ ctx = insertMetadata(ctx, c.xGoogMetadata, md)
opts = append(c.CallOptions.SetIamPolicy[0:len(c.CallOptions.SetIamPolicy):len(c.CallOptions.SetIamPolicy)], opts...)
var resp *iampb.Policy
err := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error {
@@ -174,7 +176,8 @@
// notes and projects/[PROJECT_ID]/occurrences/[OCCURRENCE_ID] for
// occurrences.
func (c *ContainerAnalysisV1Beta1Client) GetIamPolicy(ctx context.Context, req *iampb.GetIamPolicyRequest, opts ...gax.CallOption) (*iampb.Policy, error) {
- ctx = insertMetadata(ctx, c.xGoogMetadata)
+ md := metadata.Pairs("x-goog-request-params", fmt.Sprintf("%s=%v", "resource", req.GetResource()))
+ ctx = insertMetadata(ctx, c.xGoogMetadata, md)
opts = append(c.CallOptions.GetIamPolicy[0:len(c.CallOptions.GetIamPolicy):len(c.CallOptions.GetIamPolicy)], opts...)
var resp *iampb.Policy
err := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error {
@@ -196,7 +199,8 @@
// notes and projects/[PROJECT_ID]/occurrences/[OCCURRENCE_ID] for
// occurrences.
func (c *ContainerAnalysisV1Beta1Client) TestIamPermissions(ctx context.Context, req *iampb.TestIamPermissionsRequest, opts ...gax.CallOption) (*iampb.TestIamPermissionsResponse, error) {
- ctx = insertMetadata(ctx, c.xGoogMetadata)
+ md := metadata.Pairs("x-goog-request-params", fmt.Sprintf("%s=%v", "resource", req.GetResource()))
+ ctx = insertMetadata(ctx, c.xGoogMetadata, md)
opts = append(c.CallOptions.TestIamPermissions[0:len(c.CallOptions.TestIamPermissions):len(c.CallOptions.TestIamPermissions)], opts...)
var resp *iampb.TestIamPermissionsResponse
err := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error {
@@ -212,7 +216,8 @@
// GetScanConfig gets the specified scan configuration.
func (c *ContainerAnalysisV1Beta1Client) GetScanConfig(ctx context.Context, req *containeranalysispb.GetScanConfigRequest, opts ...gax.CallOption) (*containeranalysispb.ScanConfig, error) {
- ctx = insertMetadata(ctx, c.xGoogMetadata)
+ md := metadata.Pairs("x-goog-request-params", fmt.Sprintf("%s=%v", "name", req.GetName()))
+ ctx = insertMetadata(ctx, c.xGoogMetadata, md)
opts = append(c.CallOptions.GetScanConfig[0:len(c.CallOptions.GetScanConfig):len(c.CallOptions.GetScanConfig)], opts...)
var resp *containeranalysispb.ScanConfig
err := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error {
@@ -228,7 +233,8 @@
// ListScanConfigs lists scan configurations for the specified project.
func (c *ContainerAnalysisV1Beta1Client) ListScanConfigs(ctx context.Context, req *containeranalysispb.ListScanConfigsRequest, opts ...gax.CallOption) *ScanConfigIterator {
- ctx = insertMetadata(ctx, c.xGoogMetadata)
+ md := metadata.Pairs("x-goog-request-params", fmt.Sprintf("%s=%v", "parent", req.GetParent()))
+ ctx = insertMetadata(ctx, c.xGoogMetadata, md)
opts = append(c.CallOptions.ListScanConfigs[0:len(c.CallOptions.ListScanConfigs):len(c.CallOptions.ListScanConfigs)], opts...)
it := &ScanConfigIterator{}
req = proto.Clone(req).(*containeranalysispb.ListScanConfigsRequest)
@@ -265,7 +271,8 @@
// UpdateScanConfig updates the specified scan configuration.
func (c *ContainerAnalysisV1Beta1Client) UpdateScanConfig(ctx context.Context, req *containeranalysispb.UpdateScanConfigRequest, opts ...gax.CallOption) (*containeranalysispb.ScanConfig, error) {
- ctx = insertMetadata(ctx, c.xGoogMetadata)
+ md := metadata.Pairs("x-goog-request-params", fmt.Sprintf("%s=%v", "name", req.GetName()))
+ ctx = insertMetadata(ctx, c.xGoogMetadata, md)
opts = append(c.CallOptions.UpdateScanConfig[0:len(c.CallOptions.UpdateScanConfig):len(c.CallOptions.UpdateScanConfig)], opts...)
var resp *containeranalysispb.ScanConfig
err := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error {
diff --git a/containeranalysis/apiv1beta1/doc.go b/containeranalysis/apiv1beta1/doc.go
index f3a1b1b..06c5662 100644
--- a/containeranalysis/apiv1beta1/doc.go
+++ b/containeranalysis/apiv1beta1/doc.go
@@ -99,4 +99,4 @@
return "UNKNOWN"
}
-const versionClient = "20190322"
+const versionClient = "20190401"
diff --git a/containeranalysis/apiv1beta1/grafeas_v1_beta1_client.go b/containeranalysis/apiv1beta1/grafeas_v1_beta1_client.go
index 40091f6..f35086f 100644
--- a/containeranalysis/apiv1beta1/grafeas_v1_beta1_client.go
+++ b/containeranalysis/apiv1beta1/grafeas_v1_beta1_client.go
@@ -18,6 +18,7 @@
import (
"context"
+ "fmt"
"math"
"time"
@@ -162,7 +163,8 @@
// GetOccurrence gets the specified occurrence.
func (c *GrafeasV1Beta1Client) GetOccurrence(ctx context.Context, req *grafeaspb.GetOccurrenceRequest, opts ...gax.CallOption) (*grafeaspb.Occurrence, error) {
- ctx = insertMetadata(ctx, c.xGoogMetadata)
+ md := metadata.Pairs("x-goog-request-params", fmt.Sprintf("%s=%v", "name", req.GetName()))
+ ctx = insertMetadata(ctx, c.xGoogMetadata, md)
opts = append(c.CallOptions.GetOccurrence[0:len(c.CallOptions.GetOccurrence):len(c.CallOptions.GetOccurrence)], opts...)
var resp *grafeaspb.Occurrence
err := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error {
@@ -178,7 +180,8 @@
// ListOccurrences lists occurrences for the specified project.
func (c *GrafeasV1Beta1Client) ListOccurrences(ctx context.Context, req *grafeaspb.ListOccurrencesRequest, opts ...gax.CallOption) *OccurrenceIterator {
- ctx = insertMetadata(ctx, c.xGoogMetadata)
+ md := metadata.Pairs("x-goog-request-params", fmt.Sprintf("%s=%v", "parent", req.GetParent()))
+ ctx = insertMetadata(ctx, c.xGoogMetadata, md)
opts = append(c.CallOptions.ListOccurrences[0:len(c.CallOptions.ListOccurrences):len(c.CallOptions.ListOccurrences)], opts...)
it := &OccurrenceIterator{}
req = proto.Clone(req).(*grafeaspb.ListOccurrencesRequest)
@@ -217,7 +220,8 @@
// occurrence when the occurrence is no longer applicable for the given
// resource.
func (c *GrafeasV1Beta1Client) DeleteOccurrence(ctx context.Context, req *grafeaspb.DeleteOccurrenceRequest, opts ...gax.CallOption) error {
- ctx = insertMetadata(ctx, c.xGoogMetadata)
+ md := metadata.Pairs("x-goog-request-params", fmt.Sprintf("%s=%v", "name", req.GetName()))
+ ctx = insertMetadata(ctx, c.xGoogMetadata, md)
opts = append(c.CallOptions.DeleteOccurrence[0:len(c.CallOptions.DeleteOccurrence):len(c.CallOptions.DeleteOccurrence)], opts...)
err := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error {
var err error
@@ -229,7 +233,8 @@
// CreateOccurrence creates a new occurrence.
func (c *GrafeasV1Beta1Client) CreateOccurrence(ctx context.Context, req *grafeaspb.CreateOccurrenceRequest, opts ...gax.CallOption) (*grafeaspb.Occurrence, error) {
- ctx = insertMetadata(ctx, c.xGoogMetadata)
+ md := metadata.Pairs("x-goog-request-params", fmt.Sprintf("%s=%v", "parent", req.GetParent()))
+ ctx = insertMetadata(ctx, c.xGoogMetadata, md)
opts = append(c.CallOptions.CreateOccurrence[0:len(c.CallOptions.CreateOccurrence):len(c.CallOptions.CreateOccurrence)], opts...)
var resp *grafeaspb.Occurrence
err := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error {
@@ -245,7 +250,8 @@
// BatchCreateOccurrences creates new occurrences in batch.
func (c *GrafeasV1Beta1Client) BatchCreateOccurrences(ctx context.Context, req *grafeaspb.BatchCreateOccurrencesRequest, opts ...gax.CallOption) (*grafeaspb.BatchCreateOccurrencesResponse, error) {
- ctx = insertMetadata(ctx, c.xGoogMetadata)
+ md := metadata.Pairs("x-goog-request-params", fmt.Sprintf("%s=%v", "parent", req.GetParent()))
+ ctx = insertMetadata(ctx, c.xGoogMetadata, md)
opts = append(c.CallOptions.BatchCreateOccurrences[0:len(c.CallOptions.BatchCreateOccurrences):len(c.CallOptions.BatchCreateOccurrences)], opts...)
var resp *grafeaspb.BatchCreateOccurrencesResponse
err := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error {
@@ -261,7 +267,8 @@
// UpdateOccurrence updates the specified occurrence.
func (c *GrafeasV1Beta1Client) UpdateOccurrence(ctx context.Context, req *grafeaspb.UpdateOccurrenceRequest, opts ...gax.CallOption) (*grafeaspb.Occurrence, error) {
- ctx = insertMetadata(ctx, c.xGoogMetadata)
+ md := metadata.Pairs("x-goog-request-params", fmt.Sprintf("%s=%v", "name", req.GetName()))
+ ctx = insertMetadata(ctx, c.xGoogMetadata, md)
opts = append(c.CallOptions.UpdateOccurrence[0:len(c.CallOptions.UpdateOccurrence):len(c.CallOptions.UpdateOccurrence)], opts...)
var resp *grafeaspb.Occurrence
err := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error {
@@ -278,7 +285,8 @@
// GetOccurrenceNote gets the note attached to the specified occurrence. Consumer projects can
// use this method to get a note that belongs to a provider project.
func (c *GrafeasV1Beta1Client) GetOccurrenceNote(ctx context.Context, req *grafeaspb.GetOccurrenceNoteRequest, opts ...gax.CallOption) (*grafeaspb.Note, error) {
- ctx = insertMetadata(ctx, c.xGoogMetadata)
+ md := metadata.Pairs("x-goog-request-params", fmt.Sprintf("%s=%v", "name", req.GetName()))
+ ctx = insertMetadata(ctx, c.xGoogMetadata, md)
opts = append(c.CallOptions.GetOccurrenceNote[0:len(c.CallOptions.GetOccurrenceNote):len(c.CallOptions.GetOccurrenceNote)], opts...)
var resp *grafeaspb.Note
err := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error {
@@ -294,7 +302,8 @@
// GetNote gets the specified note.
func (c *GrafeasV1Beta1Client) GetNote(ctx context.Context, req *grafeaspb.GetNoteRequest, opts ...gax.CallOption) (*grafeaspb.Note, error) {
- ctx = insertMetadata(ctx, c.xGoogMetadata)
+ md := metadata.Pairs("x-goog-request-params", fmt.Sprintf("%s=%v", "name", req.GetName()))
+ ctx = insertMetadata(ctx, c.xGoogMetadata, md)
opts = append(c.CallOptions.GetNote[0:len(c.CallOptions.GetNote):len(c.CallOptions.GetNote)], opts...)
var resp *grafeaspb.Note
err := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error {
@@ -310,7 +319,8 @@
// ListNotes lists notes for the specified project.
func (c *GrafeasV1Beta1Client) ListNotes(ctx context.Context, req *grafeaspb.ListNotesRequest, opts ...gax.CallOption) *NoteIterator {
- ctx = insertMetadata(ctx, c.xGoogMetadata)
+ md := metadata.Pairs("x-goog-request-params", fmt.Sprintf("%s=%v", "parent", req.GetParent()))
+ ctx = insertMetadata(ctx, c.xGoogMetadata, md)
opts = append(c.CallOptions.ListNotes[0:len(c.CallOptions.ListNotes):len(c.CallOptions.ListNotes)], opts...)
it := &NoteIterator{}
req = proto.Clone(req).(*grafeaspb.ListNotesRequest)
@@ -347,7 +357,8 @@
// DeleteNote deletes the specified note.
func (c *GrafeasV1Beta1Client) DeleteNote(ctx context.Context, req *grafeaspb.DeleteNoteRequest, opts ...gax.CallOption) error {
- ctx = insertMetadata(ctx, c.xGoogMetadata)
+ md := metadata.Pairs("x-goog-request-params", fmt.Sprintf("%s=%v", "name", req.GetName()))
+ ctx = insertMetadata(ctx, c.xGoogMetadata, md)
opts = append(c.CallOptions.DeleteNote[0:len(c.CallOptions.DeleteNote):len(c.CallOptions.DeleteNote)], opts...)
err := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error {
var err error
@@ -359,7 +370,8 @@
// CreateNote creates a new note.
func (c *GrafeasV1Beta1Client) CreateNote(ctx context.Context, req *grafeaspb.CreateNoteRequest, opts ...gax.CallOption) (*grafeaspb.Note, error) {
- ctx = insertMetadata(ctx, c.xGoogMetadata)
+ md := metadata.Pairs("x-goog-request-params", fmt.Sprintf("%s=%v", "parent", req.GetParent()))
+ ctx = insertMetadata(ctx, c.xGoogMetadata, md)
opts = append(c.CallOptions.CreateNote[0:len(c.CallOptions.CreateNote):len(c.CallOptions.CreateNote)], opts...)
var resp *grafeaspb.Note
err := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error {
@@ -375,7 +387,8 @@
// BatchCreateNotes creates new notes in batch.
func (c *GrafeasV1Beta1Client) BatchCreateNotes(ctx context.Context, req *grafeaspb.BatchCreateNotesRequest, opts ...gax.CallOption) (*grafeaspb.BatchCreateNotesResponse, error) {
- ctx = insertMetadata(ctx, c.xGoogMetadata)
+ md := metadata.Pairs("x-goog-request-params", fmt.Sprintf("%s=%v", "parent", req.GetParent()))
+ ctx = insertMetadata(ctx, c.xGoogMetadata, md)
opts = append(c.CallOptions.BatchCreateNotes[0:len(c.CallOptions.BatchCreateNotes):len(c.CallOptions.BatchCreateNotes)], opts...)
var resp *grafeaspb.BatchCreateNotesResponse
err := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error {
@@ -391,7 +404,8 @@
// UpdateNote updates the specified note.
func (c *GrafeasV1Beta1Client) UpdateNote(ctx context.Context, req *grafeaspb.UpdateNoteRequest, opts ...gax.CallOption) (*grafeaspb.Note, error) {
- ctx = insertMetadata(ctx, c.xGoogMetadata)
+ md := metadata.Pairs("x-goog-request-params", fmt.Sprintf("%s=%v", "name", req.GetName()))
+ ctx = insertMetadata(ctx, c.xGoogMetadata, md)
opts = append(c.CallOptions.UpdateNote[0:len(c.CallOptions.UpdateNote):len(c.CallOptions.UpdateNote)], opts...)
var resp *grafeaspb.Note
err := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error {
@@ -409,7 +423,8 @@
// this method to get all occurrences across consumer projects referencing the
// specified note.
func (c *GrafeasV1Beta1Client) ListNoteOccurrences(ctx context.Context, req *grafeaspb.ListNoteOccurrencesRequest, opts ...gax.CallOption) *OccurrenceIterator {
- ctx = insertMetadata(ctx, c.xGoogMetadata)
+ md := metadata.Pairs("x-goog-request-params", fmt.Sprintf("%s=%v", "name", req.GetName()))
+ ctx = insertMetadata(ctx, c.xGoogMetadata, md)
opts = append(c.CallOptions.ListNoteOccurrences[0:len(c.CallOptions.ListNoteOccurrences):len(c.CallOptions.ListNoteOccurrences)], opts...)
it := &OccurrenceIterator{}
req = proto.Clone(req).(*grafeaspb.ListNoteOccurrencesRequest)
@@ -446,7 +461,8 @@
// GetVulnerabilityOccurrencesSummary gets a summary of the number and severity of occurrences.
func (c *GrafeasV1Beta1Client) GetVulnerabilityOccurrencesSummary(ctx context.Context, req *grafeaspb.GetVulnerabilityOccurrencesSummaryRequest, opts ...gax.CallOption) (*grafeaspb.VulnerabilityOccurrencesSummary, error) {
- ctx = insertMetadata(ctx, c.xGoogMetadata)
+ md := metadata.Pairs("x-goog-request-params", fmt.Sprintf("%s=%v", "parent", req.GetParent()))
+ ctx = insertMetadata(ctx, c.xGoogMetadata, md)
opts = append(c.CallOptions.GetVulnerabilityOccurrencesSummary[0:len(c.CallOptions.GetVulnerabilityOccurrencesSummary):len(c.CallOptions.GetVulnerabilityOccurrencesSummary)], opts...)
var resp *grafeaspb.VulnerabilityOccurrencesSummary
err := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error {
diff --git a/dataproc/apiv1/doc.go b/dataproc/apiv1/doc.go
index eb9e64a..5a2620c 100644
--- a/dataproc/apiv1/doc.go
+++ b/dataproc/apiv1/doc.go
@@ -97,4 +97,4 @@
return "UNKNOWN"
}
-const versionClient = "20190322"
+const versionClient = "20190401"
diff --git a/dataproc/apiv1/workflow_template_client.go b/dataproc/apiv1/workflow_template_client.go
index 611ea9d..fe7c68c 100644
--- a/dataproc/apiv1/workflow_template_client.go
+++ b/dataproc/apiv1/workflow_template_client.go
@@ -18,6 +18,7 @@
import (
"context"
+ "fmt"
"math"
"time"
@@ -165,7 +166,8 @@
// CreateWorkflowTemplate creates new workflow template.
func (c *WorkflowTemplateClient) CreateWorkflowTemplate(ctx context.Context, req *dataprocpb.CreateWorkflowTemplateRequest, opts ...gax.CallOption) (*dataprocpb.WorkflowTemplate, error) {
- ctx = insertMetadata(ctx, c.xGoogMetadata)
+ md := metadata.Pairs("x-goog-request-params", fmt.Sprintf("%s=%v", "parent", req.GetParent()))
+ ctx = insertMetadata(ctx, c.xGoogMetadata, md)
opts = append(c.CallOptions.CreateWorkflowTemplate[0:len(c.CallOptions.CreateWorkflowTemplate):len(c.CallOptions.CreateWorkflowTemplate)], opts...)
var resp *dataprocpb.WorkflowTemplate
err := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error {
@@ -184,7 +186,8 @@
// Can retrieve previously instantiated template by specifying optional
// version parameter.
func (c *WorkflowTemplateClient) GetWorkflowTemplate(ctx context.Context, req *dataprocpb.GetWorkflowTemplateRequest, opts ...gax.CallOption) (*dataprocpb.WorkflowTemplate, error) {
- ctx = insertMetadata(ctx, c.xGoogMetadata)
+ md := metadata.Pairs("x-goog-request-params", fmt.Sprintf("%s=%v", "name", req.GetName()))
+ ctx = insertMetadata(ctx, c.xGoogMetadata, md)
opts = append(c.CallOptions.GetWorkflowTemplate[0:len(c.CallOptions.GetWorkflowTemplate):len(c.CallOptions.GetWorkflowTemplate)], opts...)
var resp *dataprocpb.WorkflowTemplate
err := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error {
@@ -217,7 +220,8 @@
// [Operation.response][google.longrunning.Operation.response] will be
// [Empty][google.protobuf.Empty].
func (c *WorkflowTemplateClient) InstantiateWorkflowTemplate(ctx context.Context, req *dataprocpb.InstantiateWorkflowTemplateRequest, opts ...gax.CallOption) (*InstantiateWorkflowTemplateOperation, error) {
- ctx = insertMetadata(ctx, c.xGoogMetadata)
+ md := metadata.Pairs("x-goog-request-params", fmt.Sprintf("%s=%v", "name", req.GetName()))
+ ctx = insertMetadata(ctx, c.xGoogMetadata, md)
opts = append(c.CallOptions.InstantiateWorkflowTemplate[0:len(c.CallOptions.InstantiateWorkflowTemplate):len(c.CallOptions.InstantiateWorkflowTemplate)], opts...)
var resp *longrunningpb.Operation
err := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error {
@@ -257,7 +261,8 @@
// [Operation.response][google.longrunning.Operation.response] will be
// [Empty][google.protobuf.Empty].
func (c *WorkflowTemplateClient) InstantiateInlineWorkflowTemplate(ctx context.Context, req *dataprocpb.InstantiateInlineWorkflowTemplateRequest, opts ...gax.CallOption) (*InstantiateInlineWorkflowTemplateOperation, error) {
- ctx = insertMetadata(ctx, c.xGoogMetadata)
+ md := metadata.Pairs("x-goog-request-params", fmt.Sprintf("%s=%v", "parent", req.GetParent()))
+ ctx = insertMetadata(ctx, c.xGoogMetadata, md)
opts = append(c.CallOptions.InstantiateInlineWorkflowTemplate[0:len(c.CallOptions.InstantiateInlineWorkflowTemplate):len(c.CallOptions.InstantiateInlineWorkflowTemplate)], opts...)
var resp *longrunningpb.Operation
err := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error {
@@ -276,7 +281,8 @@
// UpdateWorkflowTemplate updates (replaces) workflow template. The updated template
// must contain version that matches the current server version.
func (c *WorkflowTemplateClient) UpdateWorkflowTemplate(ctx context.Context, req *dataprocpb.UpdateWorkflowTemplateRequest, opts ...gax.CallOption) (*dataprocpb.WorkflowTemplate, error) {
- ctx = insertMetadata(ctx, c.xGoogMetadata)
+ md := metadata.Pairs("x-goog-request-params", fmt.Sprintf("%s=%v", "template.name", req.GetTemplate().GetName()))
+ ctx = insertMetadata(ctx, c.xGoogMetadata, md)
opts = append(c.CallOptions.UpdateWorkflowTemplate[0:len(c.CallOptions.UpdateWorkflowTemplate):len(c.CallOptions.UpdateWorkflowTemplate)], opts...)
var resp *dataprocpb.WorkflowTemplate
err := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error {
@@ -292,7 +298,8 @@
// ListWorkflowTemplates lists workflows that match the specified filter in the request.
func (c *WorkflowTemplateClient) ListWorkflowTemplates(ctx context.Context, req *dataprocpb.ListWorkflowTemplatesRequest, opts ...gax.CallOption) *WorkflowTemplateIterator {
- ctx = insertMetadata(ctx, c.xGoogMetadata)
+ md := metadata.Pairs("x-goog-request-params", fmt.Sprintf("%s=%v", "parent", req.GetParent()))
+ ctx = insertMetadata(ctx, c.xGoogMetadata, md)
opts = append(c.CallOptions.ListWorkflowTemplates[0:len(c.CallOptions.ListWorkflowTemplates):len(c.CallOptions.ListWorkflowTemplates)], opts...)
it := &WorkflowTemplateIterator{}
req = proto.Clone(req).(*dataprocpb.ListWorkflowTemplatesRequest)
@@ -329,7 +336,8 @@
// DeleteWorkflowTemplate deletes a workflow template. It does not cancel in-progress workflows.
func (c *WorkflowTemplateClient) DeleteWorkflowTemplate(ctx context.Context, req *dataprocpb.DeleteWorkflowTemplateRequest, opts ...gax.CallOption) error {
- ctx = insertMetadata(ctx, c.xGoogMetadata)
+ md := metadata.Pairs("x-goog-request-params", fmt.Sprintf("%s=%v", "name", req.GetName()))
+ ctx = insertMetadata(ctx, c.xGoogMetadata, md)
opts = append(c.CallOptions.DeleteWorkflowTemplate[0:len(c.CallOptions.DeleteWorkflowTemplate):len(c.CallOptions.DeleteWorkflowTemplate)], opts...)
err := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error {
var err error
diff --git a/dataproc/apiv1beta2/doc.go b/dataproc/apiv1beta2/doc.go
index 7f9abbf..f751dc6 100644
--- a/dataproc/apiv1beta2/doc.go
+++ b/dataproc/apiv1beta2/doc.go
@@ -97,4 +97,4 @@
return "UNKNOWN"
}
-const versionClient = "20190322"
+const versionClient = "20190401"
diff --git a/dataproc/apiv1beta2/workflow_template_client.go b/dataproc/apiv1beta2/workflow_template_client.go
index 92ca397..91eb9dc 100644
--- a/dataproc/apiv1beta2/workflow_template_client.go
+++ b/dataproc/apiv1beta2/workflow_template_client.go
@@ -18,6 +18,7 @@
import (
"context"
+ "fmt"
"math"
"time"
@@ -165,7 +166,8 @@
// CreateWorkflowTemplate creates new workflow template.
func (c *WorkflowTemplateClient) CreateWorkflowTemplate(ctx context.Context, req *dataprocpb.CreateWorkflowTemplateRequest, opts ...gax.CallOption) (*dataprocpb.WorkflowTemplate, error) {
- ctx = insertMetadata(ctx, c.xGoogMetadata)
+ md := metadata.Pairs("x-goog-request-params", fmt.Sprintf("%s=%v", "parent", req.GetParent()))
+ ctx = insertMetadata(ctx, c.xGoogMetadata, md)
opts = append(c.CallOptions.CreateWorkflowTemplate[0:len(c.CallOptions.CreateWorkflowTemplate):len(c.CallOptions.CreateWorkflowTemplate)], opts...)
var resp *dataprocpb.WorkflowTemplate
err := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error {
@@ -184,7 +186,8 @@
// Can retrieve previously instantiated template by specifying optional
// version parameter.
func (c *WorkflowTemplateClient) GetWorkflowTemplate(ctx context.Context, req *dataprocpb.GetWorkflowTemplateRequest, opts ...gax.CallOption) (*dataprocpb.WorkflowTemplate, error) {
- ctx = insertMetadata(ctx, c.xGoogMetadata)
+ md := metadata.Pairs("x-goog-request-params", fmt.Sprintf("%s=%v", "name", req.GetName()))
+ ctx = insertMetadata(ctx, c.xGoogMetadata, md)
opts = append(c.CallOptions.GetWorkflowTemplate[0:len(c.CallOptions.GetWorkflowTemplate):len(c.CallOptions.GetWorkflowTemplate)], opts...)
var resp *dataprocpb.WorkflowTemplate
err := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error {
@@ -217,7 +220,8 @@
// [Operation.response][google.longrunning.Operation.response] will be
// [Empty][google.protobuf.Empty].
func (c *WorkflowTemplateClient) InstantiateWorkflowTemplate(ctx context.Context, req *dataprocpb.InstantiateWorkflowTemplateRequest, opts ...gax.CallOption) (*InstantiateWorkflowTemplateOperation, error) {
- ctx = insertMetadata(ctx, c.xGoogMetadata)
+ md := metadata.Pairs("x-goog-request-params", fmt.Sprintf("%s=%v", "name", req.GetName()))
+ ctx = insertMetadata(ctx, c.xGoogMetadata, md)
opts = append(c.CallOptions.InstantiateWorkflowTemplate[0:len(c.CallOptions.InstantiateWorkflowTemplate):len(c.CallOptions.InstantiateWorkflowTemplate)], opts...)
var resp *longrunningpb.Operation
err := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error {
@@ -257,7 +261,8 @@
// [Operation.response][google.longrunning.Operation.response] will be
// [Empty][google.protobuf.Empty].
func (c *WorkflowTemplateClient) InstantiateInlineWorkflowTemplate(ctx context.Context, req *dataprocpb.InstantiateInlineWorkflowTemplateRequest, opts ...gax.CallOption) (*InstantiateInlineWorkflowTemplateOperation, error) {
- ctx = insertMetadata(ctx, c.xGoogMetadata)
+ md := metadata.Pairs("x-goog-request-params", fmt.Sprintf("%s=%v", "parent", req.GetParent()))
+ ctx = insertMetadata(ctx, c.xGoogMetadata, md)
opts = append(c.CallOptions.InstantiateInlineWorkflowTemplate[0:len(c.CallOptions.InstantiateInlineWorkflowTemplate):len(c.CallOptions.InstantiateInlineWorkflowTemplate)], opts...)
var resp *longrunningpb.Operation
err := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error {
@@ -276,7 +281,8 @@
// UpdateWorkflowTemplate updates (replaces) workflow template. The updated template
// must contain version that matches the current server version.
func (c *WorkflowTemplateClient) UpdateWorkflowTemplate(ctx context.Context, req *dataprocpb.UpdateWorkflowTemplateRequest, opts ...gax.CallOption) (*dataprocpb.WorkflowTemplate, error) {
- ctx = insertMetadata(ctx, c.xGoogMetadata)
+ md := metadata.Pairs("x-goog-request-params", fmt.Sprintf("%s=%v", "template.name", req.GetTemplate().GetName()))
+ ctx = insertMetadata(ctx, c.xGoogMetadata, md)
opts = append(c.CallOptions.UpdateWorkflowTemplate[0:len(c.CallOptions.UpdateWorkflowTemplate):len(c.CallOptions.UpdateWorkflowTemplate)], opts...)
var resp *dataprocpb.WorkflowTemplate
err := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error {
@@ -292,7 +298,8 @@
// ListWorkflowTemplates lists workflows that match the specified filter in the request.
func (c *WorkflowTemplateClient) ListWorkflowTemplates(ctx context.Context, req *dataprocpb.ListWorkflowTemplatesRequest, opts ...gax.CallOption) *WorkflowTemplateIterator {
- ctx = insertMetadata(ctx, c.xGoogMetadata)
+ md := metadata.Pairs("x-goog-request-params", fmt.Sprintf("%s=%v", "parent", req.GetParent()))
+ ctx = insertMetadata(ctx, c.xGoogMetadata, md)
opts = append(c.CallOptions.ListWorkflowTemplates[0:len(c.CallOptions.ListWorkflowTemplates):len(c.CallOptions.ListWorkflowTemplates)], opts...)
it := &WorkflowTemplateIterator{}
req = proto.Clone(req).(*dataprocpb.ListWorkflowTemplatesRequest)
@@ -329,7 +336,8 @@
// DeleteWorkflowTemplate deletes a workflow template. It does not cancel in-progress workflows.
func (c *WorkflowTemplateClient) DeleteWorkflowTemplate(ctx context.Context, req *dataprocpb.DeleteWorkflowTemplateRequest, opts ...gax.CallOption) error {
- ctx = insertMetadata(ctx, c.xGoogMetadata)
+ md := metadata.Pairs("x-goog-request-params", fmt.Sprintf("%s=%v", "name", req.GetName()))
+ ctx = insertMetadata(ctx, c.xGoogMetadata, md)
opts = append(c.CallOptions.DeleteWorkflowTemplate[0:len(c.CallOptions.DeleteWorkflowTemplate):len(c.CallOptions.DeleteWorkflowTemplate)], opts...)
err := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error {
var err error
diff --git a/debugger/apiv2/controller2_client.go b/debugger/apiv2/controller2_client.go
index 5ffb8b7..8a3faa8 100644
--- a/debugger/apiv2/controller2_client.go
+++ b/debugger/apiv2/controller2_client.go
@@ -18,6 +18,7 @@
import (
"context"
+ "fmt"
"time"
gax "github.com/googleapis/gax-go/v2"
@@ -178,7 +179,8 @@
// until the controller removes them from the active list to avoid
// setting those breakpoints again.
func (c *Controller2Client) ListActiveBreakpoints(ctx context.Context, req *clouddebuggerpb.ListActiveBreakpointsRequest, opts ...gax.CallOption) (*clouddebuggerpb.ListActiveBreakpointsResponse, error) {
- ctx = insertMetadata(ctx, c.xGoogMetadata)
+ md := metadata.Pairs("x-goog-request-params", fmt.Sprintf("%s=%v", "debuggee_id", req.GetDebuggeeId()))
+ ctx = insertMetadata(ctx, c.xGoogMetadata, md)
opts = append(c.CallOptions.ListActiveBreakpoints[0:len(c.CallOptions.ListActiveBreakpoints):len(c.CallOptions.ListActiveBreakpoints)], opts...)
var resp *clouddebuggerpb.ListActiveBreakpointsResponse
err := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error {
diff --git a/debugger/apiv2/debugger2_client.go b/debugger/apiv2/debugger2_client.go
index 127747f..aaedc05 100644
--- a/debugger/apiv2/debugger2_client.go
+++ b/debugger/apiv2/debugger2_client.go
@@ -18,6 +18,7 @@
import (
"context"
+ "fmt"
"time"
gax "github.com/googleapis/gax-go/v2"
@@ -137,7 +138,8 @@
// SetBreakpoint sets the breakpoint to the debuggee.
func (c *Debugger2Client) SetBreakpoint(ctx context.Context, req *clouddebuggerpb.SetBreakpointRequest, opts ...gax.CallOption) (*clouddebuggerpb.SetBreakpointResponse, error) {
- ctx = insertMetadata(ctx, c.xGoogMetadata)
+ md := metadata.Pairs("x-goog-request-params", fmt.Sprintf("%s=%v", "debuggee_id", req.GetDebuggeeId()))
+ ctx = insertMetadata(ctx, c.xGoogMetadata, md)
opts = append(c.CallOptions.SetBreakpoint[0:len(c.CallOptions.SetBreakpoint):len(c.CallOptions.SetBreakpoint)], opts...)
var resp *clouddebuggerpb.SetBreakpointResponse
err := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error {
@@ -181,7 +183,8 @@
// ListBreakpoints lists all breakpoints for the debuggee.
func (c *Debugger2Client) ListBreakpoints(ctx context.Context, req *clouddebuggerpb.ListBreakpointsRequest, opts ...gax.CallOption) (*clouddebuggerpb.ListBreakpointsResponse, error) {
- ctx = insertMetadata(ctx, c.xGoogMetadata)
+ md := metadata.Pairs("x-goog-request-params", fmt.Sprintf("%s=%v", "debuggee_id", req.GetDebuggeeId()))
+ ctx = insertMetadata(ctx, c.xGoogMetadata, md)
opts = append(c.CallOptions.ListBreakpoints[0:len(c.CallOptions.ListBreakpoints):len(c.CallOptions.ListBreakpoints)], opts...)
var resp *clouddebuggerpb.ListBreakpointsResponse
err := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error {
diff --git a/debugger/apiv2/doc.go b/debugger/apiv2/doc.go
index be3202f..ac18eb8 100644
--- a/debugger/apiv2/doc.go
+++ b/debugger/apiv2/doc.go
@@ -101,4 +101,4 @@
return "UNKNOWN"
}
-const versionClient = "20190322"
+const versionClient = "20190401"
diff --git a/dialogflow/apiv2/agents_client.go b/dialogflow/apiv2/agents_client.go
index 53892b6..983f296 100644
--- a/dialogflow/apiv2/agents_client.go
+++ b/dialogflow/apiv2/agents_client.go
@@ -18,6 +18,7 @@
import (
"context"
+ "fmt"
"math"
"time"
@@ -107,30 +108,29 @@
// in your app, product, or service to determine user intent and respond to the
// user in a natural way.
//
-// After you create an agent, you can add
-// [Intents][google.cloud.dialogflow.v2.Intents],
-// [Contexts][google.cloud.dialogflow.v2.Contexts], [Entity
-// Types][google.cloud.dialogflow.v2.EntityTypes],
-// [Webhooks][google.cloud.dialogflow.v2.WebhookRequest], and so on to manage
-// the flow of a conversation and match user input to predefined intents and
-// actions.
+// After you create an agent, you can add [Intents][google.cloud.dialogflow.v2.Intents], [Contexts][google.cloud.dialogflow.v2.Contexts],
+// [Entity Types][google.cloud.dialogflow.v2.EntityTypes], [Webhooks][google.cloud.dialogflow.v2.WebhookRequest], and so on to
+// manage the flow of a conversation and match user input to predefined intents
+// and actions.
//
// You can create an agent using both Dialogflow Standard Edition and
// Dialogflow Enterprise Edition. For details, see
-// Dialogflow Editions (at /dialogflow-enterprise/docs/editions).
+// Dialogflow
+// Editions (at https://cloud.google.com/dialogflow-enterprise/docs/editions).
//
// You can save your agent for backup or versioning by exporting the agent by
-// using the [ExportAgent][google.cloud.dialogflow.v2.Agents.ExportAgent]
-// method. You can import a saved agent by using the
-// [ImportAgent][google.cloud.dialogflow.v2.Agents.ImportAgent] method.
+// using the [ExportAgent][google.cloud.dialogflow.v2.Agents.ExportAgent] method. You can import a saved
+// agent by using the [ImportAgent][google.cloud.dialogflow.v2.Agents.ImportAgent] method.
//
// Dialogflow provides several
-// prebuilt agents (at https://dialogflow.com/docs/prebuilt-agents) for common
-// conversation scenarios such as determining a date and time, converting
-// currency, and so on.
+// prebuilt
+// agents (at https://cloud.google.com/dialogflow-enterprise/docs/agents-prebuilt)
+// for common conversation scenarios such as determining a date and time,
+// converting currency, and so on.
//
// For more information about agents, see the
-// Dialogflow documentation (at https://dialogflow.com/docs/agents).
+// Dialogflow
+// documentation (at https://cloud.google.com/dialogflow-enterprise/docs/agents-overview).
func NewAgentsClient(ctx context.Context, opts ...option.ClientOption) (*AgentsClient, error) {
conn, err := transport.DialGRPC(ctx, append(defaultAgentsClientOptions(), opts...)...)
if err != nil {
@@ -179,7 +179,8 @@
// GetAgent retrieves the specified agent.
func (c *AgentsClient) GetAgent(ctx context.Context, req *dialogflowpb.GetAgentRequest, opts ...gax.CallOption) (*dialogflowpb.Agent, error) {
- ctx = insertMetadata(ctx, c.xGoogMetadata)
+ md := metadata.Pairs("x-goog-request-params", fmt.Sprintf("%s=%v", "parent", req.GetParent()))
+ ctx = insertMetadata(ctx, c.xGoogMetadata, md)
opts = append(c.CallOptions.GetAgent[0:len(c.CallOptions.GetAgent):len(c.CallOptions.GetAgent)], opts...)
var resp *dialogflowpb.Agent
err := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error {
@@ -201,7 +202,8 @@
// Refer to List
// Sub-Collections (at https://cloud.google.com/apis/design/design_patterns#list_sub-collections).
func (c *AgentsClient) SearchAgents(ctx context.Context, req *dialogflowpb.SearchAgentsRequest, opts ...gax.CallOption) *AgentIterator {
- ctx = insertMetadata(ctx, c.xGoogMetadata)
+ md := metadata.Pairs("x-goog-request-params", fmt.Sprintf("%s=%v", "parent", req.GetParent()))
+ ctx = insertMetadata(ctx, c.xGoogMetadata, md)
opts = append(c.CallOptions.SearchAgents[0:len(c.CallOptions.SearchAgents):len(c.CallOptions.SearchAgents)], opts...)
it := &AgentIterator{}
req = proto.Clone(req).(*dialogflowpb.SearchAgentsRequest)
@@ -238,10 +240,10 @@
// TrainAgent trains the specified agent.
//
-// Operation <response: [google.protobuf.Empty][google.protobuf.Empty],
-// metadata: [google.protobuf.Struct][google.protobuf.Struct]>
+// Operation <response: [google.protobuf.Empty][google.protobuf.Empty]>
func (c *AgentsClient) TrainAgent(ctx context.Context, req *dialogflowpb.TrainAgentRequest, opts ...gax.CallOption) (*TrainAgentOperation, error) {
- ctx = insertMetadata(ctx, c.xGoogMetadata)
+ md := metadata.Pairs("x-goog-request-params", fmt.Sprintf("%s=%v", "parent", req.GetParent()))
+ ctx = insertMetadata(ctx, c.xGoogMetadata, md)
opts = append(c.CallOptions.TrainAgent[0:len(c.CallOptions.TrainAgent):len(c.CallOptions.TrainAgent)], opts...)
var resp *longrunningpb.Operation
err := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error {
@@ -259,11 +261,10 @@
// ExportAgent exports the specified agent to a ZIP file.
//
-// Operation <response:
-// [ExportAgentResponse][google.cloud.dialogflow.v2.ExportAgentResponse],
-// metadata: [google.protobuf.Struct][google.protobuf.Struct]>
+// Operation <response: [ExportAgentResponse][google.cloud.dialogflow.v2.ExportAgentResponse]>
func (c *AgentsClient) ExportAgent(ctx context.Context, req *dialogflowpb.ExportAgentRequest, opts ...gax.CallOption) (*ExportAgentOperation, error) {
- ctx = insertMetadata(ctx, c.xGoogMetadata)
+ md := metadata.Pairs("x-goog-request-params", fmt.Sprintf("%s=%v", "parent", req.GetParent()))
+ ctx = insertMetadata(ctx, c.xGoogMetadata, md)
opts = append(c.CallOptions.ExportAgent[0:len(c.CallOptions.ExportAgent):len(c.CallOptions.ExportAgent)], opts...)
var resp *longrunningpb.Operation
err := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error {
@@ -285,10 +286,10 @@
// Intents and entity types with the same name are replaced with the new
// versions from ImportAgentRequest.
//
-// Operation <response: [google.protobuf.Empty][google.protobuf.Empty],
-// metadata: [google.protobuf.Struct][google.protobuf.Struct]>
+// Operation <response: [google.protobuf.Empty][google.protobuf.Empty]>
func (c *AgentsClient) ImportAgent(ctx context.Context, req *dialogflowpb.ImportAgentRequest, opts ...gax.CallOption) (*ImportAgentOperation, error) {
- ctx = insertMetadata(ctx, c.xGoogMetadata)
+ md := metadata.Pairs("x-goog-request-params", fmt.Sprintf("%s=%v", "parent", req.GetParent()))
+ ctx = insertMetadata(ctx, c.xGoogMetadata, md)
opts = append(c.CallOptions.ImportAgent[0:len(c.CallOptions.ImportAgent):len(c.CallOptions.ImportAgent)], opts...)
var resp *longrunningpb.Operation
err := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error {
@@ -309,10 +310,10 @@
// Replaces the current agent version with a new one. All the intents and
// entity types in the older version are deleted.
//
-// Operation <response: [google.protobuf.Empty][google.protobuf.Empty],
-// metadata: [google.protobuf.Struct][google.protobuf.Struct]>
+// Operation <response: [google.protobuf.Empty][google.protobuf.Empty]>
func (c *AgentsClient) RestoreAgent(ctx context.Context, req *dialogflowpb.RestoreAgentRequest, opts ...gax.CallOption) (*RestoreAgentOperation, error) {
- ctx = insertMetadata(ctx, c.xGoogMetadata)
+ md := metadata.Pairs("x-goog-request-params", fmt.Sprintf("%s=%v", "parent", req.GetParent()))
+ ctx = insertMetadata(ctx, c.xGoogMetadata, md)
opts = append(c.CallOptions.RestoreAgent[0:len(c.CallOptions.RestoreAgent):len(c.CallOptions.RestoreAgent)], opts...)
var resp *longrunningpb.Operation
err := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error {
diff --git a/dialogflow/apiv2/contexts_client.go b/dialogflow/apiv2/contexts_client.go
index 7620ddb..28f3f8c 100644
--- a/dialogflow/apiv2/contexts_client.go
+++ b/dialogflow/apiv2/contexts_client.go
@@ -18,6 +18,7 @@
import (
"context"
+ "fmt"
"math"
"time"
@@ -102,14 +103,15 @@
//
// You can include contexts as input parameters of a
// [DetectIntent][google.cloud.dialogflow.v2.Sessions.DetectIntent] (or
-// [StreamingDetectIntent][google.cloud.dialogflow.v2.Sessions.StreamingDetectIntent])
-// request, or as output contexts included in the returned intent. Contexts
-// expire when an intent is matched, after the number of DetectIntent requests
-// specified by the lifespan_count parameter, or after 10 minutes if no
-// intents are matched for a DetectIntent request.
+// [StreamingDetectIntent][google.cloud.dialogflow.v2.Sessions.StreamingDetectIntent]) request,
+// or as output contexts included in the returned intent.
+// Contexts expire when an intent is matched, after the number of DetectIntent
+// requests specified by the lifespan_count parameter, or after 20 minutes
+// if no intents are matched for a DetectIntent request.
//
// For more information about contexts, see the
-// Dialogflow documentation (at https://dialogflow.com/docs/contexts).
+// Dialogflow
+// documentation (at https://cloud.google.com/dialogflow-enterprise/docs/contexts-overview).
func NewContextsClient(ctx context.Context, opts ...option.ClientOption) (*ContextsClient, error) {
conn, err := transport.DialGRPC(ctx, append(defaultContextsClientOptions(), opts...)...)
if err != nil {
@@ -147,7 +149,8 @@
// ListContexts returns the list of all contexts in the specified session.
func (c *ContextsClient) ListContexts(ctx context.Context, req *dialogflowpb.ListContextsRequest, opts ...gax.CallOption) *ContextIterator {
- ctx = insertMetadata(ctx, c.xGoogMetadata)
+ md := metadata.Pairs("x-goog-request-params", fmt.Sprintf("%s=%v", "parent", req.GetParent()))
+ ctx = insertMetadata(ctx, c.xGoogMetadata, md)
opts = append(c.CallOptions.ListContexts[0:len(c.CallOptions.ListContexts):len(c.CallOptions.ListContexts)], opts...)
it := &ContextIterator{}
req = proto.Clone(req).(*dialogflowpb.ListContextsRequest)
@@ -184,7 +187,8 @@
// GetContext retrieves the specified context.
func (c *ContextsClient) GetContext(ctx context.Context, req *dialogflowpb.GetContextRequest, opts ...gax.CallOption) (*dialogflowpb.Context, error) {
- ctx = insertMetadata(ctx, c.xGoogMetadata)
+ md := metadata.Pairs("x-goog-request-params", fmt.Sprintf("%s=%v", "name", req.GetName()))
+ ctx = insertMetadata(ctx, c.xGoogMetadata, md)
opts = append(c.CallOptions.GetContext[0:len(c.CallOptions.GetContext):len(c.CallOptions.GetContext)], opts...)
var resp *dialogflowpb.Context
err := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error {
@@ -199,8 +203,11 @@
}
// CreateContext creates a context.
+//
+// If the specified context already exists, overrides the context.
func (c *ContextsClient) CreateContext(ctx context.Context, req *dialogflowpb.CreateContextRequest, opts ...gax.CallOption) (*dialogflowpb.Context, error) {
- ctx = insertMetadata(ctx, c.xGoogMetadata)
+ md := metadata.Pairs("x-goog-request-params", fmt.Sprintf("%s=%v", "parent", req.GetParent()))
+ ctx = insertMetadata(ctx, c.xGoogMetadata, md)
opts = append(c.CallOptions.CreateContext[0:len(c.CallOptions.CreateContext):len(c.CallOptions.CreateContext)], opts...)
var resp *dialogflowpb.Context
err := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error {
@@ -216,7 +223,8 @@
// UpdateContext updates the specified context.
func (c *ContextsClient) UpdateContext(ctx context.Context, req *dialogflowpb.UpdateContextRequest, opts ...gax.CallOption) (*dialogflowpb.Context, error) {
- ctx = insertMetadata(ctx, c.xGoogMetadata)
+ md := metadata.Pairs("x-goog-request-params", fmt.Sprintf("%s=%v", "context.name", req.GetContext().GetName()))
+ ctx = insertMetadata(ctx, c.xGoogMetadata, md)
opts = append(c.CallOptions.UpdateContext[0:len(c.CallOptions.UpdateContext):len(c.CallOptions.UpdateContext)], opts...)
var resp *dialogflowpb.Context
err := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error {
@@ -232,7 +240,8 @@
// DeleteContext deletes the specified context.
func (c *ContextsClient) DeleteContext(ctx context.Context, req *dialogflowpb.DeleteContextRequest, opts ...gax.CallOption) error {
- ctx = insertMetadata(ctx, c.xGoogMetadata)
+ md := metadata.Pairs("x-goog-request-params", fmt.Sprintf("%s=%v", "name", req.GetName()))
+ ctx = insertMetadata(ctx, c.xGoogMetadata, md)
opts = append(c.CallOptions.DeleteContext[0:len(c.CallOptions.DeleteContext):len(c.CallOptions.DeleteContext)], opts...)
err := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error {
var err error
@@ -244,7 +253,8 @@
// DeleteAllContexts deletes all active contexts in the specified session.
func (c *ContextsClient) DeleteAllContexts(ctx context.Context, req *dialogflowpb.DeleteAllContextsRequest, opts ...gax.CallOption) error {
- ctx = insertMetadata(ctx, c.xGoogMetadata)
+ md := metadata.Pairs("x-goog-request-params", fmt.Sprintf("%s=%v", "parent", req.GetParent()))
+ ctx = insertMetadata(ctx, c.xGoogMetadata, md)
opts = append(c.CallOptions.DeleteAllContexts[0:len(c.CallOptions.DeleteAllContexts):len(c.CallOptions.DeleteAllContexts)], opts...)
err := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error {
var err error
diff --git a/dialogflow/apiv2/doc.go b/dialogflow/apiv2/doc.go
index dce6016..40589fb 100644
--- a/dialogflow/apiv2/doc.go
+++ b/dialogflow/apiv2/doc.go
@@ -19,8 +19,8 @@
//
// NOTE: This package is in alpha. It is not stable, and is likely to change.
//
-// An end-to-end development suite for conversational interfaces (e.g.,
-// chatbots, voice-powered apps and devices).
+// Builds conversational interfaces (for example, chatbots, and voice-powered
+// apps and devices).
//
// Use of Context
//
@@ -58,6 +58,7 @@
func DefaultAuthScopes() []string {
return []string{
"https://www.googleapis.com/auth/cloud-platform",
+ "https://www.googleapis.com/auth/dialogflow",
}
}
@@ -98,4 +99,4 @@
return "UNKNOWN"
}
-const versionClient = "20190322"
+const versionClient = "20190401"
diff --git a/dialogflow/apiv2/entity_types_client.go b/dialogflow/apiv2/entity_types_client.go
index 9bf2355..f0860e1 100644
--- a/dialogflow/apiv2/entity_types_client.go
+++ b/dialogflow/apiv2/entity_types_client.go
@@ -18,6 +18,7 @@
import (
"context"
+ "fmt"
"math"
"time"
@@ -133,11 +134,11 @@
//
// * **User** - entities that are built for an individual user such as
// favorites, preferences, playlists, and so on. A user entity is
-// represented by the
-// [SessionEntityType][google.cloud.dialogflow.v2.SessionEntityType] type.
+// represented by the [SessionEntityType][google.cloud.dialogflow.v2.SessionEntityType] type.
//
// For more information about entity types, see the
-// [Dialogflow documentation](https://dialogflow.com/docs/entities).
+// [Dialogflow
+// documentation](https://cloud.google.com/dialogflow-enterprise/docs/entities-overview).
func NewEntityTypesClient(ctx context.Context, opts ...option.ClientOption) (*EntityTypesClient, error) {
conn, err := transport.DialGRPC(ctx, append(defaultEntityTypesClientOptions(), opts...)...)
if err != nil {
@@ -186,7 +187,8 @@
// ListEntityTypes returns the list of all entity types in the specified agent.
func (c *EntityTypesClient) ListEntityTypes(ctx context.Context, req *dialogflowpb.ListEntityTypesRequest, opts ...gax.CallOption) *EntityTypeIterator {
- ctx = insertMetadata(ctx, c.xGoogMetadata)
+ md := metadata.Pairs("x-goog-request-params", fmt.Sprintf("%s=%v", "parent", req.GetParent()))
+ ctx = insertMetadata(ctx, c.xGoogMetadata, md)
opts = append(c.CallOptions.ListEntityTypes[0:len(c.CallOptions.ListEntityTypes):len(c.CallOptions.ListEntityTypes)], opts...)
it := &EntityTypeIterator{}
req = proto.Clone(req).(*dialogflowpb.ListEntityTypesRequest)
@@ -223,7 +225,8 @@
// GetEntityType retrieves the specified entity type.
func (c *EntityTypesClient) GetEntityType(ctx context.Context, req *dialogflowpb.GetEntityTypeRequest, opts ...gax.CallOption) (*dialogflowpb.EntityType, error) {
- ctx = insertMetadata(ctx, c.xGoogMetadata)
+ md := metadata.Pairs("x-goog-request-params", fmt.Sprintf("%s=%v", "name", req.GetName()))
+ ctx = insertMetadata(ctx, c.xGoogMetadata, md)
opts = append(c.CallOptions.GetEntityType[0:len(c.CallOptions.GetEntityType):len(c.CallOptions.GetEntityType)], opts...)
var resp *dialogflowpb.EntityType
err := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error {
@@ -239,7 +242,8 @@
// CreateEntityType creates an entity type in the specified agent.
func (c *EntityTypesClient) CreateEntityType(ctx context.Context, req *dialogflowpb.CreateEntityTypeRequest, opts ...gax.CallOption) (*dialogflowpb.EntityType, error) {
- ctx = insertMetadata(ctx, c.xGoogMetadata)
+ md := metadata.Pairs("x-goog-request-params", fmt.Sprintf("%s=%v", "parent", req.GetParent()))
+ ctx = insertMetadata(ctx, c.xGoogMetadata, md)
opts = append(c.CallOptions.CreateEntityType[0:len(c.CallOptions.CreateEntityType):len(c.CallOptions.CreateEntityType)], opts...)
var resp *dialogflowpb.EntityType
err := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error {
@@ -255,7 +259,8 @@
// UpdateEntityType updates the specified entity type.
func (c *EntityTypesClient) UpdateEntityType(ctx context.Context, req *dialogflowpb.UpdateEntityTypeRequest, opts ...gax.CallOption) (*dialogflowpb.EntityType, error) {
- ctx = insertMetadata(ctx, c.xGoogMetadata)
+ md := metadata.Pairs("x-goog-request-params", fmt.Sprintf("%s=%v", "entity_type.name", req.GetEntityType().GetName()))
+ ctx = insertMetadata(ctx, c.xGoogMetadata, md)
opts = append(c.CallOptions.UpdateEntityType[0:len(c.CallOptions.UpdateEntityType):len(c.CallOptions.UpdateEntityType)], opts...)
var resp *dialogflowpb.EntityType
err := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error {
@@ -271,7 +276,8 @@
// DeleteEntityType deletes the specified entity type.
func (c *EntityTypesClient) DeleteEntityType(ctx context.Context, req *dialogflowpb.DeleteEntityTypeRequest, opts ...gax.CallOption) error {
- ctx = insertMetadata(ctx, c.xGoogMetadata)
+ md := metadata.Pairs("x-goog-request-params", fmt.Sprintf("%s=%v", "name", req.GetName()))
+ ctx = insertMetadata(ctx, c.xGoogMetadata, md)
opts = append(c.CallOptions.DeleteEntityType[0:len(c.CallOptions.DeleteEntityType):len(c.CallOptions.DeleteEntityType)], opts...)
err := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error {
var err error
@@ -283,11 +289,10 @@
// BatchUpdateEntityTypes updates/Creates multiple entity types in the specified agent.
//
-// Operation <response:
-// [BatchUpdateEntityTypesResponse][google.cloud.dialogflow.v2.BatchUpdateEntityTypesResponse],
-// metadata: [google.protobuf.Struct][google.protobuf.Struct]>
+// Operation <response: [BatchUpdateEntityTypesResponse][google.cloud.dialogflow.v2.BatchUpdateEntityTypesResponse]>
func (c *EntityTypesClient) BatchUpdateEntityTypes(ctx context.Context, req *dialogflowpb.BatchUpdateEntityTypesRequest, opts ...gax.CallOption) (*BatchUpdateEntityTypesOperation, error) {
- ctx = insertMetadata(ctx, c.xGoogMetadata)
+ md := metadata.Pairs("x-goog-request-params", fmt.Sprintf("%s=%v", "parent", req.GetParent()))
+ ctx = insertMetadata(ctx, c.xGoogMetadata, md)
opts = append(c.CallOptions.BatchUpdateEntityTypes[0:len(c.CallOptions.BatchUpdateEntityTypes):len(c.CallOptions.BatchUpdateEntityTypes)], opts...)
var resp *longrunningpb.Operation
err := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error {
@@ -305,10 +310,10 @@
// BatchDeleteEntityTypes deletes entity types in the specified agent.
//
-// Operation <response: [google.protobuf.Empty][google.protobuf.Empty],
-// metadata: [google.protobuf.Struct][google.protobuf.Struct]>
+// Operation <response: [google.protobuf.Empty][google.protobuf.Empty]>
func (c *EntityTypesClient) BatchDeleteEntityTypes(ctx context.Context, req *dialogflowpb.BatchDeleteEntityTypesRequest, opts ...gax.CallOption) (*BatchDeleteEntityTypesOperation, error) {
- ctx = insertMetadata(ctx, c.xGoogMetadata)
+ md := metadata.Pairs("x-goog-request-params", fmt.Sprintf("%s=%v", "parent", req.GetParent()))
+ ctx = insertMetadata(ctx, c.xGoogMetadata, md)
opts = append(c.CallOptions.BatchDeleteEntityTypes[0:len(c.CallOptions.BatchDeleteEntityTypes):len(c.CallOptions.BatchDeleteEntityTypes)], opts...)
var resp *longrunningpb.Operation
err := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error {
@@ -324,12 +329,12 @@
}, nil
}
-// BatchCreateEntities creates multiple new entities in the specified entity type (extends the
-// existing collection of entries).
+// BatchCreateEntities creates multiple new entities in the specified entity type.
//
// Operation <response: [google.protobuf.Empty][google.protobuf.Empty]>
func (c *EntityTypesClient) BatchCreateEntities(ctx context.Context, req *dialogflowpb.BatchCreateEntitiesRequest, opts ...gax.CallOption) (*BatchCreateEntitiesOperation, error) {
- ctx = insertMetadata(ctx, c.xGoogMetadata)
+ md := metadata.Pairs("x-goog-request-params", fmt.Sprintf("%s=%v", "parent", req.GetParent()))
+ ctx = insertMetadata(ctx, c.xGoogMetadata, md)
opts = append(c.CallOptions.BatchCreateEntities[0:len(c.CallOptions.BatchCreateEntities):len(c.CallOptions.BatchCreateEntities)], opts...)
var resp *longrunningpb.Operation
err := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error {
@@ -345,13 +350,14 @@
}, nil
}
-// BatchUpdateEntities updates entities in the specified entity type (replaces the existing
-// collection of entries).
+// BatchUpdateEntities updates or creates multiple entities in the specified entity type. This
+// method does not affect entities in the entity type that aren't explicitly
+// specified in the request.
//
-// Operation <response: [google.protobuf.Empty][google.protobuf.Empty],
-// metadata: [google.protobuf.Struct][google.protobuf.Struct]>
+// Operation <response: [google.protobuf.Empty][google.protobuf.Empty]>
func (c *EntityTypesClient) BatchUpdateEntities(ctx context.Context, req *dialogflowpb.BatchUpdateEntitiesRequest, opts ...gax.CallOption) (*BatchUpdateEntitiesOperation, error) {
- ctx = insertMetadata(ctx, c.xGoogMetadata)
+ md := metadata.Pairs("x-goog-request-params", fmt.Sprintf("%s=%v", "parent", req.GetParent()))
+ ctx = insertMetadata(ctx, c.xGoogMetadata, md)
opts = append(c.CallOptions.BatchUpdateEntities[0:len(c.CallOptions.BatchUpdateEntities):len(c.CallOptions.BatchUpdateEntities)], opts...)
var resp *longrunningpb.Operation
err := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error {
@@ -369,10 +375,10 @@
// BatchDeleteEntities deletes entities in the specified entity type.
//
-// Operation <response: [google.protobuf.Empty][google.protobuf.Empty],
-// metadata: [google.protobuf.Struct][google.protobuf.Struct]>
+// Operation <response: [google.protobuf.Empty][google.protobuf.Empty]>
func (c *EntityTypesClient) BatchDeleteEntities(ctx context.Context, req *dialogflowpb.BatchDeleteEntitiesRequest, opts ...gax.CallOption) (*BatchDeleteEntitiesOperation, error) {
- ctx = insertMetadata(ctx, c.xGoogMetadata)
+ md := metadata.Pairs("x-goog-request-params", fmt.Sprintf("%s=%v", "parent", req.GetParent()))
+ ctx = insertMetadata(ctx, c.xGoogMetadata, md)
opts = append(c.CallOptions.BatchDeleteEntities[0:len(c.CallOptions.BatchDeleteEntities):len(c.CallOptions.BatchDeleteEntities)], opts...)
var resp *longrunningpb.Operation
err := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error {
diff --git a/dialogflow/apiv2/intents_client.go b/dialogflow/apiv2/intents_client.go
index 91842e9..04fde31 100644
--- a/dialogflow/apiv2/intents_client.go
+++ b/dialogflow/apiv2/intents_client.go
@@ -18,6 +18,7 @@
import (
"context"
+ "fmt"
"math"
"time"
@@ -107,10 +108,10 @@
// An intent represents a mapping between input from a user and an action to
// be taken by your application. When you pass user input to the
// [DetectIntent][google.cloud.dialogflow.v2.Sessions.DetectIntent] (or
-// [StreamingDetectIntent][google.cloud.dialogflow.v2.Sessions.StreamingDetectIntent])
-// method, the Dialogflow API analyzes the input and searches for a matching
-// intent. If no match is found, the Dialogflow API returns a fallback intent
-// (`is_fallback` = true).
+// [StreamingDetectIntent][google.cloud.dialogflow.v2.Sessions.StreamingDetectIntent]) method, the
+// Dialogflow API analyzes the input and searches
+// for a matching intent. If no match is found, the Dialogflow API returns a
+// fallback intent (`is_fallback` = true).
//
// You can provide additional information for the Dialogflow API to use to
// match user input to an intent by adding the following to your intent.
@@ -118,7 +119,7 @@
// * **Contexts** - provide additional context for intent analysis. For
// example, if an intent is related to an object in your application that
// plays music, you can provide a context to determine when to match the
-// intent if the user input is “turn it off”. You can include a context
+// intent if the user input is "turn it off". You can include a context
// that matches the intent when there is previous user input of
// "play music", and not when there is previous user input of
// "turn on the light".
@@ -134,7 +135,8 @@
// Dialogflow API agent to better match intents.
//
// For more information about intents, see the
-// [Dialogflow documentation](https://dialogflow.com/docs/intents).
+// [Dialogflow
+// documentation](https://cloud.google.com/dialogflow-enterprise/docs/intents-overview).
func NewIntentsClient(ctx context.Context, opts ...option.ClientOption) (*IntentsClient, error) {
conn, err := transport.DialGRPC(ctx, append(defaultIntentsClientOptions(), opts...)...)
if err != nil {
@@ -183,7 +185,8 @@
// ListIntents returns the list of all intents in the specified agent.
func (c *IntentsClient) ListIntents(ctx context.Context, req *dialogflowpb.ListIntentsRequest, opts ...gax.CallOption) *IntentIterator {
- ctx = insertMetadata(ctx, c.xGoogMetadata)
+ md := metadata.Pairs("x-goog-request-params", fmt.Sprintf("%s=%v", "parent", req.GetParent()))
+ ctx = insertMetadata(ctx, c.xGoogMetadata, md)
opts = append(c.CallOptions.ListIntents[0:len(c.CallOptions.ListIntents):len(c.CallOptions.ListIntents)], opts...)
it := &IntentIterator{}
req = proto.Clone(req).(*dialogflowpb.ListIntentsRequest)
@@ -220,7 +223,8 @@
// GetIntent retrieves the specified intent.
func (c *IntentsClient) GetIntent(ctx context.Context, req *dialogflowpb.GetIntentRequest, opts ...gax.CallOption) (*dialogflowpb.Intent, error) {
- ctx = insertMetadata(ctx, c.xGoogMetadata)
+ md := metadata.Pairs("x-goog-request-params", fmt.Sprintf("%s=%v", "name", req.GetName()))
+ ctx = insertMetadata(ctx, c.xGoogMetadata, md)
opts = append(c.CallOptions.GetIntent[0:len(c.CallOptions.GetIntent):len(c.CallOptions.GetIntent)], opts...)
var resp *dialogflowpb.Intent
err := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error {
@@ -236,7 +240,8 @@
// CreateIntent creates an intent in the specified agent.
func (c *IntentsClient) CreateIntent(ctx context.Context, req *dialogflowpb.CreateIntentRequest, opts ...gax.CallOption) (*dialogflowpb.Intent, error) {
- ctx = insertMetadata(ctx, c.xGoogMetadata)
+ md := metadata.Pairs("x-goog-request-params", fmt.Sprintf("%s=%v", "parent", req.GetParent()))
+ ctx = insertMetadata(ctx, c.xGoogMetadata, md)
opts = append(c.CallOptions.CreateIntent[0:len(c.CallOptions.CreateIntent):len(c.CallOptions.CreateIntent)], opts...)
var resp *dialogflowpb.Intent
err := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error {
@@ -252,7 +257,8 @@
// UpdateIntent updates the specified intent.
func (c *IntentsClient) UpdateIntent(ctx context.Context, req *dialogflowpb.UpdateIntentRequest, opts ...gax.CallOption) (*dialogflowpb.Intent, error) {
- ctx = insertMetadata(ctx, c.xGoogMetadata)
+ md := metadata.Pairs("x-goog-request-params", fmt.Sprintf("%s=%v", "intent.name", req.GetIntent().GetName()))
+ ctx = insertMetadata(ctx, c.xGoogMetadata, md)
opts = append(c.CallOptions.UpdateIntent[0:len(c.CallOptions.UpdateIntent):len(c.CallOptions.UpdateIntent)], opts...)
var resp *dialogflowpb.Intent
err := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error {
@@ -266,9 +272,10 @@
return resp, nil
}
-// DeleteIntent deletes the specified intent.
+// DeleteIntent deletes the specified intent and its direct or indirect followup intents.
func (c *IntentsClient) DeleteIntent(ctx context.Context, req *dialogflowpb.DeleteIntentRequest, opts ...gax.CallOption) error {
- ctx = insertMetadata(ctx, c.xGoogMetadata)
+ md := metadata.Pairs("x-goog-request-params", fmt.Sprintf("%s=%v", "name", req.GetName()))
+ ctx = insertMetadata(ctx, c.xGoogMetadata, md)
opts = append(c.CallOptions.DeleteIntent[0:len(c.CallOptions.DeleteIntent):len(c.CallOptions.DeleteIntent)], opts...)
err := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error {
var err error
@@ -280,10 +287,10 @@
// BatchUpdateIntents updates/Creates multiple intents in the specified agent.
//
-// Operation <response:
-// [BatchUpdateIntentsResponse][google.cloud.dialogflow.v2.BatchUpdateIntentsResponse]>
+// Operation <response: [BatchUpdateIntentsResponse][google.cloud.dialogflow.v2.BatchUpdateIntentsResponse]>
func (c *IntentsClient) BatchUpdateIntents(ctx context.Context, req *dialogflowpb.BatchUpdateIntentsRequest, opts ...gax.CallOption) (*BatchUpdateIntentsOperation, error) {
- ctx = insertMetadata(ctx, c.xGoogMetadata)
+ md := metadata.Pairs("x-goog-request-params", fmt.Sprintf("%s=%v", "parent", req.GetParent()))
+ ctx = insertMetadata(ctx, c.xGoogMetadata, md)
opts = append(c.CallOptions.BatchUpdateIntents[0:len(c.CallOptions.BatchUpdateIntents):len(c.CallOptions.BatchUpdateIntents)], opts...)
var resp *longrunningpb.Operation
err := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error {
@@ -303,7 +310,8 @@
//
// Operation <response: [google.protobuf.Empty][google.protobuf.Empty]>
func (c *IntentsClient) BatchDeleteIntents(ctx context.Context, req *dialogflowpb.BatchDeleteIntentsRequest, opts ...gax.CallOption) (*BatchDeleteIntentsOperation, error) {
- ctx = insertMetadata(ctx, c.xGoogMetadata)
+ md := metadata.Pairs("x-goog-request-params", fmt.Sprintf("%s=%v", "parent", req.GetParent()))
+ ctx = insertMetadata(ctx, c.xGoogMetadata, md)
opts = append(c.CallOptions.BatchDeleteIntents[0:len(c.CallOptions.BatchDeleteIntents):len(c.CallOptions.BatchDeleteIntents)], opts...)
var resp *longrunningpb.Operation
err := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error {
diff --git a/dialogflow/apiv2/mock_test.go b/dialogflow/apiv2/mock_test.go
index 35be9eb..9f2c5ac 100644
--- a/dialogflow/apiv2/mock_test.go
+++ b/dialogflow/apiv2/mock_test.go
@@ -3003,8 +3003,10 @@
}
func TestSessionsDetectIntent(t *testing.T) {
var responseId string = "responseId1847552473"
+ var outputAudio []byte = []byte("24")
var expectedResponse = &dialogflowpb.DetectIntentResponse{
- ResponseId: responseId,
+ ResponseId: responseId,
+ OutputAudio: outputAudio,
}
mockSessions.err = nil
@@ -3066,8 +3068,10 @@
}
func TestSessionsStreamingDetectIntent(t *testing.T) {
var responseId string = "responseId1847552473"
+ var outputAudio []byte = []byte("24")
var expectedResponse = &dialogflowpb.StreamingDetectIntentResponse{
- ResponseId: responseId,
+ ResponseId: responseId,
+ OutputAudio: outputAudio,
}
mockSessions.err = nil
diff --git a/dialogflow/apiv2/session_entity_types_client.go b/dialogflow/apiv2/session_entity_types_client.go
index b5f188d..397aba8 100644
--- a/dialogflow/apiv2/session_entity_types_client.go
+++ b/dialogflow/apiv2/session_entity_types_client.go
@@ -18,6 +18,7 @@
import (
"context"
+ "fmt"
"math"
"time"
@@ -102,7 +103,8 @@
// entity type at the session level.
//
// For more information about entity types, see the
-// [Dialogflow documentation](https://dialogflow.com/docs/entities).
+// [Dialogflow
+// documentation](https://cloud.google.com/dialogflow-enterprise/docs/entities-overview).
func NewSessionEntityTypesClient(ctx context.Context, opts ...option.ClientOption) (*SessionEntityTypesClient, error) {
conn, err := transport.DialGRPC(ctx, append(defaultSessionEntityTypesClientOptions(), opts...)...)
if err != nil {
@@ -140,7 +142,8 @@
// ListSessionEntityTypes returns the list of all session entity types in the specified session.
func (c *SessionEntityTypesClient) ListSessionEntityTypes(ctx context.Context, req *dialogflowpb.ListSessionEntityTypesRequest, opts ...gax.CallOption) *SessionEntityTypeIterator {
- ctx = insertMetadata(ctx, c.xGoogMetadata)
+ md := metadata.Pairs("x-goog-request-params", fmt.Sprintf("%s=%v", "parent", req.GetParent()))
+ ctx = insertMetadata(ctx, c.xGoogMetadata, md)
opts = append(c.CallOptions.ListSessionEntityTypes[0:len(c.CallOptions.ListSessionEntityTypes):len(c.CallOptions.ListSessionEntityTypes)], opts...)
it := &SessionEntityTypeIterator{}
req = proto.Clone(req).(*dialogflowpb.ListSessionEntityTypesRequest)
@@ -177,7 +180,8 @@
// GetSessionEntityType retrieves the specified session entity type.
func (c *SessionEntityTypesClient) GetSessionEntityType(ctx context.Context, req *dialogflowpb.GetSessionEntityTypeRequest, opts ...gax.CallOption) (*dialogflowpb.SessionEntityType, error) {
- ctx = insertMetadata(ctx, c.xGoogMetadata)
+ md := metadata.Pairs("x-goog-request-params", fmt.Sprintf("%s=%v", "name", req.GetName()))
+ ctx = insertMetadata(ctx, c.xGoogMetadata, md)
opts = append(c.CallOptions.GetSessionEntityType[0:len(c.CallOptions.GetSessionEntityType):len(c.CallOptions.GetSessionEntityType)], opts...)
var resp *dialogflowpb.SessionEntityType
err := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error {
@@ -192,8 +196,12 @@
}
// CreateSessionEntityType creates a session entity type.
+//
+// If the specified session entity type already exists, overrides the session
+// entity type.
func (c *SessionEntityTypesClient) CreateSessionEntityType(ctx context.Context, req *dialogflowpb.CreateSessionEntityTypeRequest, opts ...gax.CallOption) (*dialogflowpb.SessionEntityType, error) {
- ctx = insertMetadata(ctx, c.xGoogMetadata)
+ md := metadata.Pairs("x-goog-request-params", fmt.Sprintf("%s=%v", "parent", req.GetParent()))
+ ctx = insertMetadata(ctx, c.xGoogMetadata, md)
opts = append(c.CallOptions.CreateSessionEntityType[0:len(c.CallOptions.CreateSessionEntityType):len(c.CallOptions.CreateSessionEntityType)], opts...)
var resp *dialogflowpb.SessionEntityType
err := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error {
@@ -209,7 +217,8 @@
// UpdateSessionEntityType updates the specified session entity type.
func (c *SessionEntityTypesClient) UpdateSessionEntityType(ctx context.Context, req *dialogflowpb.UpdateSessionEntityTypeRequest, opts ...gax.CallOption) (*dialogflowpb.SessionEntityType, error) {
- ctx = insertMetadata(ctx, c.xGoogMetadata)
+ md := metadata.Pairs("x-goog-request-params", fmt.Sprintf("%s=%v", "session_entity_type.name", req.GetSessionEntityType().GetName()))
+ ctx = insertMetadata(ctx, c.xGoogMetadata, md)
opts = append(c.CallOptions.UpdateSessionEntityType[0:len(c.CallOptions.UpdateSessionEntityType):len(c.CallOptions.UpdateSessionEntityType)], opts...)
var resp *dialogflowpb.SessionEntityType
err := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error {
@@ -225,7 +234,8 @@
// DeleteSessionEntityType deletes the specified session entity type.
func (c *SessionEntityTypesClient) DeleteSessionEntityType(ctx context.Context, req *dialogflowpb.DeleteSessionEntityTypeRequest, opts ...gax.CallOption) error {
- ctx = insertMetadata(ctx, c.xGoogMetadata)
+ md := metadata.Pairs("x-goog-request-params", fmt.Sprintf("%s=%v", "name", req.GetName()))
+ ctx = insertMetadata(ctx, c.xGoogMetadata, md)
opts = append(c.CallOptions.DeleteSessionEntityType[0:len(c.CallOptions.DeleteSessionEntityType):len(c.CallOptions.DeleteSessionEntityType)], opts...)
err := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error {
var err error
diff --git a/dialogflow/apiv2/sessions_client.go b/dialogflow/apiv2/sessions_client.go
index c13d6be..92c9fb9 100644
--- a/dialogflow/apiv2/sessions_client.go
+++ b/dialogflow/apiv2/sessions_client.go
@@ -18,6 +18,7 @@
import (
"context"
+ "fmt"
gax "github.com/googleapis/gax-go/v2"
"google.golang.org/api/option"
@@ -68,10 +69,9 @@
// NewSessionsClient creates a new sessions client.
//
// A session represents an interaction with a user. You retrieve user input
-// and pass it to the
-// [DetectIntent][google.cloud.dialogflow.v2.Sessions.DetectIntent] (or
-// [StreamingDetectIntent][google.cloud.dialogflow.v2.Sessions.StreamingDetectIntent])
-// method to determine user intent and respond.
+// and pass it to the [DetectIntent][google.cloud.dialogflow.v2.Sessions.DetectIntent] (or
+// [StreamingDetectIntent][google.cloud.dialogflow.v2.Sessions.StreamingDetectIntent]) method to determine
+// user intent and respond.
func NewSessionsClient(ctx context.Context, opts ...option.ClientOption) (*SessionsClient, error) {
conn, err := transport.DialGRPC(ctx, append(defaultSessionsClientOptions(), opts...)...)
if err != nil {
@@ -112,7 +112,8 @@
// and session entity types to be updated, which in turn might affect
// results of future queries.
func (c *SessionsClient) DetectIntent(ctx context.Context, req *dialogflowpb.DetectIntentRequest, opts ...gax.CallOption) (*dialogflowpb.DetectIntentResponse, error) {
- ctx = insertMetadata(ctx, c.xGoogMetadata)
+ md := metadata.Pairs("x-goog-request-params", fmt.Sprintf("%s=%v", "session", req.GetSession()))
+ ctx = insertMetadata(ctx, c.xGoogMetadata, md)
opts = append(c.CallOptions.DetectIntent[0:len(c.CallOptions.DetectIntent):len(c.CallOptions.DetectIntent)], opts...)
var resp *dialogflowpb.DetectIntentResponse
err := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error {
diff --git a/dlp/apiv2/dlp_client.go b/dlp/apiv2/dlp_client.go
index febf7df..0f02256 100644
--- a/dlp/apiv2/dlp_client.go
+++ b/dlp/apiv2/dlp_client.go
@@ -18,6 +18,7 @@
import (
"context"
+ "fmt"
"math"
"time"
@@ -195,7 +196,8 @@
// For how to guides, see https://cloud.google.com/dlp/docs/inspecting-images
// and https://cloud.google.com/dlp/docs/inspecting-text,
func (c *Client) InspectContent(ctx context.Context, req *dlppb.InspectContentRequest, opts ...gax.CallOption) (*dlppb.InspectContentResponse, error) {
- ctx = insertMetadata(ctx, c.xGoogMetadata)
+ md := metadata.Pairs("x-goog-request-params", fmt.Sprintf("%s=%v", "parent", req.GetParent()))
+ ctx = insertMetadata(ctx, c.xGoogMetadata, md)
opts = append(c.CallOptions.InspectContent[0:len(c.CallOptions.InspectContent):len(c.CallOptions.InspectContent)], opts...)
var resp *dlppb.InspectContentResponse
err := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error {
@@ -218,7 +220,8 @@
// system will automatically choose what detectors to run. By default this may
// be all types, but may change over time as detectors are updated.
func (c *Client) RedactImage(ctx context.Context, req *dlppb.RedactImageRequest, opts ...gax.CallOption) (*dlppb.RedactImageResponse, error) {
- ctx = insertMetadata(ctx, c.xGoogMetadata)
+ md := metadata.Pairs("x-goog-request-params", fmt.Sprintf("%s=%v", "parent", req.GetParent()))
+ ctx = insertMetadata(ctx, c.xGoogMetadata, md)
opts = append(c.CallOptions.RedactImage[0:len(c.CallOptions.RedactImage):len(c.CallOptions.RedactImage)], opts...)
var resp *dlppb.RedactImageResponse
err := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error {
@@ -241,7 +244,8 @@
// system will automatically choose what detectors to run. By default this may
// be all types, but may change over time as detectors are updated.
func (c *Client) DeidentifyContent(ctx context.Context, req *dlppb.DeidentifyContentRequest, opts ...gax.CallOption) (*dlppb.DeidentifyContentResponse, error) {
- ctx = insertMetadata(ctx, c.xGoogMetadata)
+ md := metadata.Pairs("x-goog-request-params", fmt.Sprintf("%s=%v", "parent", req.GetParent()))
+ ctx = insertMetadata(ctx, c.xGoogMetadata, md)
opts = append(c.CallOptions.DeidentifyContent[0:len(c.CallOptions.DeidentifyContent):len(c.CallOptions.DeidentifyContent)], opts...)
var resp *dlppb.DeidentifyContentResponse
err := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error {
@@ -260,7 +264,8 @@
// https://cloud.google.com/dlp/docs/pseudonymization#re-identification_in_free_text_code_example
// to learn more.
func (c *Client) ReidentifyContent(ctx context.Context, req *dlppb.ReidentifyContentRequest, opts ...gax.CallOption) (*dlppb.ReidentifyContentResponse, error) {
- ctx = insertMetadata(ctx, c.xGoogMetadata)
+ md := metadata.Pairs("x-goog-request-params", fmt.Sprintf("%s=%v", "parent", req.GetParent()))
+ ctx = insertMetadata(ctx, c.xGoogMetadata, md)
opts = append(c.CallOptions.ReidentifyContent[0:len(c.CallOptions.ReidentifyContent):len(c.CallOptions.ReidentifyContent)], opts...)
var resp *dlppb.ReidentifyContentResponse
err := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error {
@@ -296,7 +301,8 @@
// for inspecting content, images, and storage.
// See https://cloud.google.com/dlp/docs/creating-templates to learn more.
func (c *Client) CreateInspectTemplate(ctx context.Context, req *dlppb.CreateInspectTemplateRequest, opts ...gax.CallOption) (*dlppb.InspectTemplate, error) {
- ctx = insertMetadata(ctx, c.xGoogMetadata)
+ md := metadata.Pairs("x-goog-request-params", fmt.Sprintf("%s=%v", "parent", req.GetParent()))
+ ctx = insertMetadata(ctx, c.xGoogMetadata, md)
opts = append(c.CallOptions.CreateInspectTemplate[0:len(c.CallOptions.CreateInspectTemplate):len(c.CallOptions.CreateInspectTemplate)], opts...)
var resp *dlppb.InspectTemplate
err := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error {
@@ -313,7 +319,8 @@
// UpdateInspectTemplate updates the InspectTemplate.
// See https://cloud.google.com/dlp/docs/creating-templates to learn more.
func (c *Client) UpdateInspectTemplate(ctx context.Context, req *dlppb.UpdateInspectTemplateRequest, opts ...gax.CallOption) (*dlppb.InspectTemplate, error) {
- ctx = insertMetadata(ctx, c.xGoogMetadata)
+ md := metadata.Pairs("x-goog-request-params", fmt.Sprintf("%s=%v", "name", req.GetName()))
+ ctx = insertMetadata(ctx, c.xGoogMetadata, md)
opts = append(c.CallOptions.UpdateInspectTemplate[0:len(c.CallOptions.UpdateInspectTemplate):len(c.CallOptions.UpdateInspectTemplate)], opts...)
var resp *dlppb.InspectTemplate
err := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error {
@@ -330,7 +337,8 @@
// GetInspectTemplate gets an InspectTemplate.
// See https://cloud.google.com/dlp/docs/creating-templates to learn more.
func (c *Client) GetInspectTemplate(ctx context.Context, req *dlppb.GetInspectTemplateRequest, opts ...gax.CallOption) (*dlppb.InspectTemplate, error) {
- ctx = insertMetadata(ctx, c.xGoogMetadata)
+ md := metadata.Pairs("x-goog-request-params", fmt.Sprintf("%s=%v", "name", req.GetName()))
+ ctx = insertMetadata(ctx, c.xGoogMetadata, md)
opts = append(c.CallOptions.GetInspectTemplate[0:len(c.CallOptions.GetInspectTemplate):len(c.CallOptions.GetInspectTemplate)], opts...)
var resp *dlppb.InspectTemplate
err := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error {
@@ -347,7 +355,8 @@
// ListInspectTemplates lists InspectTemplates.
// See https://cloud.google.com/dlp/docs/creating-templates to learn more.
func (c *Client) ListInspectTemplates(ctx context.Context, req *dlppb.ListInspectTemplatesRequest, opts ...gax.CallOption) *InspectTemplateIterator {
- ctx = insertMetadata(ctx, c.xGoogMetadata)
+ md := metadata.Pairs("x-goog-request-params", fmt.Sprintf("%s=%v", "parent", req.GetParent()))
+ ctx = insertMetadata(ctx, c.xGoogMetadata, md)
opts = append(c.CallOptions.ListInspectTemplates[0:len(c.CallOptions.ListInspectTemplates):len(c.CallOptions.ListInspectTemplates)], opts...)
it := &InspectTemplateIterator{}
req = proto.Clone(req).(*dlppb.ListInspectTemplatesRequest)
@@ -385,7 +394,8 @@
// DeleteInspectTemplate deletes an InspectTemplate.
// See https://cloud.google.com/dlp/docs/creating-templates to learn more.
func (c *Client) DeleteInspectTemplate(ctx context.Context, req *dlppb.DeleteInspectTemplateRequest, opts ...gax.CallOption) error {
- ctx = insertMetadata(ctx, c.xGoogMetadata)
+ md := metadata.Pairs("x-goog-request-params", fmt.Sprintf("%s=%v", "name", req.GetName()))
+ ctx = insertMetadata(ctx, c.xGoogMetadata, md)
opts = append(c.CallOptions.DeleteInspectTemplate[0:len(c.CallOptions.DeleteInspectTemplate):len(c.CallOptions.DeleteInspectTemplate)], opts...)
err := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error {
var err error
@@ -400,7 +410,8 @@
// See https://cloud.google.com/dlp/docs/creating-templates-deid to learn
// more.
func (c *Client) CreateDeidentifyTemplate(ctx context.Context, req *dlppb.CreateDeidentifyTemplateRequest, opts ...gax.CallOption) (*dlppb.DeidentifyTemplate, error) {
- ctx = insertMetadata(ctx, c.xGoogMetadata)
+ md := metadata.Pairs("x-goog-request-params", fmt.Sprintf("%s=%v", "parent", req.GetParent()))
+ ctx = insertMetadata(ctx, c.xGoogMetadata, md)
opts = append(c.CallOptions.CreateDeidentifyTemplate[0:len(c.CallOptions.CreateDeidentifyTemplate):len(c.CallOptions.CreateDeidentifyTemplate)], opts...)
var resp *dlppb.DeidentifyTemplate
err := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error {
@@ -418,7 +429,8 @@
// See https://cloud.google.com/dlp/docs/creating-templates-deid to learn
// more.
func (c *Client) UpdateDeidentifyTemplate(ctx context.Context, req *dlppb.UpdateDeidentifyTemplateRequest, opts ...gax.CallOption) (*dlppb.DeidentifyTemplate, error) {
- ctx = insertMetadata(ctx, c.xGoogMetadata)
+ md := metadata.Pairs("x-goog-request-params", fmt.Sprintf("%s=%v", "name", req.GetName()))
+ ctx = insertMetadata(ctx, c.xGoogMetadata, md)
opts = append(c.CallOptions.UpdateDeidentifyTemplate[0:len(c.CallOptions.UpdateDeidentifyTemplate):len(c.CallOptions.UpdateDeidentifyTemplate)], opts...)
var resp *dlppb.DeidentifyTemplate
err := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error {
@@ -436,7 +448,8 @@
// See https://cloud.google.com/dlp/docs/creating-templates-deid to learn
// more.
func (c *Client) GetDeidentifyTemplate(ctx context.Context, req *dlppb.GetDeidentifyTemplateRequest, opts ...gax.CallOption) (*dlppb.DeidentifyTemplate, error) {
- ctx = insertMetadata(ctx, c.xGoogMetadata)
+ md := metadata.Pairs("x-goog-request-params", fmt.Sprintf("%s=%v", "name", req.GetName()))
+ ctx = insertMetadata(ctx, c.xGoogMetadata, md)
opts = append(c.CallOptions.GetDeidentifyTemplate[0:len(c.CallOptions.GetDeidentifyTemplate):len(c.CallOptions.GetDeidentifyTemplate)], opts...)
var resp *dlppb.DeidentifyTemplate
err := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error {
@@ -454,7 +467,8 @@
// See https://cloud.google.com/dlp/docs/creating-templates-deid to learn
// more.
func (c *Client) ListDeidentifyTemplates(ctx context.Context, req *dlppb.ListDeidentifyTemplatesRequest, opts ...gax.CallOption) *DeidentifyTemplateIterator {
- ctx = insertMetadata(ctx, c.xGoogMetadata)
+ md := metadata.Pairs("x-goog-request-params", fmt.Sprintf("%s=%v", "parent", req.GetParent()))
+ ctx = insertMetadata(ctx, c.xGoogMetadata, md)
opts = append(c.CallOptions.ListDeidentifyTemplates[0:len(c.CallOptions.ListDeidentifyTemplates):len(c.CallOptions.ListDeidentifyTemplates)], opts...)
it := &DeidentifyTemplateIterator{}
req = proto.Clone(req).(*dlppb.ListDeidentifyTemplatesRequest)
@@ -493,7 +507,8 @@
// See https://cloud.google.com/dlp/docs/creating-templates-deid to learn
// more.
func (c *Client) DeleteDeidentifyTemplate(ctx context.Context, req *dlppb.DeleteDeidentifyTemplateRequest, opts ...gax.CallOption) error {
- ctx = insertMetadata(ctx, c.xGoogMetadata)
+ md := metadata.Pairs("x-goog-request-params", fmt.Sprintf("%s=%v", "name", req.GetName()))
+ ctx = insertMetadata(ctx, c.xGoogMetadata, md)
opts = append(c.CallOptions.DeleteDeidentifyTemplate[0:len(c.CallOptions.DeleteDeidentifyTemplate):len(c.CallOptions.DeleteDeidentifyTemplate)], opts...)
err := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error {
var err error
@@ -511,7 +526,8 @@
// system will automatically choose what detectors to run. By default this may
// be all types, but may change over time as detectors are updated.
func (c *Client) CreateDlpJob(ctx context.Context, req *dlppb.CreateDlpJobRequest, opts ...gax.CallOption) (*dlppb.DlpJob, error) {
- ctx = insertMetadata(ctx, c.xGoogMetadata)
+ md := metadata.Pairs("x-goog-request-params", fmt.Sprintf("%s=%v", "parent", req.GetParent()))
+ ctx = insertMetadata(ctx, c.xGoogMetadata, md)
opts = append(c.CallOptions.CreateDlpJob[0:len(c.CallOptions.CreateDlpJob):len(c.CallOptions.CreateDlpJob)], opts...)
var resp *dlppb.DlpJob
err := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error {
@@ -529,7 +545,8 @@
// See https://cloud.google.com/dlp/docs/inspecting-storage and
// https://cloud.google.com/dlp/docs/compute-risk-analysis to learn more.
func (c *Client) ListDlpJobs(ctx context.Context, req *dlppb.ListDlpJobsRequest, opts ...gax.CallOption) *DlpJobIterator {
- ctx = insertMetadata(ctx, c.xGoogMetadata)
+ md := metadata.Pairs("x-goog-request-params", fmt.Sprintf("%s=%v", "parent", req.GetParent()))
+ ctx = insertMetadata(ctx, c.xGoogMetadata, md)
opts = append(c.CallOptions.ListDlpJobs[0:len(c.CallOptions.ListDlpJobs):len(c.CallOptions.ListDlpJobs)], opts...)
it := &DlpJobIterator{}
req = proto.Clone(req).(*dlppb.ListDlpJobsRequest)
@@ -568,7 +585,8 @@
// See https://cloud.google.com/dlp/docs/inspecting-storage and
// https://cloud.google.com/dlp/docs/compute-risk-analysis to learn more.
func (c *Client) GetDlpJob(ctx context.Context, req *dlppb.GetDlpJobRequest, opts ...gax.CallOption) (*dlppb.DlpJob, error) {
- ctx = insertMetadata(ctx, c.xGoogMetadata)
+ md := metadata.Pairs("x-goog-request-params", fmt.Sprintf("%s=%v", "name", req.GetName()))
+ ctx = insertMetadata(ctx, c.xGoogMetadata, md)
opts = append(c.CallOptions.GetDlpJob[0:len(c.CallOptions.GetDlpJob):len(c.CallOptions.GetDlpJob)], opts...)
var resp *dlppb.DlpJob
err := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error {
@@ -588,7 +606,8 @@
// See https://cloud.google.com/dlp/docs/inspecting-storage and
// https://cloud.google.com/dlp/docs/compute-risk-analysis to learn more.
func (c *Client) DeleteDlpJob(ctx context.Context, req *dlppb.DeleteDlpJobRequest, opts ...gax.CallOption) error {
- ctx = insertMetadata(ctx, c.xGoogMetadata)
+ md := metadata.Pairs("x-goog-request-params", fmt.Sprintf("%s=%v", "name", req.GetName()))
+ ctx = insertMetadata(ctx, c.xGoogMetadata, md)
opts = append(c.CallOptions.DeleteDlpJob[0:len(c.CallOptions.DeleteDlpJob):len(c.CallOptions.DeleteDlpJob)], opts...)
err := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error {
var err error
@@ -604,7 +623,8 @@
// See https://cloud.google.com/dlp/docs/inspecting-storage and
// https://cloud.google.com/dlp/docs/compute-risk-analysis to learn more.
func (c *Client) CancelDlpJob(ctx context.Context, req *dlppb.CancelDlpJobRequest, opts ...gax.CallOption) error {
- ctx = insertMetadata(ctx, c.xGoogMetadata)
+ md := metadata.Pairs("x-goog-request-params", fmt.Sprintf("%s=%v", "name", req.GetName()))
+ ctx = insertMetadata(ctx, c.xGoogMetadata, md)
opts = append(c.CallOptions.CancelDlpJob[0:len(c.CallOptions.CancelDlpJob):len(c.CallOptions.CancelDlpJob)], opts...)
err := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error {
var err error
@@ -617,7 +637,8 @@
// ListJobTriggers lists job triggers.
// See https://cloud.google.com/dlp/docs/creating-job-triggers to learn more.
func (c *Client) ListJobTriggers(ctx context.Context, req *dlppb.ListJobTriggersRequest, opts ...gax.CallOption) *JobTriggerIterator {
- ctx = insertMetadata(ctx, c.xGoogMetadata)
+ md := metadata.Pairs("x-goog-request-params", fmt.Sprintf("%s=%v", "parent", req.GetParent()))
+ ctx = insertMetadata(ctx, c.xGoogMetadata, md)
opts = append(c.CallOptions.ListJobTriggers[0:len(c.CallOptions.ListJobTriggers):len(c.CallOptions.ListJobTriggers)], opts...)
it := &JobTriggerIterator{}
req = proto.Clone(req).(*dlppb.ListJobTriggersRequest)
@@ -655,7 +676,8 @@
// GetJobTrigger gets a job trigger.
// See https://cloud.google.com/dlp/docs/creating-job-triggers to learn more.
func (c *Client) GetJobTrigger(ctx context.Context, req *dlppb.GetJobTriggerRequest, opts ...gax.CallOption) (*dlppb.JobTrigger, error) {
- ctx = insertMetadata(ctx, c.xGoogMetadata)
+ md := metadata.Pairs("x-goog-request-params", fmt.Sprintf("%s=%v", "name", req.GetName()))
+ ctx = insertMetadata(ctx, c.xGoogMetadata, md)
opts = append(c.CallOptions.GetJobTrigger[0:len(c.CallOptions.GetJobTrigger):len(c.CallOptions.GetJobTrigger)], opts...)
var resp *dlppb.JobTrigger
err := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error {
@@ -672,7 +694,8 @@
// DeleteJobTrigger deletes a job trigger.
// See https://cloud.google.com/dlp/docs/creating-job-triggers to learn more.
func (c *Client) DeleteJobTrigger(ctx context.Context, req *dlppb.DeleteJobTriggerRequest, opts ...gax.CallOption) error {
- ctx = insertMetadata(ctx, c.xGoogMetadata)
+ md := metadata.Pairs("x-goog-request-params", fmt.Sprintf("%s=%v", "name", req.GetName()))
+ ctx = insertMetadata(ctx, c.xGoogMetadata, md)
opts = append(c.CallOptions.DeleteJobTrigger[0:len(c.CallOptions.DeleteJobTrigger):len(c.CallOptions.DeleteJobTrigger)], opts...)
err := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error {
var err error
@@ -685,7 +708,8 @@
// UpdateJobTrigger updates a job trigger.
// See https://cloud.google.com/dlp/docs/creating-job-triggers to learn more.
func (c *Client) UpdateJobTrigger(ctx context.Context, req *dlppb.UpdateJobTriggerRequest, opts ...gax.CallOption) (*dlppb.JobTrigger, error) {
- ctx = insertMetadata(ctx, c.xGoogMetadata)
+ md := metadata.Pairs("x-goog-request-params", fmt.Sprintf("%s=%v", "name", req.GetName()))
+ ctx = insertMetadata(ctx, c.xGoogMetadata, md)
opts = append(c.CallOptions.UpdateJobTrigger[0:len(c.CallOptions.UpdateJobTrigger):len(c.CallOptions.UpdateJobTrigger)], opts...)
var resp *dlppb.JobTrigger
err := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error {
@@ -703,7 +727,8 @@
// sensitive information on a set schedule.
// See https://cloud.google.com/dlp/docs/creating-job-triggers to learn more.
func (c *Client) CreateJobTrigger(ctx context.Context, req *dlppb.CreateJobTriggerRequest, opts ...gax.CallOption) (*dlppb.JobTrigger, error) {
- ctx = insertMetadata(ctx, c.xGoogMetadata)
+ md := metadata.Pairs("x-goog-request-params", fmt.Sprintf("%s=%v", "parent", req.GetParent()))
+ ctx = insertMetadata(ctx, c.xGoogMetadata, md)
opts = append(c.CallOptions.CreateJobTrigger[0:len(c.CallOptions.CreateJobTrigger):len(c.CallOptions.CreateJobTrigger)], opts...)
var resp *dlppb.JobTrigger
err := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error {
@@ -721,7 +746,8 @@
// See https://cloud.google.com/dlp/docs/creating-stored-infotypes to
// learn more.
func (c *Client) CreateStoredInfoType(ctx context.Context, req *dlppb.CreateStoredInfoTypeRequest, opts ...gax.CallOption) (*dlppb.StoredInfoType, error) {
- ctx = insertMetadata(ctx, c.xGoogMetadata)
+ md := metadata.Pairs("x-goog-request-params", fmt.Sprintf("%s=%v", "parent", req.GetParent()))
+ ctx = insertMetadata(ctx, c.xGoogMetadata, md)
opts = append(c.CallOptions.CreateStoredInfoType[0:len(c.CallOptions.CreateStoredInfoType):len(c.CallOptions.CreateStoredInfoType)], opts...)
var resp *dlppb.StoredInfoType
err := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error {
@@ -740,7 +766,8 @@
// See https://cloud.google.com/dlp/docs/creating-stored-infotypes to
// learn more.
func (c *Client) UpdateStoredInfoType(ctx context.Context, req *dlppb.UpdateStoredInfoTypeRequest, opts ...gax.CallOption) (*dlppb.StoredInfoType, error) {
- ctx = insertMetadata(ctx, c.xGoogMetadata)
+ md := metadata.Pairs("x-goog-request-params", fmt.Sprintf("%s=%v", "name", req.GetName()))
+ ctx = insertMetadata(ctx, c.xGoogMetadata, md)
opts = append(c.CallOptions.UpdateStoredInfoType[0:len(c.CallOptions.UpdateStoredInfoType):len(c.CallOptions.UpdateStoredInfoType)], opts...)
var resp *dlppb.StoredInfoType
err := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error {
@@ -758,7 +785,8 @@
// See https://cloud.google.com/dlp/docs/creating-stored-infotypes to
// learn more.
func (c *Client) GetStoredInfoType(ctx context.Context, req *dlppb.GetStoredInfoTypeRequest, opts ...gax.CallOption) (*dlppb.StoredInfoType, error) {
- ctx = insertMetadata(ctx, c.xGoogMetadata)
+ md := metadata.Pairs("x-goog-request-params", fmt.Sprintf("%s=%v", "name", req.GetName()))
+ ctx = insertMetadata(ctx, c.xGoogMetadata, md)
opts = append(c.CallOptions.GetStoredInfoType[0:len(c.CallOptions.GetStoredInfoType):len(c.CallOptions.GetStoredInfoType)], opts...)
var resp *dlppb.StoredInfoType
err := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error {
@@ -776,7 +804,8 @@
// See https://cloud.google.com/dlp/docs/creating-stored-infotypes to
// learn more.
func (c *Client) ListStoredInfoTypes(ctx context.Context, req *dlppb.ListStoredInfoTypesRequest, opts ...gax.CallOption) *StoredInfoTypeIterator {
- ctx = insertMetadata(ctx, c.xGoogMetadata)
+ md := metadata.Pairs("x-goog-request-params", fmt.Sprintf("%s=%v", "parent", req.GetParent()))
+ ctx = insertMetadata(ctx, c.xGoogMetadata, md)
opts = append(c.CallOptions.ListStoredInfoTypes[0:len(c.CallOptions.ListStoredInfoTypes):len(c.CallOptions.ListStoredInfoTypes)], opts...)
it := &StoredInfoTypeIterator{}
req = proto.Clone(req).(*dlppb.ListStoredInfoTypesRequest)
@@ -815,7 +844,8 @@
// See https://cloud.google.com/dlp/docs/creating-stored-infotypes to
// learn more.
func (c *Client) DeleteStoredInfoType(ctx context.Context, req *dlppb.DeleteStoredInfoTypeRequest, opts ...gax.CallOption) error {
- ctx = insertMetadata(ctx, c.xGoogMetadata)
+ md := metadata.Pairs("x-goog-request-params", fmt.Sprintf("%s=%v", "name", req.GetName()))
+ ctx = insertMetadata(ctx, c.xGoogMetadata, md)
opts = append(c.CallOptions.DeleteStoredInfoType[0:len(c.CallOptions.DeleteStoredInfoType):len(c.CallOptions.DeleteStoredInfoType)], opts...)
err := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error {
var err error
diff --git a/dlp/apiv2/doc.go b/dlp/apiv2/doc.go
index b552f85..2fd63e9 100644
--- a/dlp/apiv2/doc.go
+++ b/dlp/apiv2/doc.go
@@ -98,4 +98,4 @@
return "UNKNOWN"
}
-const versionClient = "20190322"
+const versionClient = "20190401"
diff --git a/errorreporting/apiv1beta1/doc.go b/errorreporting/apiv1beta1/doc.go
index d72c734..3ca2127 100644
--- a/errorreporting/apiv1beta1/doc.go
+++ b/errorreporting/apiv1beta1/doc.go
@@ -101,4 +101,4 @@
return "UNKNOWN"
}
-const versionClient = "20190322"
+const versionClient = "20190401"
diff --git a/errorreporting/apiv1beta1/error_group_client.go b/errorreporting/apiv1beta1/error_group_client.go
index 4f2ad30..757921d 100644
--- a/errorreporting/apiv1beta1/error_group_client.go
+++ b/errorreporting/apiv1beta1/error_group_client.go
@@ -18,6 +18,7 @@
import (
"context"
+ "fmt"
"time"
gax "github.com/googleapis/gax-go/v2"
@@ -120,7 +121,8 @@
// GetGroup get the specified group.
func (c *ErrorGroupClient) GetGroup(ctx context.Context, req *clouderrorreportingpb.GetGroupRequest, opts ...gax.CallOption) (*clouderrorreportingpb.ErrorGroup, error) {
- ctx = insertMetadata(ctx, c.xGoogMetadata)
+ md := metadata.Pairs("x-goog-request-params", fmt.Sprintf("%s=%v", "group_name", req.GetGroupName()))
+ ctx = insertMetadata(ctx, c.xGoogMetadata, md)
opts = append(c.CallOptions.GetGroup[0:len(c.CallOptions.GetGroup):len(c.CallOptions.GetGroup)], opts...)
var resp *clouderrorreportingpb.ErrorGroup
err := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error {
@@ -137,7 +139,8 @@
// UpdateGroup replace the data for the specified group.
// Fails if the group does not exist.
func (c *ErrorGroupClient) UpdateGroup(ctx context.Context, req *clouderrorreportingpb.UpdateGroupRequest, opts ...gax.CallOption) (*clouderrorreportingpb.ErrorGroup, error) {
- ctx = insertMetadata(ctx, c.xGoogMetadata)
+ md := metadata.Pairs("x-goog-request-params", fmt.Sprintf("%s=%v", "group.name", req.GetGroup().GetName()))
+ ctx = insertMetadata(ctx, c.xGoogMetadata, md)
opts = append(c.CallOptions.UpdateGroup[0:len(c.CallOptions.UpdateGroup):len(c.CallOptions.UpdateGroup)], opts...)
var resp *clouderrorreportingpb.ErrorGroup
err := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error {
diff --git a/errorreporting/apiv1beta1/error_stats_client.go b/errorreporting/apiv1beta1/error_stats_client.go
index ade3fdc..9b5b1af 100644
--- a/errorreporting/apiv1beta1/error_stats_client.go
+++ b/errorreporting/apiv1beta1/error_stats_client.go
@@ -18,6 +18,7 @@
import (
"context"
+ "fmt"
"math"
"time"
@@ -126,7 +127,8 @@
// ListGroupStats lists the specified groups.
func (c *ErrorStatsClient) ListGroupStats(ctx context.Context, req *clouderrorreportingpb.ListGroupStatsRequest, opts ...gax.CallOption) *ErrorGroupStatsIterator {
- ctx = insertMetadata(ctx, c.xGoogMetadata)
+ md := metadata.Pairs("x-goog-request-params", fmt.Sprintf("%s=%v", "project_name", req.GetProjectName()))
+ ctx = insertMetadata(ctx, c.xGoogMetadata, md)
opts = append(c.CallOptions.ListGroupStats[0:len(c.CallOptions.ListGroupStats):len(c.CallOptions.ListGroupStats)], opts...)
it := &ErrorGroupStatsIterator{}
req = proto.Clone(req).(*clouderrorreportingpb.ListGroupStatsRequest)
@@ -163,7 +165,8 @@
// ListEvents lists the specified events.
func (c *ErrorStatsClient) ListEvents(ctx context.Context, req *clouderrorreportingpb.ListEventsRequest, opts ...gax.CallOption) *ErrorEventIterator {
- ctx = insertMetadata(ctx, c.xGoogMetadata)
+ md := metadata.Pairs("x-goog-request-params", fmt.Sprintf("%s=%v", "project_name", req.GetProjectName()))
+ ctx = insertMetadata(ctx, c.xGoogMetadata, md)
opts = append(c.CallOptions.ListEvents[0:len(c.CallOptions.ListEvents):len(c.CallOptions.ListEvents)], opts...)
it := &ErrorEventIterator{}
req = proto.Clone(req).(*clouderrorreportingpb.ListEventsRequest)
@@ -200,7 +203,8 @@
// DeleteEvents deletes all error events of a given project.
func (c *ErrorStatsClient) DeleteEvents(ctx context.Context, req *clouderrorreportingpb.DeleteEventsRequest, opts ...gax.CallOption) (*clouderrorreportingpb.DeleteEventsResponse, error) {
- ctx = insertMetadata(ctx, c.xGoogMetadata)
+ md := metadata.Pairs("x-goog-request-params", fmt.Sprintf("%s=%v", "project_name", req.GetProjectName()))
+ ctx = insertMetadata(ctx, c.xGoogMetadata, md)
opts = append(c.CallOptions.DeleteEvents[0:len(c.CallOptions.DeleteEvents):len(c.CallOptions.DeleteEvents)], opts...)
var resp *clouderrorreportingpb.DeleteEventsResponse
err := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error {
diff --git a/errorreporting/apiv1beta1/report_errors_client.go b/errorreporting/apiv1beta1/report_errors_client.go
index ea9f247..bf28630 100644
--- a/errorreporting/apiv1beta1/report_errors_client.go
+++ b/errorreporting/apiv1beta1/report_errors_client.go
@@ -18,6 +18,7 @@
import (
"context"
+ "fmt"
gax "github.com/googleapis/gax-go/v2"
"google.golang.org/api/option"
@@ -110,7 +111,8 @@
// a key parameter. For example:<pre>POST
// https://clouderrorreporting.googleapis.com/v1beta1/projects/example-project/events:report?key=123ABC456</pre>
func (c *ReportErrorsClient) ReportErrorEvent(ctx context.Context, req *clouderrorreportingpb.ReportErrorEventRequest, opts ...gax.CallOption) (*clouderrorreportingpb.ReportErrorEventResponse, error) {
- ctx = insertMetadata(ctx, c.xGoogMetadata)
+ md := metadata.Pairs("x-goog-request-params", fmt.Sprintf("%s=%v", "project_name", req.GetProjectName()))
+ ctx = insertMetadata(ctx, c.xGoogMetadata, md)
opts = append(c.CallOptions.ReportErrorEvent[0:len(c.CallOptions.ReportErrorEvent):len(c.CallOptions.ReportErrorEvent)], opts...)
var resp *clouderrorreportingpb.ReportErrorEventResponse
err := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error {
diff --git a/expr/apiv1alpha1/doc.go b/expr/apiv1alpha1/doc.go
index a677fd3..c79f445 100644
--- a/expr/apiv1alpha1/doc.go
+++ b/expr/apiv1alpha1/doc.go
@@ -95,4 +95,4 @@
return "UNKNOWN"
}
-const versionClient = "20190322"
+const versionClient = "20190401"
diff --git a/go.mod b/go.mod
index 52bf811..e8032e0 100644
--- a/go.mod
+++ b/go.mod
@@ -19,7 +19,7 @@
golang.org/x/time v0.0.0-20181108054448-85acf8d2951c
golang.org/x/tools v0.0.0-20190312170243-e65039ee4138
google.golang.org/api v0.3.0
- google.golang.org/genproto v0.0.0-20190327125643-d831d65fe17d
+ google.golang.org/genproto v0.0.0-20190401181712-f467c93bbac2
google.golang.org/grpc v1.19.0
honnef.co/go/tools v0.0.0-20190106161140-3f1c8253044a
)
diff --git a/go.sum b/go.sum
index 242aa21..c67edb2 100644
--- a/go.sum
+++ b/go.sum
@@ -186,8 +186,8 @@
google.golang.org/genproto v0.0.0-20181219182458-5a97ab628bfb/go.mod h1:7Ep/1NZk928CDR8SjdVbjWNpdIf6nzjE3BTgJDr2Atg=
google.golang.org/genproto v0.0.0-20190307195333-5fe7a883aa19 h1:Lj2SnHtxkRGJDqnGaSjo+CCdIieEnwVazbOXILwQemk=
google.golang.org/genproto v0.0.0-20190307195333-5fe7a883aa19/go.mod h1:VzzqZJRnGkLBvHegQrXjBqPurQTc5/KpmUdxsrq26oE=
-google.golang.org/genproto v0.0.0-20190327125643-d831d65fe17d h1:XB2jc5XQ9uhizGTS2vWcN01bc4dI6z3C4KY5MQm8SS8=
-google.golang.org/genproto v0.0.0-20190327125643-d831d65fe17d/go.mod h1:VzzqZJRnGkLBvHegQrXjBqPurQTc5/KpmUdxsrq26oE=
+google.golang.org/genproto v0.0.0-20190401181712-f467c93bbac2 h1:8FyEBtGg6Px24p+H2AkuVWqhj4+R9fo+fZD17mg+lzk=
+google.golang.org/genproto v0.0.0-20190401181712-f467c93bbac2/go.mod h1:VzzqZJRnGkLBvHegQrXjBqPurQTc5/KpmUdxsrq26oE=
google.golang.org/grpc v1.14.0/go.mod h1:yo6s7OP7yaDglbqo1J04qKzAhqBH6lvTonzMVmEdcZw=
google.golang.org/grpc v1.16.0/go.mod h1:0JHn/cJsOMiMfNA9+DeHDlAU7KAAB5GDlYFpa9MZMio=
google.golang.org/grpc v1.17.0 h1:TRJYBgMclJvGYn2rIMjj+h9KtMt5r1Ij7ODVRIZkwhk=
diff --git a/iam/admin/apiv1/doc.go b/iam/admin/apiv1/doc.go
index 0e164e9..5f3a242 100644
--- a/iam/admin/apiv1/doc.go
+++ b/iam/admin/apiv1/doc.go
@@ -100,4 +100,4 @@
return "UNKNOWN"
}
-const versionClient = "20190322"
+const versionClient = "20190401"
diff --git a/iam/admin/apiv1/iam_client.go b/iam/admin/apiv1/iam_client.go
index 467b6f3..56fce9b 100644
--- a/iam/admin/apiv1/iam_client.go
+++ b/iam/admin/apiv1/iam_client.go
@@ -18,6 +18,7 @@
import (
"context"
+ "fmt"
"math"
"time"
@@ -165,7 +166,8 @@
// ListServiceAccounts lists [ServiceAccounts][google.iam.admin.v1.ServiceAccount] for a project.
func (c *IamClient) ListServiceAccounts(ctx context.Context, req *adminpb.ListServiceAccountsRequest, opts ...gax.CallOption) *ServiceAccountIterator {
- ctx = insertMetadata(ctx, c.xGoogMetadata)
+ md := metadata.Pairs("x-goog-request-params", fmt.Sprintf("%s=%v", "name", req.GetName()))
+ ctx = insertMetadata(ctx, c.xGoogMetadata, md)
opts = append(c.CallOptions.ListServiceAccounts[0:len(c.CallOptions.ListServiceAccounts):len(c.CallOptions.ListServiceAccounts)], opts...)
it := &ServiceAccountIterator{}
req = proto.Clone(req).(*adminpb.ListServiceAccountsRequest)
@@ -202,7 +204,8 @@
// GetServiceAccount gets a [ServiceAccount][google.iam.admin.v1.ServiceAccount].
func (c *IamClient) GetServiceAccount(ctx context.Context, req *adminpb.GetServiceAccountRequest, opts ...gax.CallOption) (*adminpb.ServiceAccount, error) {
- ctx = insertMetadata(ctx, c.xGoogMetadata)
+ md := metadata.Pairs("x-goog-request-params", fmt.Sprintf("%s=%v", "name", req.GetName()))
+ ctx = insertMetadata(ctx, c.xGoogMetadata, md)
opts = append(c.CallOptions.GetServiceAccount[0:len(c.CallOptions.GetServiceAccount):len(c.CallOptions.GetServiceAccount)], opts...)
var resp *adminpb.ServiceAccount
err := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error {
@@ -219,7 +222,8 @@
// CreateServiceAccount creates a [ServiceAccount][google.iam.admin.v1.ServiceAccount]
// and returns it.
func (c *IamClient) CreateServiceAccount(ctx context.Context, req *adminpb.CreateServiceAccountRequest, opts ...gax.CallOption) (*adminpb.ServiceAccount, error) {
- ctx = insertMetadata(ctx, c.xGoogMetadata)
+ md := metadata.Pairs("x-goog-request-params", fmt.Sprintf("%s=%v", "name", req.GetName()))
+ ctx = insertMetadata(ctx, c.xGoogMetadata, md)
opts = append(c.CallOptions.CreateServiceAccount[0:len(c.CallOptions.CreateServiceAccount):len(c.CallOptions.CreateServiceAccount)], opts...)
var resp *adminpb.ServiceAccount
err := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error {
@@ -239,7 +243,8 @@
// display_name .
// The etag is mandatory.
func (c *IamClient) UpdateServiceAccount(ctx context.Context, req *adminpb.ServiceAccount, opts ...gax.CallOption) (*adminpb.ServiceAccount, error) {
- ctx = insertMetadata(ctx, c.xGoogMetadata)
+ md := metadata.Pairs("x-goog-request-params", fmt.Sprintf("%s=%v", "name", req.GetName()))
+ ctx = insertMetadata(ctx, c.xGoogMetadata, md)
opts = append(c.CallOptions.UpdateServiceAccount[0:len(c.CallOptions.UpdateServiceAccount):len(c.CallOptions.UpdateServiceAccount)], opts...)
var resp *adminpb.ServiceAccount
err := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error {
@@ -255,7 +260,8 @@
// DeleteServiceAccount deletes a [ServiceAccount][google.iam.admin.v1.ServiceAccount].
func (c *IamClient) DeleteServiceAccount(ctx context.Context, req *adminpb.DeleteServiceAccountRequest, opts ...gax.CallOption) error {
- ctx = insertMetadata(ctx, c.xGoogMetadata)
+ md := metadata.Pairs("x-goog-request-params", fmt.Sprintf("%s=%v", "name", req.GetName()))
+ ctx = insertMetadata(ctx, c.xGoogMetadata, md)
opts = append(c.CallOptions.DeleteServiceAccount[0:len(c.CallOptions.DeleteServiceAccount):len(c.CallOptions.DeleteServiceAccount)], opts...)
err := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error {
var err error
@@ -267,7 +273,8 @@
// ListServiceAccountKeys lists [ServiceAccountKeys][google.iam.admin.v1.ServiceAccountKey].
func (c *IamClient) ListServiceAccountKeys(ctx context.Context, req *adminpb.ListServiceAccountKeysRequest, opts ...gax.CallOption) (*adminpb.ListServiceAccountKeysResponse, error) {
- ctx = insertMetadata(ctx, c.xGoogMetadata)
+ md := metadata.Pairs("x-goog-request-params", fmt.Sprintf("%s=%v", "name", req.GetName()))
+ ctx = insertMetadata(ctx, c.xGoogMetadata, md)
opts = append(c.CallOptions.ListServiceAccountKeys[0:len(c.CallOptions.ListServiceAccountKeys):len(c.CallOptions.ListServiceAccountKeys)], opts...)
var resp *adminpb.ListServiceAccountKeysResponse
err := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error {
@@ -284,7 +291,8 @@
// GetServiceAccountKey gets the [ServiceAccountKey][google.iam.admin.v1.ServiceAccountKey]
// by key id.
func (c *IamClient) GetServiceAccountKey(ctx context.Context, req *adminpb.GetServiceAccountKeyRequest, opts ...gax.CallOption) (*adminpb.ServiceAccountKey, error) {
- ctx = insertMetadata(ctx, c.xGoogMetadata)
+ md := metadata.Pairs("x-goog-request-params", fmt.Sprintf("%s=%v", "name", req.GetName()))
+ ctx = insertMetadata(ctx, c.xGoogMetadata, md)
opts = append(c.CallOptions.GetServiceAccountKey[0:len(c.CallOptions.GetServiceAccountKey):len(c.CallOptions.GetServiceAccountKey)], opts...)
var resp *adminpb.ServiceAccountKey
err := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error {
@@ -301,7 +309,8 @@
// CreateServiceAccountKey creates a [ServiceAccountKey][google.iam.admin.v1.ServiceAccountKey]
// and returns it.
func (c *IamClient) CreateServiceAccountKey(ctx context.Context, req *adminpb.CreateServiceAccountKeyRequest, opts ...gax.CallOption) (*adminpb.ServiceAccountKey, error) {
- ctx = insertMetadata(ctx, c.xGoogMetadata)
+ md := metadata.Pairs("x-goog-request-params", fmt.Sprintf("%s=%v", "name", req.GetName()))
+ ctx = insertMetadata(ctx, c.xGoogMetadata, md)
opts = append(c.CallOptions.CreateServiceAccountKey[0:len(c.CallOptions.CreateServiceAccountKey):len(c.CallOptions.CreateServiceAccountKey)], opts...)
var resp *adminpb.ServiceAccountKey
err := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error {
@@ -317,7 +326,8 @@
// DeleteServiceAccountKey deletes a [ServiceAccountKey][google.iam.admin.v1.ServiceAccountKey].
func (c *IamClient) DeleteServiceAccountKey(ctx context.Context, req *adminpb.DeleteServiceAccountKeyRequest, opts ...gax.CallOption) error {
- ctx = insertMetadata(ctx, c.xGoogMetadata)
+ md := metadata.Pairs("x-goog-request-params", fmt.Sprintf("%s=%v", "name", req.GetName()))
+ ctx = insertMetadata(ctx, c.xGoogMetadata, md)
opts = append(c.CallOptions.DeleteServiceAccountKey[0:len(c.CallOptions.DeleteServiceAccountKey):len(c.CallOptions.DeleteServiceAccountKey)], opts...)
err := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error {
var err error
@@ -329,7 +339,8 @@
// SignBlob signs a blob using a service account's system-managed private key.
func (c *IamClient) SignBlob(ctx context.Context, req *adminpb.SignBlobRequest, opts ...gax.CallOption) (*adminpb.SignBlobResponse, error) {
- ctx = insertMetadata(ctx, c.xGoogMetadata)
+ md := metadata.Pairs("x-goog-request-params", fmt.Sprintf("%s=%v", "name", req.GetName()))
+ ctx = insertMetadata(ctx, c.xGoogMetadata, md)
opts = append(c.CallOptions.SignBlob[0:len(c.CallOptions.SignBlob):len(c.CallOptions.SignBlob)], opts...)
var resp *adminpb.SignBlobResponse
err := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error {
@@ -346,7 +357,8 @@
// getIamPolicy returns the IAM access control policy for a
// [ServiceAccount][google.iam.admin.v1.ServiceAccount].
func (c *IamClient) getIamPolicy(ctx context.Context, req *iampb.GetIamPolicyRequest, opts ...gax.CallOption) (*iampb.Policy, error) {
- ctx = insertMetadata(ctx, c.xGoogMetadata)
+ md := metadata.Pairs("x-goog-request-params", fmt.Sprintf("%s=%v", "resource", req.GetResource()))
+ ctx = insertMetadata(ctx, c.xGoogMetadata, md)
opts = append(c.CallOptions.GetIamPolicy[0:len(c.CallOptions.GetIamPolicy):len(c.CallOptions.GetIamPolicy)], opts...)
var resp *iampb.Policy
err := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error {
@@ -363,7 +375,8 @@
// setIamPolicy sets the IAM access control policy for a
// [ServiceAccount][google.iam.admin.v1.ServiceAccount].
func (c *IamClient) setIamPolicy(ctx context.Context, req *iampb.SetIamPolicyRequest, opts ...gax.CallOption) (*iampb.Policy, error) {
- ctx = insertMetadata(ctx, c.xGoogMetadata)
+ md := metadata.Pairs("x-goog-request-params", fmt.Sprintf("%s=%v", "resource", req.GetResource()))
+ ctx = insertMetadata(ctx, c.xGoogMetadata, md)
opts = append(c.CallOptions.SetIamPolicy[0:len(c.CallOptions.SetIamPolicy):len(c.CallOptions.SetIamPolicy)], opts...)
var resp *iampb.Policy
err := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error {
@@ -380,7 +393,8 @@
// TestIamPermissions tests the specified permissions against the IAM access control policy
// for a [ServiceAccount][google.iam.admin.v1.ServiceAccount].
func (c *IamClient) TestIamPermissions(ctx context.Context, req *iampb.TestIamPermissionsRequest, opts ...gax.CallOption) (*iampb.TestIamPermissionsResponse, error) {
- ctx = insertMetadata(ctx, c.xGoogMetadata)
+ md := metadata.Pairs("x-goog-request-params", fmt.Sprintf("%s=%v", "resource", req.GetResource()))
+ ctx = insertMetadata(ctx, c.xGoogMetadata, md)
opts = append(c.CallOptions.TestIamPermissions[0:len(c.CallOptions.TestIamPermissions):len(c.CallOptions.TestIamPermissions)], opts...)
var resp *iampb.TestIamPermissionsResponse
err := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error {
@@ -418,7 +432,8 @@
// an expiry time of one hour by default. If you request an expiry time of
// more than one hour, the request will fail.
func (c *IamClient) SignJwt(ctx context.Context, req *adminpb.SignJwtRequest, opts ...gax.CallOption) (*adminpb.SignJwtResponse, error) {
- ctx = insertMetadata(ctx, c.xGoogMetadata)
+ md := metadata.Pairs("x-goog-request-params", fmt.Sprintf("%s=%v", "name", req.GetName()))
+ ctx = insertMetadata(ctx, c.xGoogMetadata, md)
opts = append(c.CallOptions.SignJwt[0:len(c.CallOptions.SignJwt):len(c.CallOptions.SignJwt)], opts...)
var resp *adminpb.SignJwtResponse
err := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error {
diff --git a/iam/credentials/apiv1/doc.go b/iam/credentials/apiv1/doc.go
index 03e1c22..dcc8754 100644
--- a/iam/credentials/apiv1/doc.go
+++ b/iam/credentials/apiv1/doc.go
@@ -97,4 +97,4 @@
return "UNKNOWN"
}
-const versionClient = "20190322"
+const versionClient = "20190401"
diff --git a/iam/credentials/apiv1/iam_credentials_client.go b/iam/credentials/apiv1/iam_credentials_client.go
index 9899edb..43d7159 100644
--- a/iam/credentials/apiv1/iam_credentials_client.go
+++ b/iam/credentials/apiv1/iam_credentials_client.go
@@ -18,6 +18,7 @@
import (
"context"
+ "fmt"
"time"
gax "github.com/googleapis/gax-go/v2"
@@ -134,7 +135,8 @@
// GenerateAccessToken generates an OAuth 2.0 access token for a service account.
func (c *IamCredentialsClient) GenerateAccessToken(ctx context.Context, req *credentialspb.GenerateAccessTokenRequest, opts ...gax.CallOption) (*credentialspb.GenerateAccessTokenResponse, error) {
- ctx = insertMetadata(ctx, c.xGoogMetadata)
+ md := metadata.Pairs("x-goog-request-params", fmt.Sprintf("%s=%v", "name", req.GetName()))
+ ctx = insertMetadata(ctx, c.xGoogMetadata, md)
opts = append(c.CallOptions.GenerateAccessToken[0:len(c.CallOptions.GenerateAccessToken):len(c.CallOptions.GenerateAccessToken)], opts...)
var resp *credentialspb.GenerateAccessTokenResponse
err := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error {
@@ -150,7 +152,8 @@
// GenerateIdToken generates an OpenID Connect ID token for a service account.
func (c *IamCredentialsClient) GenerateIdToken(ctx context.Context, req *credentialspb.GenerateIdTokenRequest, opts ...gax.CallOption) (*credentialspb.GenerateIdTokenResponse, error) {
- ctx = insertMetadata(ctx, c.xGoogMetadata)
+ md := metadata.Pairs("x-goog-request-params", fmt.Sprintf("%s=%v", "name", req.GetName()))
+ ctx = insertMetadata(ctx, c.xGoogMetadata, md)
opts = append(c.CallOptions.GenerateIdToken[0:len(c.CallOptions.GenerateIdToken):len(c.CallOptions.GenerateIdToken)], opts...)
var resp *credentialspb.GenerateIdTokenResponse
err := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error {
@@ -166,7 +169,8 @@
// SignBlob signs a blob using a service account's system-managed private key.
func (c *IamCredentialsClient) SignBlob(ctx context.Context, req *credentialspb.SignBlobRequest, opts ...gax.CallOption) (*credentialspb.SignBlobResponse, error) {
- ctx = insertMetadata(ctx, c.xGoogMetadata)
+ md := metadata.Pairs("x-goog-request-params", fmt.Sprintf("%s=%v", "name", req.GetName()))
+ ctx = insertMetadata(ctx, c.xGoogMetadata, md)
opts = append(c.CallOptions.SignBlob[0:len(c.CallOptions.SignBlob):len(c.CallOptions.SignBlob)], opts...)
var resp *credentialspb.SignBlobResponse
err := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error {
@@ -182,7 +186,8 @@
// SignJwt signs a JWT using a service account's system-managed private key.
func (c *IamCredentialsClient) SignJwt(ctx context.Context, req *credentialspb.SignJwtRequest, opts ...gax.CallOption) (*credentialspb.SignJwtResponse, error) {
- ctx = insertMetadata(ctx, c.xGoogMetadata)
+ md := metadata.Pairs("x-goog-request-params", fmt.Sprintf("%s=%v", "name", req.GetName()))
+ ctx = insertMetadata(ctx, c.xGoogMetadata, md)
opts = append(c.CallOptions.SignJwt[0:len(c.CallOptions.SignJwt):len(c.CallOptions.SignJwt)], opts...)
var resp *credentialspb.SignJwtResponse
err := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error {
@@ -199,7 +204,8 @@
// GenerateIdentityBindingAccessToken exchange a JWT signed by third party identity provider to an OAuth 2.0
// access token
func (c *IamCredentialsClient) GenerateIdentityBindingAccessToken(ctx context.Context, req *credentialspb.GenerateIdentityBindingAccessTokenRequest, opts ...gax.CallOption) (*credentialspb.GenerateIdentityBindingAccessTokenResponse, error) {
- ctx = insertMetadata(ctx, c.xGoogMetadata)
+ md := metadata.Pairs("x-goog-request-params", fmt.Sprintf("%s=%v", "name", req.GetName()))
+ ctx = insertMetadata(ctx, c.xGoogMetadata, md)
opts = append(c.CallOptions.GenerateIdentityBindingAccessToken[0:len(c.CallOptions.GenerateIdentityBindingAccessToken):len(c.CallOptions.GenerateIdentityBindingAccessToken)], opts...)
var resp *credentialspb.GenerateIdentityBindingAccessTokenResponse
err := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error {
diff --git a/iot/apiv1/ListDeviceRegistries_smoke_test.go b/iot/apiv1/ListDeviceRegistries_smoke_test.go
index 521ce22..e15fb15 100644
--- a/iot/apiv1/ListDeviceRegistries_smoke_test.go
+++ b/iot/apiv1/ListDeviceRegistries_smoke_test.go
@@ -38,7 +38,6 @@
var _ = time.Now
func TestDeviceManagerSmoke(t *testing.T) {
- t.Skip("Internal bug 128672764")
if testing.Short() {
t.Skip("skipping smoke test in short mode")
}
diff --git a/iot/apiv1/doc.go b/iot/apiv1/doc.go
index 291f1de..5a77d28 100644
--- a/iot/apiv1/doc.go
+++ b/iot/apiv1/doc.go
@@ -99,4 +99,4 @@
return "UNKNOWN"
}
-const versionClient = "20190322"
+const versionClient = "20190401"
diff --git a/irm/apiv1alpha2/doc.go b/irm/apiv1alpha2/doc.go
index e3e637f..e8a58d8 100644
--- a/irm/apiv1alpha2/doc.go
+++ b/irm/apiv1alpha2/doc.go
@@ -96,4 +96,4 @@
return "UNKNOWN"
}
-const versionClient = "20190322"
+const versionClient = "20190401"
diff --git a/irm/apiv1alpha2/incident_client.go b/irm/apiv1alpha2/incident_client.go
index 9b45de8..e432568 100644
--- a/irm/apiv1alpha2/incident_client.go
+++ b/irm/apiv1alpha2/incident_client.go
@@ -18,6 +18,7 @@
import (
"context"
+ "fmt"
"math"
"time"
@@ -181,7 +182,8 @@
// CreateIncident creates a new incident.
func (c *IncidentClient) CreateIncident(ctx context.Context, req *irmpb.CreateIncidentRequest, opts ...gax.CallOption) (*irmpb.Incident, error) {
- ctx = insertMetadata(ctx, c.xGoogMetadata)
+ md := metadata.Pairs("x-goog-request-params", fmt.Sprintf("%s=%v", "parent", req.GetParent()))
+ ctx = insertMetadata(ctx, c.xGoogMetadata, md)
opts = append(c.CallOptions.CreateIncident[0:len(c.CallOptions.CreateIncident):len(c.CallOptions.CreateIncident)], opts...)
var resp *irmpb.Incident
err := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error {
@@ -197,7 +199,8 @@
// GetIncident returns an incident by name.
func (c *IncidentClient) GetIncident(ctx context.Context, req *irmpb.GetIncidentRequest, opts ...gax.CallOption) (*irmpb.Incident, error) {
- ctx = insertMetadata(ctx, c.xGoogMetadata)
+ md := metadata.Pairs("x-goog-request-params", fmt.Sprintf("%s=%v", "name", req.GetName()))
+ ctx = insertMetadata(ctx, c.xGoogMetadata, md)
opts = append(c.CallOptions.GetIncident[0:len(c.CallOptions.GetIncident):len(c.CallOptions.GetIncident)], opts...)
var resp *irmpb.Incident
err := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error {
@@ -214,7 +217,8 @@
// SearchIncidents returns a list of incidents.
// Incidents are ordered by start time, with the most recent incidents first.
func (c *IncidentClient) SearchIncidents(ctx context.Context, req *irmpb.SearchIncidentsRequest, opts ...gax.CallOption) *IncidentIterator {
- ctx = insertMetadata(ctx, c.xGoogMetadata)
+ md := metadata.Pairs("x-goog-request-params", fmt.Sprintf("%s=%v", "parent", req.GetParent()))
+ ctx = insertMetadata(ctx, c.xGoogMetadata, md)
opts = append(c.CallOptions.SearchIncidents[0:len(c.CallOptions.SearchIncidents):len(c.CallOptions.SearchIncidents)], opts...)
it := &IncidentIterator{}
req = proto.Clone(req).(*irmpb.SearchIncidentsRequest)
@@ -251,7 +255,8 @@
// UpdateIncident updates an existing incident.
func (c *IncidentClient) UpdateIncident(ctx context.Context, req *irmpb.UpdateIncidentRequest, opts ...gax.CallOption) (*irmpb.Incident, error) {
- ctx = insertMetadata(ctx, c.xGoogMetadata)
+ md := metadata.Pairs("x-goog-request-params", fmt.Sprintf("%s=%v", "incident.name", req.GetIncident().GetName()))
+ ctx = insertMetadata(ctx, c.xGoogMetadata, md)
opts = append(c.CallOptions.UpdateIncident[0:len(c.CallOptions.UpdateIncident):len(c.CallOptions.UpdateIncident)], opts...)
var resp *irmpb.Incident
err := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error {
@@ -269,7 +274,8 @@
// or signal. This functionality is provided on a best-effort basis and the
// definition of "similar" is subject to change.
func (c *IncidentClient) SearchSimilarIncidents(ctx context.Context, req *irmpb.SearchSimilarIncidentsRequest, opts ...gax.CallOption) *SearchSimilarIncidentsResponse_ResultIterator {
- ctx = insertMetadata(ctx, c.xGoogMetadata)
+ md := metadata.Pairs("x-goog-request-params", fmt.Sprintf("%s=%v", "name", req.GetName()))
+ ctx = insertMetadata(ctx, c.xGoogMetadata, md)
opts = append(c.CallOptions.SearchSimilarIncidents[0:len(c.CallOptions.SearchSimilarIncidents):len(c.CallOptions.SearchSimilarIncidents)], opts...)
it := &SearchSimilarIncidentsResponse_ResultIterator{}
req = proto.Clone(req).(*irmpb.SearchSimilarIncidentsRequest)
@@ -307,7 +313,8 @@
// CreateAnnotation creates an annotation on an existing incident. Only 'text/plain' and
// 'text/markdown' annotations can be created via this method.
func (c *IncidentClient) CreateAnnotation(ctx context.Context, req *irmpb.CreateAnnotationRequest, opts ...gax.CallOption) (*irmpb.Annotation, error) {
- ctx = insertMetadata(ctx, c.xGoogMetadata)
+ md := metadata.Pairs("x-goog-request-params", fmt.Sprintf("%s=%v", "parent", req.GetParent()))
+ ctx = insertMetadata(ctx, c.xGoogMetadata, md)
opts = append(c.CallOptions.CreateAnnotation[0:len(c.CallOptions.CreateAnnotation):len(c.CallOptions.CreateAnnotation)], opts...)
var resp *irmpb.Annotation
err := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error {
@@ -324,7 +331,8 @@
// ListAnnotations lists annotations that are part of an incident. No assumptions should be
// made on the content-type of the annotation returned.
func (c *IncidentClient) ListAnnotations(ctx context.Context, req *irmpb.ListAnnotationsRequest, opts ...gax.CallOption) *AnnotationIterator {
- ctx = insertMetadata(ctx, c.xGoogMetadata)
+ md := metadata.Pairs("x-goog-request-params", fmt.Sprintf("%s=%v", "parent", req.GetParent()))
+ ctx = insertMetadata(ctx, c.xGoogMetadata, md)
opts = append(c.CallOptions.ListAnnotations[0:len(c.CallOptions.ListAnnotations):len(c.CallOptions.ListAnnotations)], opts...)
it := &AnnotationIterator{}
req = proto.Clone(req).(*irmpb.ListAnnotationsRequest)
@@ -361,7 +369,8 @@
// CreateTag creates a tag on an existing incident.
func (c *IncidentClient) CreateTag(ctx context.Context, req *irmpb.CreateTagRequest, opts ...gax.CallOption) (*irmpb.Tag, error) {
- ctx = insertMetadata(ctx, c.xGoogMetadata)
+ md := metadata.Pairs("x-goog-request-params", fmt.Sprintf("%s=%v", "parent", req.GetParent()))
+ ctx = insertMetadata(ctx, c.xGoogMetadata, md)
opts = append(c.CallOptions.CreateTag[0:len(c.CallOptions.CreateTag):len(c.CallOptions.CreateTag)], opts...)
var resp *irmpb.Tag
err := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error {
@@ -377,7 +386,8 @@
// DeleteTag deletes an existing tag.
func (c *IncidentClient) DeleteTag(ctx context.Context, req *irmpb.DeleteTagRequest, opts ...gax.CallOption) error {
- ctx = insertMetadata(ctx, c.xGoogMetadata)
+ md := metadata.Pairs("x-goog-request-params", fmt.Sprintf("%s=%v", "name", req.GetName()))
+ ctx = insertMetadata(ctx, c.xGoogMetadata, md)
opts = append(c.CallOptions.DeleteTag[0:len(c.CallOptions.DeleteTag):len(c.CallOptions.DeleteTag)], opts...)
err := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error {
var err error
@@ -389,7 +399,8 @@
// ListTags lists tags that are part of an incident.
func (c *IncidentClient) ListTags(ctx context.Context, req *irmpb.ListTagsRequest, opts ...gax.CallOption) *TagIterator {
- ctx = insertMetadata(ctx, c.xGoogMetadata)
+ md := metadata.Pairs("x-goog-request-params", fmt.Sprintf("%s=%v", "parent", req.GetParent()))
+ ctx = insertMetadata(ctx, c.xGoogMetadata, md)
opts = append(c.CallOptions.ListTags[0:len(c.CallOptions.ListTags):len(c.CallOptions.ListTags)], opts...)
it := &TagIterator{}
req = proto.Clone(req).(*irmpb.ListTagsRequest)
@@ -426,7 +437,8 @@
// CreateSignal creates a new signal.
func (c *IncidentClient) CreateSignal(ctx context.Context, req *irmpb.CreateSignalRequest, opts ...gax.CallOption) (*irmpb.Signal, error) {
- ctx = insertMetadata(ctx, c.xGoogMetadata)
+ md := metadata.Pairs("x-goog-request-params", fmt.Sprintf("%s=%v", "parent", req.GetParent()))
+ ctx = insertMetadata(ctx, c.xGoogMetadata, md)
opts = append(c.CallOptions.CreateSignal[0:len(c.CallOptions.CreateSignal):len(c.CallOptions.CreateSignal)], opts...)
var resp *irmpb.Signal
err := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error {
@@ -443,7 +455,8 @@
// SearchSignals lists signals that are part of an incident.
// Signals are returned in reverse chronological order.
func (c *IncidentClient) SearchSignals(ctx context.Context, req *irmpb.SearchSignalsRequest, opts ...gax.CallOption) *SignalIterator {
- ctx = insertMetadata(ctx, c.xGoogMetadata)
+ md := metadata.Pairs("x-goog-request-params", fmt.Sprintf("%s=%v", "parent", req.GetParent()))
+ ctx = insertMetadata(ctx, c.xGoogMetadata, md)
opts = append(c.CallOptions.SearchSignals[0:len(c.CallOptions.SearchSignals):len(c.CallOptions.SearchSignals)], opts...)
it := &SignalIterator{}
req = proto.Clone(req).(*irmpb.SearchSignalsRequest)
@@ -480,7 +493,8 @@
// GetSignal returns a signal by name.
func (c *IncidentClient) GetSignal(ctx context.Context, req *irmpb.GetSignalRequest, opts ...gax.CallOption) (*irmpb.Signal, error) {
- ctx = insertMetadata(ctx, c.xGoogMetadata)
+ md := metadata.Pairs("x-goog-request-params", fmt.Sprintf("%s=%v", "name", req.GetName()))
+ ctx = insertMetadata(ctx, c.xGoogMetadata, md)
opts = append(c.CallOptions.GetSignal[0:len(c.CallOptions.GetSignal):len(c.CallOptions.GetSignal)], opts...)
var resp *irmpb.Signal
err := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error {
@@ -497,7 +511,8 @@
// UpdateSignal updates an existing signal (for example, to assign/unassign it to an
// incident).
func (c *IncidentClient) UpdateSignal(ctx context.Context, req *irmpb.UpdateSignalRequest, opts ...gax.CallOption) (*irmpb.Signal, error) {
- ctx = insertMetadata(ctx, c.xGoogMetadata)
+ md := metadata.Pairs("x-goog-request-params", fmt.Sprintf("%s=%v", "signal.name", req.GetSignal().GetName()))
+ ctx = insertMetadata(ctx, c.xGoogMetadata, md)
opts = append(c.CallOptions.UpdateSignal[0:len(c.CallOptions.UpdateSignal):len(c.CallOptions.UpdateSignal)], opts...)
var resp *irmpb.Signal
err := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error {
@@ -513,7 +528,8 @@
// EscalateIncident escalates an incident.
func (c *IncidentClient) EscalateIncident(ctx context.Context, req *irmpb.EscalateIncidentRequest, opts ...gax.CallOption) (*irmpb.EscalateIncidentResponse, error) {
- ctx = insertMetadata(ctx, c.xGoogMetadata)
+ md := metadata.Pairs("x-goog-request-params", fmt.Sprintf("%s=%v", "incident.name", req.GetIncident().GetName()))
+ ctx = insertMetadata(ctx, c.xGoogMetadata, md)
opts = append(c.CallOptions.EscalateIncident[0:len(c.CallOptions.EscalateIncident):len(c.CallOptions.EscalateIncident)], opts...)
var resp *irmpb.EscalateIncidentResponse
err := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error {
@@ -529,7 +545,8 @@
// CreateArtifact creates a new artifact.
func (c *IncidentClient) CreateArtifact(ctx context.Context, req *irmpb.CreateArtifactRequest, opts ...gax.CallOption) (*irmpb.Artifact, error) {
- ctx = insertMetadata(ctx, c.xGoogMetadata)
+ md := metadata.Pairs("x-goog-request-params", fmt.Sprintf("%s=%v", "parent", req.GetParent()))
+ ctx = insertMetadata(ctx, c.xGoogMetadata, md)
opts = append(c.CallOptions.CreateArtifact[0:len(c.CallOptions.CreateArtifact):len(c.CallOptions.CreateArtifact)], opts...)
var resp *irmpb.Artifact
err := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error {
@@ -545,7 +562,8 @@
// ListArtifacts returns a list of artifacts for an incident.
func (c *IncidentClient) ListArtifacts(ctx context.Context, req *irmpb.ListArtifactsRequest, opts ...gax.CallOption) *ArtifactIterator {
- ctx = insertMetadata(ctx, c.xGoogMetadata)
+ md := metadata.Pairs("x-goog-request-params", fmt.Sprintf("%s=%v", "parent", req.GetParent()))
+ ctx = insertMetadata(ctx, c.xGoogMetadata, md)
opts = append(c.CallOptions.ListArtifacts[0:len(c.CallOptions.ListArtifacts):len(c.CallOptions.ListArtifacts)], opts...)
it := &ArtifactIterator{}
req = proto.Clone(req).(*irmpb.ListArtifactsRequest)
@@ -582,7 +600,8 @@
// UpdateArtifact updates an existing artifact.
func (c *IncidentClient) UpdateArtifact(ctx context.Context, req *irmpb.UpdateArtifactRequest, opts ...gax.CallOption) (*irmpb.Artifact, error) {
- ctx = insertMetadata(ctx, c.xGoogMetadata)
+ md := metadata.Pairs("x-goog-request-params", fmt.Sprintf("%s=%v", "artifact.name", req.GetArtifact().GetName()))
+ ctx = insertMetadata(ctx, c.xGoogMetadata, md)
opts = append(c.CallOptions.UpdateArtifact[0:len(c.CallOptions.UpdateArtifact):len(c.CallOptions.UpdateArtifact)], opts...)
var resp *irmpb.Artifact
err := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error {
@@ -598,7 +617,8 @@
// DeleteArtifact deletes an existing artifact.
func (c *IncidentClient) DeleteArtifact(ctx context.Context, req *irmpb.DeleteArtifactRequest, opts ...gax.CallOption) error {
- ctx = insertMetadata(ctx, c.xGoogMetadata)
+ md := metadata.Pairs("x-goog-request-params", fmt.Sprintf("%s=%v", "name", req.GetName()))
+ ctx = insertMetadata(ctx, c.xGoogMetadata, md)
opts = append(c.CallOptions.DeleteArtifact[0:len(c.CallOptions.DeleteArtifact):len(c.CallOptions.DeleteArtifact)], opts...)
err := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error {
var err error
@@ -610,7 +630,8 @@
// SendShiftHandoff sends a summary of the shift for oncall handoff.
func (c *IncidentClient) SendShiftHandoff(ctx context.Context, req *irmpb.SendShiftHandoffRequest, opts ...gax.CallOption) (*irmpb.SendShiftHandoffResponse, error) {
- ctx = insertMetadata(ctx, c.xGoogMetadata)
+ md := metadata.Pairs("x-goog-request-params", fmt.Sprintf("%s=%v", "parent", req.GetParent()))
+ ctx = insertMetadata(ctx, c.xGoogMetadata, md)
opts = append(c.CallOptions.SendShiftHandoff[0:len(c.CallOptions.SendShiftHandoff):len(c.CallOptions.SendShiftHandoff)], opts...)
var resp *irmpb.SendShiftHandoffResponse
err := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error {
@@ -629,7 +650,8 @@
// a. there are too many (50) subscriptions in the incident already
// b. a subscription using the given channel already exists
func (c *IncidentClient) CreateSubscription(ctx context.Context, req *irmpb.CreateSubscriptionRequest, opts ...gax.CallOption) (*irmpb.Subscription, error) {
- ctx = insertMetadata(ctx, c.xGoogMetadata)
+ md := metadata.Pairs("x-goog-request-params", fmt.Sprintf("%s=%v", "parent", req.GetParent()))
+ ctx = insertMetadata(ctx, c.xGoogMetadata, md)
opts = append(c.CallOptions.CreateSubscription[0:len(c.CallOptions.CreateSubscription):len(c.CallOptions.CreateSubscription)], opts...)
var resp *irmpb.Subscription
err := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error {
@@ -645,7 +667,8 @@
// UpdateSubscription updates a subscription.
func (c *IncidentClient) UpdateSubscription(ctx context.Context, req *irmpb.UpdateSubscriptionRequest, opts ...gax.CallOption) (*irmpb.Subscription, error) {
- ctx = insertMetadata(ctx, c.xGoogMetadata)
+ md := metadata.Pairs("x-goog-request-params", fmt.Sprintf("%s=%v", "subscription.name", req.GetSubscription().GetName()))
+ ctx = insertMetadata(ctx, c.xGoogMetadata, md)
opts = append(c.CallOptions.UpdateSubscription[0:len(c.CallOptions.UpdateSubscription):len(c.CallOptions.UpdateSubscription)], opts...)
var resp *irmpb.Subscription
err := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error {
@@ -661,7 +684,8 @@
// ListSubscriptions returns a list of subscriptions for an incident.
func (c *IncidentClient) ListSubscriptions(ctx context.Context, req *irmpb.ListSubscriptionsRequest, opts ...gax.CallOption) *SubscriptionIterator {
- ctx = insertMetadata(ctx, c.xGoogMetadata)
+ md := metadata.Pairs("x-goog-request-params", fmt.Sprintf("%s=%v", "parent", req.GetParent()))
+ ctx = insertMetadata(ctx, c.xGoogMetadata, md)
opts = append(c.CallOptions.ListSubscriptions[0:len(c.CallOptions.ListSubscriptions):len(c.CallOptions.ListSubscriptions)], opts...)
it := &SubscriptionIterator{}
req = proto.Clone(req).(*irmpb.ListSubscriptionsRequest)
@@ -698,7 +722,8 @@
// DeleteSubscription deletes an existing subscription.
func (c *IncidentClient) DeleteSubscription(ctx context.Context, req *irmpb.DeleteSubscriptionRequest, opts ...gax.CallOption) error {
- ctx = insertMetadata(ctx, c.xGoogMetadata)
+ md := metadata.Pairs("x-goog-request-params", fmt.Sprintf("%s=%v", "name", req.GetName()))
+ ctx = insertMetadata(ctx, c.xGoogMetadata, md)
opts = append(c.CallOptions.DeleteSubscription[0:len(c.CallOptions.DeleteSubscription):len(c.CallOptions.DeleteSubscription)], opts...)
err := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error {
var err error
@@ -714,7 +739,8 @@
// directly to a user other than oneself is equivalent to proposing and
// force-assigning the role to the user.
func (c *IncidentClient) CreateIncidentRoleAssignment(ctx context.Context, req *irmpb.CreateIncidentRoleAssignmentRequest, opts ...gax.CallOption) (*irmpb.IncidentRoleAssignment, error) {
- ctx = insertMetadata(ctx, c.xGoogMetadata)
+ md := metadata.Pairs("x-goog-request-params", fmt.Sprintf("%s=%v", "parent", req.GetParent()))
+ ctx = insertMetadata(ctx, c.xGoogMetadata, md)
opts = append(c.CallOptions.CreateIncidentRoleAssignment[0:len(c.CallOptions.CreateIncidentRoleAssignment):len(c.CallOptions.CreateIncidentRoleAssignment)], opts...)
var resp *irmpb.IncidentRoleAssignment
err := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error {
@@ -730,7 +756,8 @@
// DeleteIncidentRoleAssignment deletes an existing role assignment.
func (c *IncidentClient) DeleteIncidentRoleAssignment(ctx context.Context, req *irmpb.DeleteIncidentRoleAssignmentRequest, opts ...gax.CallOption) error {
- ctx = insertMetadata(ctx, c.xGoogMetadata)
+ md := metadata.Pairs("x-goog-request-params", fmt.Sprintf("%s=%v", "name", req.GetName()))
+ ctx = insertMetadata(ctx, c.xGoogMetadata, md)
opts = append(c.CallOptions.DeleteIncidentRoleAssignment[0:len(c.CallOptions.DeleteIncidentRoleAssignment):len(c.CallOptions.DeleteIncidentRoleAssignment)], opts...)
err := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error {
var err error
@@ -742,7 +769,8 @@
// ListIncidentRoleAssignments lists role assignments that are part of an incident.
func (c *IncidentClient) ListIncidentRoleAssignments(ctx context.Context, req *irmpb.ListIncidentRoleAssignmentsRequest, opts ...gax.CallOption) *IncidentRoleAssignmentIterator {
- ctx = insertMetadata(ctx, c.xGoogMetadata)
+ md := metadata.Pairs("x-goog-request-params", fmt.Sprintf("%s=%v", "parent", req.GetParent()))
+ ctx = insertMetadata(ctx, c.xGoogMetadata, md)
opts = append(c.CallOptions.ListIncidentRoleAssignments[0:len(c.CallOptions.ListIncidentRoleAssignments):len(c.CallOptions.ListIncidentRoleAssignments)], opts...)
it := &IncidentRoleAssignmentIterator{}
req = proto.Clone(req).(*irmpb.ListIncidentRoleAssignmentsRequest)
@@ -781,7 +809,8 @@
// notifying them of the assignment. This will fail if a role handover is
// already pending.
func (c *IncidentClient) RequestIncidentRoleHandover(ctx context.Context, req *irmpb.RequestIncidentRoleHandoverRequest, opts ...gax.CallOption) (*irmpb.IncidentRoleAssignment, error) {
- ctx = insertMetadata(ctx, c.xGoogMetadata)
+ md := metadata.Pairs("x-goog-request-params", fmt.Sprintf("%s=%v", "name", req.GetName()))
+ ctx = insertMetadata(ctx, c.xGoogMetadata, md)
opts = append(c.CallOptions.RequestIncidentRoleHandover[0:len(c.CallOptions.RequestIncidentRoleHandover):len(c.CallOptions.RequestIncidentRoleHandover)], opts...)
var resp *irmpb.IncidentRoleAssignment
err := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error {
@@ -800,7 +829,8 @@
// the request. If the caller is not the new_assignee,
// ForceIncidentRoleHandover should be used instead.
func (c *IncidentClient) ConfirmIncidentRoleHandover(ctx context.Context, req *irmpb.ConfirmIncidentRoleHandoverRequest, opts ...gax.CallOption) (*irmpb.IncidentRoleAssignment, error) {
- ctx = insertMetadata(ctx, c.xGoogMetadata)
+ md := metadata.Pairs("x-goog-request-params", fmt.Sprintf("%s=%v", "name", req.GetName()))
+ ctx = insertMetadata(ctx, c.xGoogMetadata, md)
opts = append(c.CallOptions.ConfirmIncidentRoleHandover[0:len(c.CallOptions.ConfirmIncidentRoleHandover):len(c.CallOptions.ConfirmIncidentRoleHandover)], opts...)
var resp *irmpb.IncidentRoleAssignment
err := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error {
@@ -819,7 +849,8 @@
// request. If the caller is the new_assignee, ConfirmIncidentRoleHandover
// should be used instead.
func (c *IncidentClient) ForceIncidentRoleHandover(ctx context.Context, req *irmpb.ForceIncidentRoleHandoverRequest, opts ...gax.CallOption) (*irmpb.IncidentRoleAssignment, error) {
- ctx = insertMetadata(ctx, c.xGoogMetadata)
+ md := metadata.Pairs("x-goog-request-params", fmt.Sprintf("%s=%v", "name", req.GetName()))
+ ctx = insertMetadata(ctx, c.xGoogMetadata, md)
opts = append(c.CallOptions.ForceIncidentRoleHandover[0:len(c.CallOptions.ForceIncidentRoleHandover):len(c.CallOptions.ForceIncidentRoleHandover)], opts...)
var resp *irmpb.IncidentRoleAssignment
err := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error {
@@ -837,7 +868,8 @@
// the IncidentRoleAssignment is not equal to the 'new_assignee' field of the
// request.
func (c *IncidentClient) CancelIncidentRoleHandover(ctx context.Context, req *irmpb.CancelIncidentRoleHandoverRequest, opts ...gax.CallOption) (*irmpb.IncidentRoleAssignment, error) {
- ctx = insertMetadata(ctx, c.xGoogMetadata)
+ md := metadata.Pairs("x-goog-request-params", fmt.Sprintf("%s=%v", "name", req.GetName()))
+ ctx = insertMetadata(ctx, c.xGoogMetadata, md)
opts = append(c.CallOptions.CancelIncidentRoleHandover[0:len(c.CallOptions.CancelIncidentRoleHandover):len(c.CallOptions.CancelIncidentRoleHandover)], opts...)
var resp *irmpb.IncidentRoleAssignment
err := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error {
diff --git a/kms/apiv1/doc.go b/kms/apiv1/doc.go
index 81ea445..ff11c1f 100644
--- a/kms/apiv1/doc.go
+++ b/kms/apiv1/doc.go
@@ -97,4 +97,4 @@
return "UNKNOWN"
}
-const versionClient = "20190322"
+const versionClient = "20190401"
diff --git a/kms/apiv1/mock_test.go b/kms/apiv1/mock_test.go
index 7f6f20e..b8d10c2 100644
--- a/kms/apiv1/mock_test.go
+++ b/kms/apiv1/mock_test.go
@@ -20,7 +20,6 @@
durationpb "github.com/golang/protobuf/ptypes/duration"
timestamppb "github.com/golang/protobuf/ptypes/timestamp"
kmspb "google.golang.org/genproto/googleapis/cloud/kms/v1"
- iampb "google.golang.org/genproto/googleapis/iam/v1"
field_maskpb "google.golang.org/genproto/protobuf/field_mask"
)
@@ -292,64 +291,12 @@
return s.resps[0].(*kmspb.CryptoKeyVersion), nil
}
-type mockIamPolicyServer struct {
- // Embed for forward compatibility.
- // Tests will keep working if more methods are added
- // in the future.
- iampb.IAMPolicyServer
-
- reqs []proto.Message
-
- // If set, all calls return this error.
- err error
-
- // responses to return if err == nil
- resps []proto.Message
-}
-
-func (s *mockIamPolicyServer) SetIamPolicy(ctx context.Context, req *iampb.SetIamPolicyRequest) (*iampb.Policy, error) {
- md, _ := metadata.FromIncomingContext(ctx)
- if xg := md["x-goog-api-client"]; len(xg) == 0 || !strings.Contains(xg[0], "gl-go/") {
- return nil, fmt.Errorf("x-goog-api-client = %v, expected gl-go key", xg)
- }
- s.reqs = append(s.reqs, req)
- if s.err != nil {
- return nil, s.err
- }
- return s.resps[0].(*iampb.Policy), nil
-}
-
-func (s *mockIamPolicyServer) GetIamPolicy(ctx context.Context, req *iampb.GetIamPolicyRequest) (*iampb.Policy, error) {
- md, _ := metadata.FromIncomingContext(ctx)
- if xg := md["x-goog-api-client"]; len(xg) == 0 || !strings.Contains(xg[0], "gl-go/") {
- return nil, fmt.Errorf("x-goog-api-client = %v, expected gl-go key", xg)
- }
- s.reqs = append(s.reqs, req)
- if s.err != nil {
- return nil, s.err
- }
- return s.resps[0].(*iampb.Policy), nil
-}
-
-func (s *mockIamPolicyServer) TestIamPermissions(ctx context.Context, req *iampb.TestIamPermissionsRequest) (*iampb.TestIamPermissionsResponse, error) {
- md, _ := metadata.FromIncomingContext(ctx)
- if xg := md["x-goog-api-client"]; len(xg) == 0 || !strings.Contains(xg[0], "gl-go/") {
- return nil, fmt.Errorf("x-goog-api-client = %v, expected gl-go key", xg)
- }
- s.reqs = append(s.reqs, req)
- if s.err != nil {
- return nil, s.err
- }
- return s.resps[0].(*iampb.TestIamPermissionsResponse), nil
-}
-
// clientOpt is the option tests should use to connect to the test server.
// It is initialized by TestMain.
var clientOpt option.ClientOption
var (
mockKeyManagement mockKeyManagementServer
- mockIamPolicy mockIamPolicyServer
)
func TestMain(m *testing.M) {
@@ -357,7 +304,6 @@
serv := grpc.NewServer()
kmspb.RegisterKeyManagementServiceServer(serv, &mockKeyManagement)
- iampb.RegisterIAMPolicyServer(serv, &mockIamPolicy)
lis, err := net.Listen("tcp", "localhost:0")
if err != nil {
diff --git a/language/apiv1/doc.go b/language/apiv1/doc.go
index fd183d0..9705c65 100644
--- a/language/apiv1/doc.go
+++ b/language/apiv1/doc.go
@@ -100,4 +100,4 @@
return "UNKNOWN"
}
-const versionClient = "20190322"
+const versionClient = "20190401"
diff --git a/language/apiv1beta2/doc.go b/language/apiv1beta2/doc.go
index dd6886a..1eb23b4 100644
--- a/language/apiv1beta2/doc.go
+++ b/language/apiv1beta2/doc.go
@@ -99,4 +99,4 @@
return "UNKNOWN"
}
-const versionClient = "20190322"
+const versionClient = "20190401"
diff --git a/logging/apiv2/config_client.go b/logging/apiv2/config_client.go
index c6ec6d8..39c78e2 100644
--- a/logging/apiv2/config_client.go
+++ b/logging/apiv2/config_client.go
@@ -18,6 +18,7 @@
import (
"context"
+ "fmt"
"math"
"time"
@@ -141,7 +142,8 @@
// ListSinks lists sinks.
func (c *ConfigClient) ListSinks(ctx context.Context, req *loggingpb.ListSinksRequest, opts ...gax.CallOption) *LogSinkIterator {
- ctx = insertMetadata(ctx, c.xGoogMetadata)
+ md := metadata.Pairs("x-goog-request-params", fmt.Sprintf("%s=%v", "parent", req.GetParent()))
+ ctx = insertMetadata(ctx, c.xGoogMetadata, md)
opts = append(c.CallOptions.ListSinks[0:len(c.CallOptions.ListSinks):len(c.CallOptions.ListSinks)], opts...)
it := &LogSinkIterator{}
req = proto.Clone(req).(*loggingpb.ListSinksRequest)
@@ -178,7 +180,8 @@
// GetSink gets a sink.
func (c *ConfigClient) GetSink(ctx context.Context, req *loggingpb.GetSinkRequest, opts ...gax.CallOption) (*loggingpb.LogSink, error) {
- ctx = insertMetadata(ctx, c.xGoogMetadata)
+ md := metadata.Pairs("x-goog-request-params", fmt.Sprintf("%s=%v", "sink_name", req.GetSinkName()))
+ ctx = insertMetadata(ctx, c.xGoogMetadata, md)
opts = append(c.CallOptions.GetSink[0:len(c.CallOptions.GetSink):len(c.CallOptions.GetSink)], opts...)
var resp *loggingpb.LogSink
err := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error {
@@ -197,7 +200,8 @@
// writer_identity is not permitted to write to the destination. A sink can
// export log entries only from the resource owning the sink.
func (c *ConfigClient) CreateSink(ctx context.Context, req *loggingpb.CreateSinkRequest, opts ...gax.CallOption) (*loggingpb.LogSink, error) {
- ctx = insertMetadata(ctx, c.xGoogMetadata)
+ md := metadata.Pairs("x-goog-request-params", fmt.Sprintf("%s=%v", "parent", req.GetParent()))
+ ctx = insertMetadata(ctx, c.xGoogMetadata, md)
opts = append(c.CallOptions.CreateSink[0:len(c.CallOptions.CreateSink):len(c.CallOptions.CreateSink)], opts...)
var resp *loggingpb.LogSink
err := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error {
@@ -216,7 +220,8 @@
// The updated sink might also have a new writer_identity; see the
// unique_writer_identity field.
func (c *ConfigClient) UpdateSink(ctx context.Context, req *loggingpb.UpdateSinkRequest, opts ...gax.CallOption) (*loggingpb.LogSink, error) {
- ctx = insertMetadata(ctx, c.xGoogMetadata)
+ md := metadata.Pairs("x-goog-request-params", fmt.Sprintf("%s=%v", "sink_name", req.GetSinkName()))
+ ctx = insertMetadata(ctx, c.xGoogMetadata, md)
opts = append(c.CallOptions.UpdateSink[0:len(c.CallOptions.UpdateSink):len(c.CallOptions.UpdateSink)], opts...)
var resp *loggingpb.LogSink
err := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error {
@@ -233,7 +238,8 @@
// DeleteSink deletes a sink. If the sink has a unique writer_identity, then that
// service account is also deleted.
func (c *ConfigClient) DeleteSink(ctx context.Context, req *loggingpb.DeleteSinkRequest, opts ...gax.CallOption) error {
- ctx = insertMetadata(ctx, c.xGoogMetadata)
+ md := metadata.Pairs("x-goog-request-params", fmt.Sprintf("%s=%v", "sink_name", req.GetSinkName()))
+ ctx = insertMetadata(ctx, c.xGoogMetadata, md)
opts = append(c.CallOptions.DeleteSink[0:len(c.CallOptions.DeleteSink):len(c.CallOptions.DeleteSink)], opts...)
err := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error {
var err error
@@ -245,7 +251,8 @@
// ListExclusions lists all the exclusions in a parent resource.
func (c *ConfigClient) ListExclusions(ctx context.Context, req *loggingpb.ListExclusionsRequest, opts ...gax.CallOption) *LogExclusionIterator {
- ctx = insertMetadata(ctx, c.xGoogMetadata)
+ md := metadata.Pairs("x-goog-request-params", fmt.Sprintf("%s=%v", "parent", req.GetParent()))
+ ctx = insertMetadata(ctx, c.xGoogMetadata, md)
opts = append(c.CallOptions.ListExclusions[0:len(c.CallOptions.ListExclusions):len(c.CallOptions.ListExclusions)], opts...)
it := &LogExclusionIterator{}
req = proto.Clone(req).(*loggingpb.ListExclusionsRequest)
@@ -282,7 +289,8 @@
// GetExclusion gets the description of an exclusion.
func (c *ConfigClient) GetExclusion(ctx context.Context, req *loggingpb.GetExclusionRequest, opts ...gax.CallOption) (*loggingpb.LogExclusion, error) {
- ctx = insertMetadata(ctx, c.xGoogMetadata)
+ md := metadata.Pairs("x-goog-request-params", fmt.Sprintf("%s=%v", "name", req.GetName()))
+ ctx = insertMetadata(ctx, c.xGoogMetadata, md)
opts = append(c.CallOptions.GetExclusion[0:len(c.CallOptions.GetExclusion):len(c.CallOptions.GetExclusion)], opts...)
var resp *loggingpb.LogExclusion
err := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error {
@@ -300,7 +308,8 @@
// Only log entries belonging to that resource can be excluded.
// You can have up to 10 exclusions in a resource.
func (c *ConfigClient) CreateExclusion(ctx context.Context, req *loggingpb.CreateExclusionRequest, opts ...gax.CallOption) (*loggingpb.LogExclusion, error) {
- ctx = insertMetadata(ctx, c.xGoogMetadata)
+ md := metadata.Pairs("x-goog-request-params", fmt.Sprintf("%s=%v", "parent", req.GetParent()))
+ ctx = insertMetadata(ctx, c.xGoogMetadata, md)
opts = append(c.CallOptions.CreateExclusion[0:len(c.CallOptions.CreateExclusion):len(c.CallOptions.CreateExclusion)], opts...)
var resp *loggingpb.LogExclusion
err := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error {
@@ -316,7 +325,8 @@
// UpdateExclusion changes one or more properties of an existing exclusion.
func (c *ConfigClient) UpdateExclusion(ctx context.Context, req *loggingpb.UpdateExclusionRequest, opts ...gax.CallOption) (*loggingpb.LogExclusion, error) {
- ctx = insertMetadata(ctx, c.xGoogMetadata)
+ md := metadata.Pairs("x-goog-request-params", fmt.Sprintf("%s=%v", "name", req.GetName()))
+ ctx = insertMetadata(ctx, c.xGoogMetadata, md)
opts = append(c.CallOptions.UpdateExclusion[0:len(c.CallOptions.UpdateExclusion):len(c.CallOptions.UpdateExclusion)], opts...)
var resp *loggingpb.LogExclusion
err := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error {
@@ -332,7 +342,8 @@
// DeleteExclusion deletes an exclusion.
func (c *ConfigClient) DeleteExclusion(ctx context.Context, req *loggingpb.DeleteExclusionRequest, opts ...gax.CallOption) error {
- ctx = insertMetadata(ctx, c.xGoogMetadata)
+ md := metadata.Pairs("x-goog-request-params", fmt.Sprintf("%s=%v", "name", req.GetName()))
+ ctx = insertMetadata(ctx, c.xGoogMetadata, md)
opts = append(c.CallOptions.DeleteExclusion[0:len(c.CallOptions.DeleteExclusion):len(c.CallOptions.DeleteExclusion)], opts...)
err := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error {
var err error
diff --git a/logging/apiv2/doc.go b/logging/apiv2/doc.go
index f929777..ce411da 100644
--- a/logging/apiv2/doc.go
+++ b/logging/apiv2/doc.go
@@ -103,4 +103,4 @@
return "UNKNOWN"
}
-const versionClient = "20190322"
+const versionClient = "20190401"
diff --git a/logging/apiv2/logging_client.go b/logging/apiv2/logging_client.go
index 7dddc21..15ca909 100644
--- a/logging/apiv2/logging_client.go
+++ b/logging/apiv2/logging_client.go
@@ -18,6 +18,7 @@
import (
"context"
+ "fmt"
"math"
"time"
@@ -134,7 +135,8 @@
// Log entries written shortly before the delete operation might not be
// deleted.
func (c *Client) DeleteLog(ctx context.Context, req *loggingpb.DeleteLogRequest, opts ...gax.CallOption) error {
- ctx = insertMetadata(ctx, c.xGoogMetadata)
+ md := metadata.Pairs("x-goog-request-params", fmt.Sprintf("%s=%v", "log_name", req.GetLogName()))
+ ctx = insertMetadata(ctx, c.xGoogMetadata, md)
opts = append(c.CallOptions.DeleteLog[0:len(c.CallOptions.DeleteLog):len(c.CallOptions.DeleteLog)], opts...)
err := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error {
var err error
@@ -245,7 +247,8 @@
// ListLogs lists the logs in projects, organizations, folders, or billing accounts.
// Only logs that have entries are listed.
func (c *Client) ListLogs(ctx context.Context, req *loggingpb.ListLogsRequest, opts ...gax.CallOption) *StringIterator {
- ctx = insertMetadata(ctx, c.xGoogMetadata)
+ md := metadata.Pairs("x-goog-request-params", fmt.Sprintf("%s=%v", "parent", req.GetParent()))
+ ctx = insertMetadata(ctx, c.xGoogMetadata, md)
opts = append(c.CallOptions.ListLogs[0:len(c.CallOptions.ListLogs):len(c.CallOptions.ListLogs)], opts...)
it := &StringIterator{}
req = proto.Clone(req).(*loggingpb.ListLogsRequest)
diff --git a/logging/apiv2/metrics_client.go b/logging/apiv2/metrics_client.go
index 9d5030f..9217f22 100644
--- a/logging/apiv2/metrics_client.go
+++ b/logging/apiv2/metrics_client.go
@@ -18,6 +18,7 @@
import (
"context"
+ "fmt"
"math"
"time"
@@ -130,7 +131,8 @@
// ListLogMetrics lists logs-based metrics.
func (c *MetricsClient) ListLogMetrics(ctx context.Context, req *loggingpb.ListLogMetricsRequest, opts ...gax.CallOption) *LogMetricIterator {
- ctx = insertMetadata(ctx, c.xGoogMetadata)
+ md := metadata.Pairs("x-goog-request-params", fmt.Sprintf("%s=%v", "parent", req.GetParent()))
+ ctx = insertMetadata(ctx, c.xGoogMetadata, md)
opts = append(c.CallOptions.ListLogMetrics[0:len(c.CallOptions.ListLogMetrics):len(c.CallOptions.ListLogMetrics)], opts...)
it := &LogMetricIterator{}
req = proto.Clone(req).(*loggingpb.ListLogMetricsRequest)
@@ -167,7 +169,8 @@
// GetLogMetric gets a logs-based metric.
func (c *MetricsClient) GetLogMetric(ctx context.Context, req *loggingpb.GetLogMetricRequest, opts ...gax.CallOption) (*loggingpb.LogMetric, error) {
- ctx = insertMetadata(ctx, c.xGoogMetadata)
+ md := metadata.Pairs("x-goog-request-params", fmt.Sprintf("%s=%v", "metric_name", req.GetMetricName()))
+ ctx = insertMetadata(ctx, c.xGoogMetadata, md)
opts = append(c.CallOptions.GetLogMetric[0:len(c.CallOptions.GetLogMetric):len(c.CallOptions.GetLogMetric)], opts...)
var resp *loggingpb.LogMetric
err := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error {
@@ -183,7 +186,8 @@
// CreateLogMetric creates a logs-based metric.
func (c *MetricsClient) CreateLogMetric(ctx context.Context, req *loggingpb.CreateLogMetricRequest, opts ...gax.CallOption) (*loggingpb.LogMetric, error) {
- ctx = insertMetadata(ctx, c.xGoogMetadata)
+ md := metadata.Pairs("x-goog-request-params", fmt.Sprintf("%s=%v", "parent", req.GetParent()))
+ ctx = insertMetadata(ctx, c.xGoogMetadata, md)
opts = append(c.CallOptions.CreateLogMetric[0:len(c.CallOptions.CreateLogMetric):len(c.CallOptions.CreateLogMetric)], opts...)
var resp *loggingpb.LogMetric
err := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error {
@@ -199,7 +203,8 @@
// UpdateLogMetric creates or updates a logs-based metric.
func (c *MetricsClient) UpdateLogMetric(ctx context.Context, req *loggingpb.UpdateLogMetricRequest, opts ...gax.CallOption) (*loggingpb.LogMetric, error) {
- ctx = insertMetadata(ctx, c.xGoogMetadata)
+ md := metadata.Pairs("x-goog-request-params", fmt.Sprintf("%s=%v", "metric_name", req.GetMetricName()))
+ ctx = insertMetadata(ctx, c.xGoogMetadata, md)
opts = append(c.CallOptions.UpdateLogMetric[0:len(c.CallOptions.UpdateLogMetric):len(c.CallOptions.UpdateLogMetric)], opts...)
var resp *loggingpb.LogMetric
err := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error {
@@ -215,7 +220,8 @@
// DeleteLogMetric deletes a logs-based metric.
func (c *MetricsClient) DeleteLogMetric(ctx context.Context, req *loggingpb.DeleteLogMetricRequest, opts ...gax.CallOption) error {
- ctx = insertMetadata(ctx, c.xGoogMetadata)
+ md := metadata.Pairs("x-goog-request-params", fmt.Sprintf("%s=%v", "metric_name", req.GetMetricName()))
+ ctx = insertMetadata(ctx, c.xGoogMetadata, md)
opts = append(c.CallOptions.DeleteLogMetric[0:len(c.CallOptions.DeleteLogMetric):len(c.CallOptions.DeleteLogMetric)], opts...)
err := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error {
var err error
diff --git a/longrunning/autogen/doc.go b/longrunning/autogen/doc.go
index 8662538..208a92a 100644
--- a/longrunning/autogen/doc.go
+++ b/longrunning/autogen/doc.go
@@ -96,4 +96,4 @@
return "UNKNOWN"
}
-const versionClient = "20190322"
+const versionClient = "20190401"
diff --git a/longrunning/autogen/operations_client.go b/longrunning/autogen/operations_client.go
index 91e33c8..eadaa06 100644
--- a/longrunning/autogen/operations_client.go
+++ b/longrunning/autogen/operations_client.go
@@ -18,6 +18,7 @@
import (
"context"
+ "fmt"
"math"
"time"
@@ -137,7 +138,8 @@
// method to poll the operation result at intervals as recommended by the API
// service.
func (c *OperationsClient) GetOperation(ctx context.Context, req *longrunningpb.GetOperationRequest, opts ...gax.CallOption) (*longrunningpb.Operation, error) {
- ctx = insertMetadata(ctx, c.xGoogMetadata)
+ md := metadata.Pairs("x-goog-request-params", fmt.Sprintf("%s=%v", "name", req.GetName()))
+ ctx = insertMetadata(ctx, c.xGoogMetadata, md)
opts = append(c.CallOptions.GetOperation[0:len(c.CallOptions.GetOperation):len(c.CallOptions.GetOperation)], opts...)
var resp *longrunningpb.Operation
err := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error {
@@ -162,7 +164,8 @@
// collection id, however overriding users must ensure the name binding
// is the parent resource, without the operations collection id.
func (c *OperationsClient) ListOperations(ctx context.Context, req *longrunningpb.ListOperationsRequest, opts ...gax.CallOption) *OperationIterator {
- ctx = insertMetadata(ctx, c.xGoogMetadata)
+ md := metadata.Pairs("x-goog-request-params", fmt.Sprintf("%s=%v", "name", req.GetName()))
+ ctx = insertMetadata(ctx, c.xGoogMetadata, md)
opts = append(c.CallOptions.ListOperations[0:len(c.CallOptions.ListOperations):len(c.CallOptions.ListOperations)], opts...)
it := &OperationIterator{}
req = proto.Clone(req).(*longrunningpb.ListOperationsRequest)
@@ -208,7 +211,8 @@
// an [Operation.error][google.longrunning.Operation.error] value with a [google.rpc.Status.code][google.rpc.Status.code] of 1,
// corresponding to Code.CANCELLED.
func (c *OperationsClient) CancelOperation(ctx context.Context, req *longrunningpb.CancelOperationRequest, opts ...gax.CallOption) error {
- ctx = insertMetadata(ctx, c.xGoogMetadata)
+ md := metadata.Pairs("x-goog-request-params", fmt.Sprintf("%s=%v", "name", req.GetName()))
+ ctx = insertMetadata(ctx, c.xGoogMetadata, md)
opts = append(c.CallOptions.CancelOperation[0:len(c.CallOptions.CancelOperation):len(c.CallOptions.CancelOperation)], opts...)
err := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error {
var err error
@@ -223,7 +227,8 @@
// operation. If the server doesn't support this method, it returns
// google.rpc.Code.UNIMPLEMENTED.
func (c *OperationsClient) DeleteOperation(ctx context.Context, req *longrunningpb.DeleteOperationRequest, opts ...gax.CallOption) error {
- ctx = insertMetadata(ctx, c.xGoogMetadata)
+ md := metadata.Pairs("x-goog-request-params", fmt.Sprintf("%s=%v", "name", req.GetName()))
+ ctx = insertMetadata(ctx, c.xGoogMetadata, md)
opts = append(c.CallOptions.DeleteOperation[0:len(c.CallOptions.DeleteOperation):len(c.CallOptions.DeleteOperation)], opts...)
err := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error {
var err error
diff --git a/monitoring/apiv3/alert_policy_client.go b/monitoring/apiv3/alert_policy_client.go
index a06b50d..1d56e64 100644
--- a/monitoring/apiv3/alert_policy_client.go
+++ b/monitoring/apiv3/alert_policy_client.go
@@ -18,6 +18,7 @@
import (
"context"
+ "fmt"
"math"
"time"
@@ -137,7 +138,8 @@
// ListAlertPolicies lists the existing alerting policies for the project.
func (c *AlertPolicyClient) ListAlertPolicies(ctx context.Context, req *monitoringpb.ListAlertPoliciesRequest, opts ...gax.CallOption) *AlertPolicyIterator {
- ctx = insertMetadata(ctx, c.xGoogMetadata)
+ md := metadata.Pairs("x-goog-request-params", fmt.Sprintf("%s=%v", "name", req.GetName()))
+ ctx = insertMetadata(ctx, c.xGoogMetadata, md)
opts = append(c.CallOptions.ListAlertPolicies[0:len(c.CallOptions.ListAlertPolicies):len(c.CallOptions.ListAlertPolicies)], opts...)
it := &AlertPolicyIterator{}
req = proto.Clone(req).(*monitoringpb.ListAlertPoliciesRequest)
@@ -174,7 +176,8 @@
// GetAlertPolicy gets a single alerting policy.
func (c *AlertPolicyClient) GetAlertPolicy(ctx context.Context, req *monitoringpb.GetAlertPolicyRequest, opts ...gax.CallOption) (*monitoringpb.AlertPolicy, error) {
- ctx = insertMetadata(ctx, c.xGoogMetadata)
+ md := metadata.Pairs("x-goog-request-params", fmt.Sprintf("%s=%v", "name", req.GetName()))
+ ctx = insertMetadata(ctx, c.xGoogMetadata, md)
opts = append(c.CallOptions.GetAlertPolicy[0:len(c.CallOptions.GetAlertPolicy):len(c.CallOptions.GetAlertPolicy)], opts...)
var resp *monitoringpb.AlertPolicy
err := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error {
@@ -190,7 +193,8 @@
// CreateAlertPolicy creates a new alerting policy.
func (c *AlertPolicyClient) CreateAlertPolicy(ctx context.Context, req *monitoringpb.CreateAlertPolicyRequest, opts ...gax.CallOption) (*monitoringpb.AlertPolicy, error) {
- ctx = insertMetadata(ctx, c.xGoogMetadata)
+ md := metadata.Pairs("x-goog-request-params", fmt.Sprintf("%s=%v", "name", req.GetName()))
+ ctx = insertMetadata(ctx, c.xGoogMetadata, md)
opts = append(c.CallOptions.CreateAlertPolicy[0:len(c.CallOptions.CreateAlertPolicy):len(c.CallOptions.CreateAlertPolicy)], opts...)
var resp *monitoringpb.AlertPolicy
err := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error {
@@ -206,7 +210,8 @@
// DeleteAlertPolicy deletes an alerting policy.
func (c *AlertPolicyClient) DeleteAlertPolicy(ctx context.Context, req *monitoringpb.DeleteAlertPolicyRequest, opts ...gax.CallOption) error {
- ctx = insertMetadata(ctx, c.xGoogMetadata)
+ md := metadata.Pairs("x-goog-request-params", fmt.Sprintf("%s=%v", "name", req.GetName()))
+ ctx = insertMetadata(ctx, c.xGoogMetadata, md)
opts = append(c.CallOptions.DeleteAlertPolicy[0:len(c.CallOptions.DeleteAlertPolicy):len(c.CallOptions.DeleteAlertPolicy)], opts...)
err := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error {
var err error
@@ -221,7 +226,8 @@
// specifying the fields to be updated via updateMask. Returns the
// updated alerting policy.
func (c *AlertPolicyClient) UpdateAlertPolicy(ctx context.Context, req *monitoringpb.UpdateAlertPolicyRequest, opts ...gax.CallOption) (*monitoringpb.AlertPolicy, error) {
- ctx = insertMetadata(ctx, c.xGoogMetadata)
+ md := metadata.Pairs("x-goog-request-params", fmt.Sprintf("%s=%v", "alert_policy.name", req.GetAlertPolicy().GetName()))
+ ctx = insertMetadata(ctx, c.xGoogMetadata, md)
opts = append(c.CallOptions.UpdateAlertPolicy[0:len(c.CallOptions.UpdateAlertPolicy):len(c.CallOptions.UpdateAlertPolicy)], opts...)
var resp *monitoringpb.AlertPolicy
err := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error {
diff --git a/monitoring/apiv3/doc.go b/monitoring/apiv3/doc.go
index f3dc7cd..8d8a2d7 100644
--- a/monitoring/apiv3/doc.go
+++ b/monitoring/apiv3/doc.go
@@ -102,4 +102,4 @@
return "UNKNOWN"
}
-const versionClient = "20190322"
+const versionClient = "20190401"
diff --git a/monitoring/apiv3/group_client.go b/monitoring/apiv3/group_client.go
index 30e5f4a..84f4ec6 100644
--- a/monitoring/apiv3/group_client.go
+++ b/monitoring/apiv3/group_client.go
@@ -18,6 +18,7 @@
import (
"context"
+ "fmt"
"math"
"time"
@@ -143,7 +144,8 @@
// ListGroups lists the existing groups.
func (c *GroupClient) ListGroups(ctx context.Context, req *monitoringpb.ListGroupsRequest, opts ...gax.CallOption) *GroupIterator {
- ctx = insertMetadata(ctx, c.xGoogMetadata)
+ md := metadata.Pairs("x-goog-request-params", fmt.Sprintf("%s=%v", "name", req.GetName()))
+ ctx = insertMetadata(ctx, c.xGoogMetadata, md)
opts = append(c.CallOptions.ListGroups[0:len(c.CallOptions.ListGroups):len(c.CallOptions.ListGroups)], opts...)
it := &GroupIterator{}
req = proto.Clone(req).(*monitoringpb.ListGroupsRequest)
@@ -180,7 +182,8 @@
// GetGroup gets a single group.
func (c *GroupClient) GetGroup(ctx context.Context, req *monitoringpb.GetGroupRequest, opts ...gax.CallOption) (*monitoringpb.Group, error) {
- ctx = insertMetadata(ctx, c.xGoogMetadata)
+ md := metadata.Pairs("x-goog-request-params", fmt.Sprintf("%s=%v", "name", req.GetName()))
+ ctx = insertMetadata(ctx, c.xGoogMetadata, md)
opts = append(c.CallOptions.GetGroup[0:len(c.CallOptions.GetGroup):len(c.CallOptions.GetGroup)], opts...)
var resp *monitoringpb.Group
err := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error {
@@ -196,7 +199,8 @@
// CreateGroup creates a new group.
func (c *GroupClient) CreateGroup(ctx context.Context, req *monitoringpb.CreateGroupRequest, opts ...gax.CallOption) (*monitoringpb.Group, error) {
- ctx = insertMetadata(ctx, c.xGoogMetadata)
+ md := metadata.Pairs("x-goog-request-params", fmt.Sprintf("%s=%v", "name", req.GetName()))
+ ctx = insertMetadata(ctx, c.xGoogMetadata, md)
opts = append(c.CallOptions.CreateGroup[0:len(c.CallOptions.CreateGroup):len(c.CallOptions.CreateGroup)], opts...)
var resp *monitoringpb.Group
err := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error {
@@ -213,7 +217,8 @@
// UpdateGroup updates an existing group.
// You can change any group attributes except name.
func (c *GroupClient) UpdateGroup(ctx context.Context, req *monitoringpb.UpdateGroupRequest, opts ...gax.CallOption) (*monitoringpb.Group, error) {
- ctx = insertMetadata(ctx, c.xGoogMetadata)
+ md := metadata.Pairs("x-goog-request-params", fmt.Sprintf("%s=%v", "group.name", req.GetGroup().GetName()))
+ ctx = insertMetadata(ctx, c.xGoogMetadata, md)
opts = append(c.CallOptions.UpdateGroup[0:len(c.CallOptions.UpdateGroup):len(c.CallOptions.UpdateGroup)], opts...)
var resp *monitoringpb.Group
err := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error {
@@ -229,7 +234,8 @@
// DeleteGroup deletes an existing group.
func (c *GroupClient) DeleteGroup(ctx context.Context, req *monitoringpb.DeleteGroupRequest, opts ...gax.CallOption) error {
- ctx = insertMetadata(ctx, c.xGoogMetadata)
+ md := metadata.Pairs("x-goog-request-params", fmt.Sprintf("%s=%v", "name", req.GetName()))
+ ctx = insertMetadata(ctx, c.xGoogMetadata, md)
opts = append(c.CallOptions.DeleteGroup[0:len(c.CallOptions.DeleteGroup):len(c.CallOptions.DeleteGroup)], opts...)
err := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error {
var err error
@@ -241,7 +247,8 @@
// ListGroupMembers lists the monitored resources that are members of a group.
func (c *GroupClient) ListGroupMembers(ctx context.Context, req *monitoringpb.ListGroupMembersRequest, opts ...gax.CallOption) *MonitoredResourceIterator {
- ctx = insertMetadata(ctx, c.xGoogMetadata)
+ md := metadata.Pairs("x-goog-request-params", fmt.Sprintf("%s=%v", "name", req.GetName()))
+ ctx = insertMetadata(ctx, c.xGoogMetadata, md)
opts = append(c.CallOptions.ListGroupMembers[0:len(c.CallOptions.ListGroupMembers):len(c.CallOptions.ListGroupMembers)], opts...)
it := &MonitoredResourceIterator{}
req = proto.Clone(req).(*monitoringpb.ListGroupMembersRequest)
diff --git a/monitoring/apiv3/metric_client.go b/monitoring/apiv3/metric_client.go
index 7162d62..167c168 100644
--- a/monitoring/apiv3/metric_client.go
+++ b/monitoring/apiv3/metric_client.go
@@ -18,6 +18,7 @@
import (
"context"
+ "fmt"
"math"
"time"
@@ -139,7 +140,8 @@
// ListMonitoredResourceDescriptors lists monitored resource descriptors that match a filter. This method does
// not require a Stackdriver account.
func (c *MetricClient) ListMonitoredResourceDescriptors(ctx context.Context, req *monitoringpb.ListMonitoredResourceDescriptorsRequest, opts ...gax.CallOption) *MonitoredResourceDescriptorIterator {
- ctx = insertMetadata(ctx, c.xGoogMetadata)
+ md := metadata.Pairs("x-goog-request-params", fmt.Sprintf("%s=%v", "name", req.GetName()))
+ ctx = insertMetadata(ctx, c.xGoogMetadata, md)
opts = append(c.CallOptions.ListMonitoredResourceDescriptors[0:len(c.CallOptions.ListMonitoredResourceDescriptors):len(c.CallOptions.ListMonitoredResourceDescriptors)], opts...)
it := &MonitoredResourceDescriptorIterator{}
req = proto.Clone(req).(*monitoringpb.ListMonitoredResourceDescriptorsRequest)
@@ -177,7 +179,8 @@
// GetMonitoredResourceDescriptor gets a single monitored resource descriptor. This method does not require a
// Stackdriver account.
func (c *MetricClient) GetMonitoredResourceDescriptor(ctx context.Context, req *monitoringpb.GetMonitoredResourceDescriptorRequest, opts ...gax.CallOption) (*monitoredrespb.MonitoredResourceDescriptor, error) {
- ctx = insertMetadata(ctx, c.xGoogMetadata)
+ md := metadata.Pairs("x-goog-request-params", fmt.Sprintf("%s=%v", "name", req.GetName()))
+ ctx = insertMetadata(ctx, c.xGoogMetadata, md)
opts = append(c.CallOptions.GetMonitoredResourceDescriptor[0:len(c.CallOptions.GetMonitoredResourceDescriptor):len(c.CallOptions.GetMonitoredResourceDescriptor)], opts...)
var resp *monitoredrespb.MonitoredResourceDescriptor
err := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error {
@@ -194,7 +197,8 @@
// ListMetricDescriptors lists metric descriptors that match a filter. This method does not require
// a Stackdriver account.
func (c *MetricClient) ListMetricDescriptors(ctx context.Context, req *monitoringpb.ListMetricDescriptorsRequest, opts ...gax.CallOption) *MetricDescriptorIterator {
- ctx = insertMetadata(ctx, c.xGoogMetadata)
+ md := metadata.Pairs("x-goog-request-params", fmt.Sprintf("%s=%v", "name", req.GetName()))
+ ctx = insertMetadata(ctx, c.xGoogMetadata, md)
opts = append(c.CallOptions.ListMetricDescriptors[0:len(c.CallOptions.ListMetricDescriptors):len(c.CallOptions.ListMetricDescriptors)], opts...)
it := &MetricDescriptorIterator{}
req = proto.Clone(req).(*monitoringpb.ListMetricDescriptorsRequest)
@@ -232,7 +236,8 @@
// GetMetricDescriptor gets a single metric descriptor. This method does not require a Stackdriver
// account.
func (c *MetricClient) GetMetricDescriptor(ctx context.Context, req *monitoringpb.GetMetricDescriptorRequest, opts ...gax.CallOption) (*metricpb.MetricDescriptor, error) {
- ctx = insertMetadata(ctx, c.xGoogMetadata)
+ md := metadata.Pairs("x-goog-request-params", fmt.Sprintf("%s=%v", "name", req.GetName()))
+ ctx = insertMetadata(ctx, c.xGoogMetadata, md)
opts = append(c.CallOptions.GetMetricDescriptor[0:len(c.CallOptions.GetMetricDescriptor):len(c.CallOptions.GetMetricDescriptor)], opts...)
var resp *metricpb.MetricDescriptor
err := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error {
@@ -250,7 +255,8 @@
// User-created metric descriptors define
// custom metrics (at /monitoring/custom-metrics).
func (c *MetricClient) CreateMetricDescriptor(ctx context.Context, req *monitoringpb.CreateMetricDescriptorRequest, opts ...gax.CallOption) (*metricpb.MetricDescriptor, error) {
- ctx = insertMetadata(ctx, c.xGoogMetadata)
+ md := metadata.Pairs("x-goog-request-params", fmt.Sprintf("%s=%v", "name", req.GetName()))
+ ctx = insertMetadata(ctx, c.xGoogMetadata, md)
opts = append(c.CallOptions.CreateMetricDescriptor[0:len(c.CallOptions.CreateMetricDescriptor):len(c.CallOptions.CreateMetricDescriptor)], opts...)
var resp *metricpb.MetricDescriptor
err := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error {
@@ -267,7 +273,8 @@
// DeleteMetricDescriptor deletes a metric descriptor. Only user-created
// custom metrics (at /monitoring/custom-metrics) can be deleted.
func (c *MetricClient) DeleteMetricDescriptor(ctx context.Context, req *monitoringpb.DeleteMetricDescriptorRequest, opts ...gax.CallOption) error {
- ctx = insertMetadata(ctx, c.xGoogMetadata)
+ md := metadata.Pairs("x-goog-request-params", fmt.Sprintf("%s=%v", "name", req.GetName()))
+ ctx = insertMetadata(ctx, c.xGoogMetadata, md)
opts = append(c.CallOptions.DeleteMetricDescriptor[0:len(c.CallOptions.DeleteMetricDescriptor):len(c.CallOptions.DeleteMetricDescriptor)], opts...)
err := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error {
var err error
@@ -280,7 +287,8 @@
// ListTimeSeries lists time series that match a filter. This method does not require a
// Stackdriver account.
func (c *MetricClient) ListTimeSeries(ctx context.Context, req *monitoringpb.ListTimeSeriesRequest, opts ...gax.CallOption) *TimeSeriesIterator {
- ctx = insertMetadata(ctx, c.xGoogMetadata)
+ md := metadata.Pairs("x-goog-request-params", fmt.Sprintf("%s=%v", "name", req.GetName()))
+ ctx = insertMetadata(ctx, c.xGoogMetadata, md)
opts = append(c.CallOptions.ListTimeSeries[0:len(c.CallOptions.ListTimeSeries):len(c.CallOptions.ListTimeSeries)], opts...)
it := &TimeSeriesIterator{}
req = proto.Clone(req).(*monitoringpb.ListTimeSeriesRequest)
@@ -320,7 +328,8 @@
// If any time series could not be written, a corresponding failure message is
// included in the error response.
func (c *MetricClient) CreateTimeSeries(ctx context.Context, req *monitoringpb.CreateTimeSeriesRequest, opts ...gax.CallOption) error {
- ctx = insertMetadata(ctx, c.xGoogMetadata)
+ md := metadata.Pairs("x-goog-request-params", fmt.Sprintf("%s=%v", "name", req.GetName()))
+ ctx = insertMetadata(ctx, c.xGoogMetadata, md)
opts = append(c.CallOptions.CreateTimeSeries[0:len(c.CallOptions.CreateTimeSeries):len(c.CallOptions.CreateTimeSeries)], opts...)
err := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error {
var err error
diff --git a/monitoring/apiv3/notification_channel_client.go b/monitoring/apiv3/notification_channel_client.go
index dc24183..cc7527c 100644
--- a/monitoring/apiv3/notification_channel_client.go
+++ b/monitoring/apiv3/notification_channel_client.go
@@ -18,6 +18,7 @@
import (
"context"
+ "fmt"
"math"
"time"
@@ -135,7 +136,8 @@
// ListNotificationChannelDescriptors lists the descriptors for supported channel types. The use of descriptors
// makes it possible for new channel types to be dynamically added.
func (c *NotificationChannelClient) ListNotificationChannelDescriptors(ctx context.Context, req *monitoringpb.ListNotificationChannelDescriptorsRequest, opts ...gax.CallOption) *NotificationChannelDescriptorIterator {
- ctx = insertMetadata(ctx, c.xGoogMetadata)
+ md := metadata.Pairs("x-goog-request-params", fmt.Sprintf("%s=%v", "name", req.GetName()))
+ ctx = insertMetadata(ctx, c.xGoogMetadata, md)
opts = append(c.CallOptions.ListNotificationChannelDescriptors[0:len(c.CallOptions.ListNotificationChannelDescriptors):len(c.CallOptions.ListNotificationChannelDescriptors)], opts...)
it := &NotificationChannelDescriptorIterator{}
req = proto.Clone(req).(*monitoringpb.ListNotificationChannelDescriptorsRequest)
@@ -173,7 +175,8 @@
// GetNotificationChannelDescriptor gets a single channel descriptor. The descriptor indicates which fields
// are expected / permitted for a notification channel of the given type.
func (c *NotificationChannelClient) GetNotificationChannelDescriptor(ctx context.Context, req *monitoringpb.GetNotificationChannelDescriptorRequest, opts ...gax.CallOption) (*monitoringpb.NotificationChannelDescriptor, error) {
- ctx = insertMetadata(ctx, c.xGoogMetadata)
+ md := metadata.Pairs("x-goog-request-params", fmt.Sprintf("%s=%v", "name", req.GetName()))
+ ctx = insertMetadata(ctx, c.xGoogMetadata, md)
opts = append(c.CallOptions.GetNotificationChannelDescriptor[0:len(c.CallOptions.GetNotificationChannelDescriptor):len(c.CallOptions.GetNotificationChannelDescriptor)], opts...)
var resp *monitoringpb.NotificationChannelDescriptor
err := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error {
@@ -189,7 +192,8 @@
// ListNotificationChannels lists the notification channels that have been created for the project.
func (c *NotificationChannelClient) ListNotificationChannels(ctx context.Context, req *monitoringpb.ListNotificationChannelsRequest, opts ...gax.CallOption) *NotificationChannelIterator {
- ctx = insertMetadata(ctx, c.xGoogMetadata)
+ md := metadata.Pairs("x-goog-request-params", fmt.Sprintf("%s=%v", "name", req.GetName()))
+ ctx = insertMetadata(ctx, c.xGoogMetadata, md)
opts = append(c.CallOptions.ListNotificationChannels[0:len(c.CallOptions.ListNotificationChannels):len(c.CallOptions.ListNotificationChannels)], opts...)
it := &NotificationChannelIterator{}
req = proto.Clone(req).(*monitoringpb.ListNotificationChannelsRequest)
@@ -230,7 +234,8 @@
// matter and thus the response may not be 100% identical to the information
// that was supplied in the call to the create method.
func (c *NotificationChannelClient) GetNotificationChannel(ctx context.Context, req *monitoringpb.GetNotificationChannelRequest, opts ...gax.CallOption) (*monitoringpb.NotificationChannel, error) {
- ctx = insertMetadata(ctx, c.xGoogMetadata)
+ md := metadata.Pairs("x-goog-request-params", fmt.Sprintf("%s=%v", "name", req.GetName()))
+ ctx = insertMetadata(ctx, c.xGoogMetadata, md)
opts = append(c.CallOptions.GetNotificationChannel[0:len(c.CallOptions.GetNotificationChannel):len(c.CallOptions.GetNotificationChannel)], opts...)
var resp *monitoringpb.NotificationChannel
err := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error {
@@ -247,7 +252,8 @@
// CreateNotificationChannel creates a new notification channel, representing a single notification
// endpoint such as an email address, SMS number, or PagerDuty service.
func (c *NotificationChannelClient) CreateNotificationChannel(ctx context.Context, req *monitoringpb.CreateNotificationChannelRequest, opts ...gax.CallOption) (*monitoringpb.NotificationChannel, error) {
- ctx = insertMetadata(ctx, c.xGoogMetadata)
+ md := metadata.Pairs("x-goog-request-params", fmt.Sprintf("%s=%v", "name", req.GetName()))
+ ctx = insertMetadata(ctx, c.xGoogMetadata, md)
opts = append(c.CallOptions.CreateNotificationChannel[0:len(c.CallOptions.CreateNotificationChannel):len(c.CallOptions.CreateNotificationChannel)], opts...)
var resp *monitoringpb.NotificationChannel
err := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error {
@@ -264,7 +270,8 @@
// UpdateNotificationChannel updates a notification channel. Fields not specified in the field mask
// remain unchanged.
func (c *NotificationChannelClient) UpdateNotificationChannel(ctx context.Context, req *monitoringpb.UpdateNotificationChannelRequest, opts ...gax.CallOption) (*monitoringpb.NotificationChannel, error) {
- ctx = insertMetadata(ctx, c.xGoogMetadata)
+ md := metadata.Pairs("x-goog-request-params", fmt.Sprintf("%s=%v", "notification_channel.name", req.GetNotificationChannel().GetName()))
+ ctx = insertMetadata(ctx, c.xGoogMetadata, md)
opts = append(c.CallOptions.UpdateNotificationChannel[0:len(c.CallOptions.UpdateNotificationChannel):len(c.CallOptions.UpdateNotificationChannel)], opts...)
var resp *monitoringpb.NotificationChannel
err := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error {
@@ -280,7 +287,8 @@
// DeleteNotificationChannel deletes a notification channel.
func (c *NotificationChannelClient) DeleteNotificationChannel(ctx context.Context, req *monitoringpb.DeleteNotificationChannelRequest, opts ...gax.CallOption) error {
- ctx = insertMetadata(ctx, c.xGoogMetadata)
+ md := metadata.Pairs("x-goog-request-params", fmt.Sprintf("%s=%v", "name", req.GetName()))
+ ctx = insertMetadata(ctx, c.xGoogMetadata, md)
opts = append(c.CallOptions.DeleteNotificationChannel[0:len(c.CallOptions.DeleteNotificationChannel):len(c.CallOptions.DeleteNotificationChannel)], opts...)
err := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error {
var err error
diff --git a/monitoring/apiv3/uptime_check_client.go b/monitoring/apiv3/uptime_check_client.go
index 759abbb..9eed7b1 100644
--- a/monitoring/apiv3/uptime_check_client.go
+++ b/monitoring/apiv3/uptime_check_client.go
@@ -18,6 +18,7 @@
import (
"context"
+ "fmt"
"math"
"time"
@@ -139,7 +140,8 @@
// ListUptimeCheckConfigs lists the existing valid uptime check configurations for the project,
// leaving out any invalid configurations.
func (c *UptimeCheckClient) ListUptimeCheckConfigs(ctx context.Context, req *monitoringpb.ListUptimeCheckConfigsRequest, opts ...gax.CallOption) *UptimeCheckConfigIterator {
- ctx = insertMetadata(ctx, c.xGoogMetadata)
+ md := metadata.Pairs("x-goog-request-params", fmt.Sprintf("%s=%v", "parent", req.GetParent()))
+ ctx = insertMetadata(ctx, c.xGoogMetadata, md)
opts = append(c.CallOptions.ListUptimeCheckConfigs[0:len(c.CallOptions.ListUptimeCheckConfigs):len(c.CallOptions.ListUptimeCheckConfigs)], opts...)
it := &UptimeCheckConfigIterator{}
req = proto.Clone(req).(*monitoringpb.ListUptimeCheckConfigsRequest)
@@ -176,7 +178,8 @@
// GetUptimeCheckConfig gets a single uptime check configuration.
func (c *UptimeCheckClient) GetUptimeCheckConfig(ctx context.Context, req *monitoringpb.GetUptimeCheckConfigRequest, opts ...gax.CallOption) (*monitoringpb.UptimeCheckConfig, error) {
- ctx = insertMetadata(ctx, c.xGoogMetadata)
+ md := metadata.Pairs("x-goog-request-params", fmt.Sprintf("%s=%v", "name", req.GetName()))
+ ctx = insertMetadata(ctx, c.xGoogMetadata, md)
opts = append(c.CallOptions.GetUptimeCheckConfig[0:len(c.CallOptions.GetUptimeCheckConfig):len(c.CallOptions.GetUptimeCheckConfig)], opts...)
var resp *monitoringpb.UptimeCheckConfig
err := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error {
@@ -192,7 +195,8 @@
// CreateUptimeCheckConfig creates a new uptime check configuration.
func (c *UptimeCheckClient) CreateUptimeCheckConfig(ctx context.Context, req *monitoringpb.CreateUptimeCheckConfigRequest, opts ...gax.CallOption) (*monitoringpb.UptimeCheckConfig, error) {
- ctx = insertMetadata(ctx, c.xGoogMetadata)
+ md := metadata.Pairs("x-goog-request-params", fmt.Sprintf("%s=%v", "parent", req.GetParent()))
+ ctx = insertMetadata(ctx, c.xGoogMetadata, md)
opts = append(c.CallOptions.CreateUptimeCheckConfig[0:len(c.CallOptions.CreateUptimeCheckConfig):len(c.CallOptions.CreateUptimeCheckConfig)], opts...)
var resp *monitoringpb.UptimeCheckConfig
err := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error {
@@ -211,7 +215,8 @@
// configuration by specifying the fields to be updated via "updateMask".
// Returns the updated configuration.
func (c *UptimeCheckClient) UpdateUptimeCheckConfig(ctx context.Context, req *monitoringpb.UpdateUptimeCheckConfigRequest, opts ...gax.CallOption) (*monitoringpb.UptimeCheckConfig, error) {
- ctx = insertMetadata(ctx, c.xGoogMetadata)
+ md := metadata.Pairs("x-goog-request-params", fmt.Sprintf("%s=%v", "uptime_check_config.name", req.GetUptimeCheckConfig().GetName()))
+ ctx = insertMetadata(ctx, c.xGoogMetadata, md)
opts = append(c.CallOptions.UpdateUptimeCheckConfig[0:len(c.CallOptions.UpdateUptimeCheckConfig):len(c.CallOptions.UpdateUptimeCheckConfig)], opts...)
var resp *monitoringpb.UptimeCheckConfig
err := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error {
@@ -229,7 +234,8 @@
// if the uptime check configuration is referenced by an alert policy or
// other dependent configs that would be rendered invalid by the deletion.
func (c *UptimeCheckClient) DeleteUptimeCheckConfig(ctx context.Context, req *monitoringpb.DeleteUptimeCheckConfigRequest, opts ...gax.CallOption) error {
- ctx = insertMetadata(ctx, c.xGoogMetadata)
+ md := metadata.Pairs("x-goog-request-params", fmt.Sprintf("%s=%v", "name", req.GetName()))
+ ctx = insertMetadata(ctx, c.xGoogMetadata, md)
opts = append(c.CallOptions.DeleteUptimeCheckConfig[0:len(c.CallOptions.DeleteUptimeCheckConfig):len(c.CallOptions.DeleteUptimeCheckConfig)], opts...)
err := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error {
var err error
diff --git a/oslogin/apiv1/doc.go b/oslogin/apiv1/doc.go
index 5f5dd10..b198215 100644
--- a/oslogin/apiv1/doc.go
+++ b/oslogin/apiv1/doc.go
@@ -100,4 +100,4 @@
return "UNKNOWN"
}
-const versionClient = "20190322"
+const versionClient = "20190401"
diff --git a/oslogin/apiv1/os_login_client.go b/oslogin/apiv1/os_login_client.go
index b1bec45..74c3b65 100644
--- a/oslogin/apiv1/os_login_client.go
+++ b/oslogin/apiv1/os_login_client.go
@@ -18,6 +18,7 @@
import (
"context"
+ "fmt"
"time"
gax "github.com/googleapis/gax-go/v2"
@@ -132,7 +133,8 @@
// DeletePosixAccount deletes a POSIX account.
func (c *Client) DeletePosixAccount(ctx context.Context, req *osloginpb.DeletePosixAccountRequest, opts ...gax.CallOption) error {
- ctx = insertMetadata(ctx, c.xGoogMetadata)
+ md := metadata.Pairs("x-goog-request-params", fmt.Sprintf("%s=%v", "name", req.GetName()))
+ ctx = insertMetadata(ctx, c.xGoogMetadata, md)
opts = append(c.CallOptions.DeletePosixAccount[0:len(c.CallOptions.DeletePosixAccount):len(c.CallOptions.DeletePosixAccount)], opts...)
err := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error {
var err error
@@ -144,7 +146,8 @@
// DeleteSshPublicKey deletes an SSH public key.
func (c *Client) DeleteSshPublicKey(ctx context.Context, req *osloginpb.DeleteSshPublicKeyRequest, opts ...gax.CallOption) error {
- ctx = insertMetadata(ctx, c.xGoogMetadata)
+ md := metadata.Pairs("x-goog-request-params", fmt.Sprintf("%s=%v", "name", req.GetName()))
+ ctx = insertMetadata(ctx, c.xGoogMetadata, md)
opts = append(c.CallOptions.DeleteSshPublicKey[0:len(c.CallOptions.DeleteSshPublicKey):len(c.CallOptions.DeleteSshPublicKey)], opts...)
err := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error {
var err error
@@ -157,7 +160,8 @@
// GetLoginProfile retrieves the profile information used for logging in to a virtual machine
// on Google Compute Engine.
func (c *Client) GetLoginProfile(ctx context.Context, req *osloginpb.GetLoginProfileRequest, opts ...gax.CallOption) (*osloginpb.LoginProfile, error) {
- ctx = insertMetadata(ctx, c.xGoogMetadata)
+ md := metadata.Pairs("x-goog-request-params", fmt.Sprintf("%s=%v", "name", req.GetName()))
+ ctx = insertMetadata(ctx, c.xGoogMetadata, md)
opts = append(c.CallOptions.GetLoginProfile[0:len(c.CallOptions.GetLoginProfile):len(c.CallOptions.GetLoginProfile)], opts...)
var resp *osloginpb.LoginProfile
err := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error {
@@ -173,7 +177,8 @@
// GetSshPublicKey retrieves an SSH public key.
func (c *Client) GetSshPublicKey(ctx context.Context, req *osloginpb.GetSshPublicKeyRequest, opts ...gax.CallOption) (*commonpb.SshPublicKey, error) {
- ctx = insertMetadata(ctx, c.xGoogMetadata)
+ md := metadata.Pairs("x-goog-request-params", fmt.Sprintf("%s=%v", "name", req.GetName()))
+ ctx = insertMetadata(ctx, c.xGoogMetadata, md)
opts = append(c.CallOptions.GetSshPublicKey[0:len(c.CallOptions.GetSshPublicKey):len(c.CallOptions.GetSshPublicKey)], opts...)
var resp *commonpb.SshPublicKey
err := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error {
@@ -191,7 +196,8 @@
// account information is set when no username and UID exist as part of the
// login profile.
func (c *Client) ImportSshPublicKey(ctx context.Context, req *osloginpb.ImportSshPublicKeyRequest, opts ...gax.CallOption) (*osloginpb.ImportSshPublicKeyResponse, error) {
- ctx = insertMetadata(ctx, c.xGoogMetadata)
+ md := metadata.Pairs("x-goog-request-params", fmt.Sprintf("%s=%v", "parent", req.GetParent()))
+ ctx = insertMetadata(ctx, c.xGoogMetadata, md)
opts = append(c.CallOptions.ImportSshPublicKey[0:len(c.CallOptions.ImportSshPublicKey):len(c.CallOptions.ImportSshPublicKey)], opts...)
var resp *osloginpb.ImportSshPublicKeyResponse
err := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error {
@@ -208,7 +214,8 @@
// UpdateSshPublicKey updates an SSH public key and returns the profile information. This method
// supports patch semantics.
func (c *Client) UpdateSshPublicKey(ctx context.Context, req *osloginpb.UpdateSshPublicKeyRequest, opts ...gax.CallOption) (*commonpb.SshPublicKey, error) {
- ctx = insertMetadata(ctx, c.xGoogMetadata)
+ md := metadata.Pairs("x-goog-request-params", fmt.Sprintf("%s=%v", "name", req.GetName()))
+ ctx = insertMetadata(ctx, c.xGoogMetadata, md)
opts = append(c.CallOptions.UpdateSshPublicKey[0:len(c.CallOptions.UpdateSshPublicKey):len(c.CallOptions.UpdateSshPublicKey)], opts...)
var resp *commonpb.SshPublicKey
err := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error {
diff --git a/oslogin/apiv1beta/doc.go b/oslogin/apiv1beta/doc.go
index 24fb628..83f838c 100644
--- a/oslogin/apiv1beta/doc.go
+++ b/oslogin/apiv1beta/doc.go
@@ -100,4 +100,4 @@
return "UNKNOWN"
}
-const versionClient = "20190322"
+const versionClient = "20190401"
diff --git a/oslogin/apiv1beta/os_login_client.go b/oslogin/apiv1beta/os_login_client.go
index 14ea89f..77abeac 100644
--- a/oslogin/apiv1beta/os_login_client.go
+++ b/oslogin/apiv1beta/os_login_client.go
@@ -18,6 +18,7 @@
import (
"context"
+ "fmt"
"time"
gax "github.com/googleapis/gax-go/v2"
@@ -132,7 +133,8 @@
// DeletePosixAccount deletes a POSIX account.
func (c *Client) DeletePosixAccount(ctx context.Context, req *osloginpb.DeletePosixAccountRequest, opts ...gax.CallOption) error {
- ctx = insertMetadata(ctx, c.xGoogMetadata)
+ md := metadata.Pairs("x-goog-request-params", fmt.Sprintf("%s=%v", "name", req.GetName()))
+ ctx = insertMetadata(ctx, c.xGoogMetadata, md)
opts = append(c.CallOptions.DeletePosixAccount[0:len(c.CallOptions.DeletePosixAccount):len(c.CallOptions.DeletePosixAccount)], opts...)
err := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error {
var err error
@@ -144,7 +146,8 @@
// DeleteSshPublicKey deletes an SSH public key.
func (c *Client) DeleteSshPublicKey(ctx context.Context, req *osloginpb.DeleteSshPublicKeyRequest, opts ...gax.CallOption) error {
- ctx = insertMetadata(ctx, c.xGoogMetadata)
+ md := metadata.Pairs("x-goog-request-params", fmt.Sprintf("%s=%v", "name", req.GetName()))
+ ctx = insertMetadata(ctx, c.xGoogMetadata, md)
opts = append(c.CallOptions.DeleteSshPublicKey[0:len(c.CallOptions.DeleteSshPublicKey):len(c.CallOptions.DeleteSshPublicKey)], opts...)
err := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error {
var err error
@@ -157,7 +160,8 @@
// GetLoginProfile retrieves the profile information used for logging in to a virtual machine
// on Google Compute Engine.
func (c *Client) GetLoginProfile(ctx context.Context, req *osloginpb.GetLoginProfileRequest, opts ...gax.CallOption) (*osloginpb.LoginProfile, error) {
- ctx = insertMetadata(ctx, c.xGoogMetadata)
+ md := metadata.Pairs("x-goog-request-params", fmt.Sprintf("%s=%v", "name", req.GetName()))
+ ctx = insertMetadata(ctx, c.xGoogMetadata, md)
opts = append(c.CallOptions.GetLoginProfile[0:len(c.CallOptions.GetLoginProfile):len(c.CallOptions.GetLoginProfile)], opts...)
var resp *osloginpb.LoginProfile
err := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error {
@@ -173,7 +177,8 @@
// GetSshPublicKey retrieves an SSH public key.
func (c *Client) GetSshPublicKey(ctx context.Context, req *osloginpb.GetSshPublicKeyRequest, opts ...gax.CallOption) (*commonpb.SshPublicKey, error) {
- ctx = insertMetadata(ctx, c.xGoogMetadata)
+ md := metadata.Pairs("x-goog-request-params", fmt.Sprintf("%s=%v", "name", req.GetName()))
+ ctx = insertMetadata(ctx, c.xGoogMetadata, md)
opts = append(c.CallOptions.GetSshPublicKey[0:len(c.CallOptions.GetSshPublicKey):len(c.CallOptions.GetSshPublicKey)], opts...)
var resp *commonpb.SshPublicKey
err := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error {
@@ -191,7 +196,8 @@
// account information is set when no username and UID exist as part of the
// login profile.
func (c *Client) ImportSshPublicKey(ctx context.Context, req *osloginpb.ImportSshPublicKeyRequest, opts ...gax.CallOption) (*osloginpb.ImportSshPublicKeyResponse, error) {
- ctx = insertMetadata(ctx, c.xGoogMetadata)
+ md := metadata.Pairs("x-goog-request-params", fmt.Sprintf("%s=%v", "parent", req.GetParent()))
+ ctx = insertMetadata(ctx, c.xGoogMetadata, md)
opts = append(c.CallOptions.ImportSshPublicKey[0:len(c.CallOptions.ImportSshPublicKey):len(c.CallOptions.ImportSshPublicKey)], opts...)
var resp *osloginpb.ImportSshPublicKeyResponse
err := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error {
@@ -208,7 +214,8 @@
// UpdateSshPublicKey updates an SSH public key and returns the profile information. This method
// supports patch semantics.
func (c *Client) UpdateSshPublicKey(ctx context.Context, req *osloginpb.UpdateSshPublicKeyRequest, opts ...gax.CallOption) (*commonpb.SshPublicKey, error) {
- ctx = insertMetadata(ctx, c.xGoogMetadata)
+ md := metadata.Pairs("x-goog-request-params", fmt.Sprintf("%s=%v", "name", req.GetName()))
+ ctx = insertMetadata(ctx, c.xGoogMetadata, md)
opts = append(c.CallOptions.UpdateSshPublicKey[0:len(c.CallOptions.UpdateSshPublicKey):len(c.CallOptions.UpdateSshPublicKey)], opts...)
var resp *commonpb.SshPublicKey
err := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error {
diff --git a/pubsub/apiv1/doc.go b/pubsub/apiv1/doc.go
index a27f1b3..efb37df 100644
--- a/pubsub/apiv1/doc.go
+++ b/pubsub/apiv1/doc.go
@@ -100,4 +100,4 @@
return "UNKNOWN"
}
-const versionClient = "20190326"
+const versionClient = "20190401"
diff --git a/pubsub/apiv1/mock_test.go b/pubsub/apiv1/mock_test.go
index be65c63..17e4872 100644
--- a/pubsub/apiv1/mock_test.go
+++ b/pubsub/apiv1/mock_test.go
@@ -19,7 +19,6 @@
import (
emptypb "github.com/golang/protobuf/ptypes/empty"
timestamppb "github.com/golang/protobuf/ptypes/timestamp"
- iampb "google.golang.org/genproto/googleapis/iam/v1"
pubsubpb "google.golang.org/genproto/googleapis/pubsub/v1"
field_maskpb "google.golang.org/genproto/protobuf/field_mask"
)
@@ -148,57 +147,6 @@
return s.resps[0].(*emptypb.Empty), nil
}
-type mockIamPolicyServer struct {
- // Embed for forward compatibility.
- // Tests will keep working if more methods are added
- // in the future.
- iampb.IAMPolicyServer
-
- reqs []proto.Message
-
- // If set, all calls return this error.
- err error
-
- // responses to return if err == nil
- resps []proto.Message
-}
-
-func (s *mockIamPolicyServer) SetIamPolicy(ctx context.Context, req *iampb.SetIamPolicyRequest) (*iampb.Policy, error) {
- md, _ := metadata.FromIncomingContext(ctx)
- if xg := md["x-goog-api-client"]; len(xg) == 0 || !strings.Contains(xg[0], "gl-go/") {
- return nil, fmt.Errorf("x-goog-api-client = %v, expected gl-go key", xg)
- }
- s.reqs = append(s.reqs, req)
- if s.err != nil {
- return nil, s.err
- }
- return s.resps[0].(*iampb.Policy), nil
-}
-
-func (s *mockIamPolicyServer) GetIamPolicy(ctx context.Context, req *iampb.GetIamPolicyRequest) (*iampb.Policy, error) {
- md, _ := metadata.FromIncomingContext(ctx)
- if xg := md["x-goog-api-client"]; len(xg) == 0 || !strings.Contains(xg[0], "gl-go/") {
- return nil, fmt.Errorf("x-goog-api-client = %v, expected gl-go key", xg)
- }
- s.reqs = append(s.reqs, req)
- if s.err != nil {
- return nil, s.err
- }
- return s.resps[0].(*iampb.Policy), nil
-}
-
-func (s *mockIamPolicyServer) TestIamPermissions(ctx context.Context, req *iampb.TestIamPermissionsRequest) (*iampb.TestIamPermissionsResponse, error) {
- md, _ := metadata.FromIncomingContext(ctx)
- if xg := md["x-goog-api-client"]; len(xg) == 0 || !strings.Contains(xg[0], "gl-go/") {
- return nil, fmt.Errorf("x-goog-api-client = %v, expected gl-go key", xg)
- }
- s.reqs = append(s.reqs, req)
- if s.err != nil {
- return nil, s.err
- }
- return s.resps[0].(*iampb.TestIamPermissionsResponse), nil
-}
-
type mockSubscriberServer struct {
// Embed for forward compatibility.
// Tests will keep working if more methods are added
@@ -413,7 +361,6 @@
var (
mockPublisher mockPublisherServer
- mockIamPolicy mockIamPolicyServer
mockSubscriber mockSubscriberServer
)
@@ -422,7 +369,6 @@
serv := grpc.NewServer()
pubsubpb.RegisterPublisherServer(serv, &mockPublisher)
- iampb.RegisterIAMPolicyServer(serv, &mockIamPolicy)
pubsubpb.RegisterSubscriberServer(serv, &mockSubscriber)
lis, err := net.Listen("tcp", "localhost:0")
diff --git a/pubsub/apiv1/publisher_client.go b/pubsub/apiv1/publisher_client.go
index 43713d0..8407dac 100644
--- a/pubsub/apiv1/publisher_client.go
+++ b/pubsub/apiv1/publisher_client.go
@@ -18,6 +18,7 @@
import (
"context"
+ "fmt"
"math"
"time"
@@ -165,7 +166,8 @@
// <a href="https://cloud.google.com/pubsub/docs/admin#resource_names">
// resource name rules</a>.
func (c *PublisherClient) CreateTopic(ctx context.Context, req *pubsubpb.Topic, opts ...gax.CallOption) (*pubsubpb.Topic, error) {
- ctx = insertMetadata(ctx, c.xGoogMetadata)
+ md := metadata.Pairs("x-goog-request-params", fmt.Sprintf("%s=%v", "name", req.GetName()))
+ ctx = insertMetadata(ctx, c.xGoogMetadata, md)
opts = append(c.CallOptions.CreateTopic[0:len(c.CallOptions.CreateTopic):len(c.CallOptions.CreateTopic)], opts...)
var resp *pubsubpb.Topic
err := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error {
@@ -182,7 +184,8 @@
// UpdateTopic updates an existing topic. Note that certain properties of a
// topic are not modifiable.
func (c *PublisherClient) UpdateTopic(ctx context.Context, req *pubsubpb.UpdateTopicRequest, opts ...gax.CallOption) (*pubsubpb.Topic, error) {
- ctx = insertMetadata(ctx, c.xGoogMetadata)
+ md := metadata.Pairs("x-goog-request-params", fmt.Sprintf("%s=%v", "topic.name", req.GetTopic().GetName()))
+ ctx = insertMetadata(ctx, c.xGoogMetadata, md)
opts = append(c.CallOptions.UpdateTopic[0:len(c.CallOptions.UpdateTopic):len(c.CallOptions.UpdateTopic)], opts...)
var resp *pubsubpb.Topic
err := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error {
@@ -199,7 +202,8 @@
// Publish adds one or more messages to the topic. Returns NOT_FOUND if the topic
// does not exist.
func (c *PublisherClient) Publish(ctx context.Context, req *pubsubpb.PublishRequest, opts ...gax.CallOption) (*pubsubpb.PublishResponse, error) {
- ctx = insertMetadata(ctx, c.xGoogMetadata)
+ md := metadata.Pairs("x-goog-request-params", fmt.Sprintf("%s=%v", "topic", req.GetTopic()))
+ ctx = insertMetadata(ctx, c.xGoogMetadata, md)
opts = append(c.CallOptions.Publish[0:len(c.CallOptions.Publish):len(c.CallOptions.Publish)], opts...)
var resp *pubsubpb.PublishResponse
err := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error {
@@ -215,7 +219,8 @@
// GetTopic gets the configuration of a topic.
func (c *PublisherClient) GetTopic(ctx context.Context, req *pubsubpb.GetTopicRequest, opts ...gax.CallOption) (*pubsubpb.Topic, error) {
- ctx = insertMetadata(ctx, c.xGoogMetadata)
+ md := metadata.Pairs("x-goog-request-params", fmt.Sprintf("%s=%v", "topic", req.GetTopic()))
+ ctx = insertMetadata(ctx, c.xGoogMetadata, md)
opts = append(c.CallOptions.GetTopic[0:len(c.CallOptions.GetTopic):len(c.CallOptions.GetTopic)], opts...)
var resp *pubsubpb.Topic
err := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error {
@@ -231,7 +236,8 @@
// ListTopics lists matching topics.
func (c *PublisherClient) ListTopics(ctx context.Context, req *pubsubpb.ListTopicsRequest, opts ...gax.CallOption) *TopicIterator {
- ctx = insertMetadata(ctx, c.xGoogMetadata)
+ md := metadata.Pairs("x-goog-request-params", fmt.Sprintf("%s=%v", "project", req.GetProject()))
+ ctx = insertMetadata(ctx, c.xGoogMetadata, md)
opts = append(c.CallOptions.ListTopics[0:len(c.CallOptions.ListTopics):len(c.CallOptions.ListTopics)], opts...)
it := &TopicIterator{}
req = proto.Clone(req).(*pubsubpb.ListTopicsRequest)
@@ -268,7 +274,8 @@
// ListTopicSubscriptions lists the names of the subscriptions on this topic.
func (c *PublisherClient) ListTopicSubscriptions(ctx context.Context, req *pubsubpb.ListTopicSubscriptionsRequest, opts ...gax.CallOption) *StringIterator {
- ctx = insertMetadata(ctx, c.xGoogMetadata)
+ md := metadata.Pairs("x-goog-request-params", fmt.Sprintf("%s=%v", "topic", req.GetTopic()))
+ ctx = insertMetadata(ctx, c.xGoogMetadata, md)
opts = append(c.CallOptions.ListTopicSubscriptions[0:len(c.CallOptions.ListTopicSubscriptions):len(c.CallOptions.ListTopicSubscriptions)], opts...)
it := &StringIterator{}
req = proto.Clone(req).(*pubsubpb.ListTopicSubscriptionsRequest)
@@ -309,7 +316,8 @@
// configuration or subscriptions. Existing subscriptions to this topic are
// not deleted, but their topic field is set to _deleted-topic_.
func (c *PublisherClient) DeleteTopic(ctx context.Context, req *pubsubpb.DeleteTopicRequest, opts ...gax.CallOption) error {
- ctx = insertMetadata(ctx, c.xGoogMetadata)
+ md := metadata.Pairs("x-goog-request-params", fmt.Sprintf("%s=%v", "topic", req.GetTopic()))
+ ctx = insertMetadata(ctx, c.xGoogMetadata, md)
opts = append(c.CallOptions.DeleteTopic[0:len(c.CallOptions.DeleteTopic):len(c.CallOptions.DeleteTopic)], opts...)
err := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error {
var err error
diff --git a/pubsub/apiv1/subscriber_client.go b/pubsub/apiv1/subscriber_client.go
index 26bcf93..24e5aa3 100644
--- a/pubsub/apiv1/subscriber_client.go
+++ b/pubsub/apiv1/subscriber_client.go
@@ -18,6 +18,7 @@
import (
"context"
+ "fmt"
"math"
"time"
@@ -199,7 +200,8 @@
// generated name is populated in the returned Subscription object. Note that
// for REST API requests, you must specify a name in the request.
func (c *SubscriberClient) CreateSubscription(ctx context.Context, req *pubsubpb.Subscription, opts ...gax.CallOption) (*pubsubpb.Subscription, error) {
- ctx = insertMetadata(ctx, c.xGoogMetadata)
+ md := metadata.Pairs("x-goog-request-params", fmt.Sprintf("%s=%v", "name", req.GetName()))
+ ctx = insertMetadata(ctx, c.xGoogMetadata, md)
opts = append(c.CallOptions.CreateSubscription[0:len(c.CallOptions.CreateSubscription):len(c.CallOptions.CreateSubscription)], opts...)
var resp *pubsubpb.Subscription
err := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error {
@@ -215,7 +217,8 @@
// GetSubscription gets the configuration details of a subscription.
func (c *SubscriberClient) GetSubscription(ctx context.Context, req *pubsubpb.GetSubscriptionRequest, opts ...gax.CallOption) (*pubsubpb.Subscription, error) {
- ctx = insertMetadata(ctx, c.xGoogMetadata)
+ md := metadata.Pairs("x-goog-request-params", fmt.Sprintf("%s=%v", "subscription", req.GetSubscription()))
+ ctx = insertMetadata(ctx, c.xGoogMetadata, md)
opts = append(c.CallOptions.GetSubscription[0:len(c.CallOptions.GetSubscription):len(c.CallOptions.GetSubscription)], opts...)
var resp *pubsubpb.Subscription
err := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error {
@@ -232,7 +235,8 @@
// UpdateSubscription updates an existing subscription. Note that certain properties of a
// subscription, such as its topic, are not modifiable.
func (c *SubscriberClient) UpdateSubscription(ctx context.Context, req *pubsubpb.UpdateSubscriptionRequest, opts ...gax.CallOption) (*pubsubpb.Subscription, error) {
- ctx = insertMetadata(ctx, c.xGoogMetadata)
+ md := metadata.Pairs("x-goog-request-params", fmt.Sprintf("%s=%v", "subscription.name", req.GetSubscription().GetName()))
+ ctx = insertMetadata(ctx, c.xGoogMetadata, md)
opts = append(c.CallOptions.UpdateSubscription[0:len(c.CallOptions.UpdateSubscription):len(c.CallOptions.UpdateSubscription)], opts...)
var resp *pubsubpb.Subscription
err := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error {
@@ -248,7 +252,8 @@
// ListSubscriptions lists matching subscriptions.
func (c *SubscriberClient) ListSubscriptions(ctx context.Context, req *pubsubpb.ListSubscriptionsRequest, opts ...gax.CallOption) *SubscriptionIterator {
- ctx = insertMetadata(ctx, c.xGoogMetadata)
+ md := metadata.Pairs("x-goog-request-params", fmt.Sprintf("%s=%v", "project", req.GetProject()))
+ ctx = insertMetadata(ctx, c.xGoogMetadata, md)
opts = append(c.CallOptions.ListSubscriptions[0:len(c.CallOptions.ListSubscriptions):len(c.CallOptions.ListSubscriptions)], opts...)
it := &SubscriptionIterator{}
req = proto.Clone(req).(*pubsubpb.ListSubscriptionsRequest)
@@ -289,7 +294,8 @@
// the same name, but the new one has no association with the old
// subscription or its topic unless the same topic is specified.
func (c *SubscriberClient) DeleteSubscription(ctx context.Context, req *pubsubpb.DeleteSubscriptionRequest, opts ...gax.CallOption) error {
- ctx = insertMetadata(ctx, c.xGoogMetadata)
+ md := metadata.Pairs("x-goog-request-params", fmt.Sprintf("%s=%v", "subscription", req.GetSubscription()))
+ ctx = insertMetadata(ctx, c.xGoogMetadata, md)
opts = append(c.CallOptions.DeleteSubscription[0:len(c.CallOptions.DeleteSubscription):len(c.CallOptions.DeleteSubscription)], opts...)
err := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error {
var err error
@@ -305,7 +311,8 @@
// processing was interrupted. Note that this does not modify the
// subscription-level ackDeadlineSeconds used for subsequent messages.
func (c *SubscriberClient) ModifyAckDeadline(ctx context.Context, req *pubsubpb.ModifyAckDeadlineRequest, opts ...gax.CallOption) error {
- ctx = insertMetadata(ctx, c.xGoogMetadata)
+ md := metadata.Pairs("x-goog-request-params", fmt.Sprintf("%s=%v", "subscription", req.GetSubscription()))
+ ctx = insertMetadata(ctx, c.xGoogMetadata, md)
opts = append(c.CallOptions.ModifyAckDeadline[0:len(c.CallOptions.ModifyAckDeadline):len(c.CallOptions.ModifyAckDeadline)], opts...)
err := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error {
var err error
@@ -323,7 +330,8 @@
// but such a message may be redelivered later. Acknowledging a message more
// than once will not result in an error.
func (c *SubscriberClient) Acknowledge(ctx context.Context, req *pubsubpb.AcknowledgeRequest, opts ...gax.CallOption) error {
- ctx = insertMetadata(ctx, c.xGoogMetadata)
+ md := metadata.Pairs("x-goog-request-params", fmt.Sprintf("%s=%v", "subscription", req.GetSubscription()))
+ ctx = insertMetadata(ctx, c.xGoogMetadata, md)
opts = append(c.CallOptions.Acknowledge[0:len(c.CallOptions.Acknowledge):len(c.CallOptions.Acknowledge)], opts...)
err := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error {
var err error
@@ -337,7 +345,8 @@
// there are too many concurrent pull requests pending for the given
// subscription.
func (c *SubscriberClient) Pull(ctx context.Context, req *pubsubpb.PullRequest, opts ...gax.CallOption) (*pubsubpb.PullResponse, error) {
- ctx = insertMetadata(ctx, c.xGoogMetadata)
+ md := metadata.Pairs("x-goog-request-params", fmt.Sprintf("%s=%v", "subscription", req.GetSubscription()))
+ ctx = insertMetadata(ctx, c.xGoogMetadata, md)
opts = append(c.CallOptions.Pull[0:len(c.CallOptions.Pull):len(c.CallOptions.Pull)], opts...)
var resp *pubsubpb.PullResponse
err := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error {
@@ -380,7 +389,8 @@
// attributes of a push subscription. Messages will accumulate for delivery
// continuously through the call regardless of changes to the PushConfig.
func (c *SubscriberClient) ModifyPushConfig(ctx context.Context, req *pubsubpb.ModifyPushConfigRequest, opts ...gax.CallOption) error {
- ctx = insertMetadata(ctx, c.xGoogMetadata)
+ md := metadata.Pairs("x-goog-request-params", fmt.Sprintf("%s=%v", "subscription", req.GetSubscription()))
+ ctx = insertMetadata(ctx, c.xGoogMetadata, md)
opts = append(c.CallOptions.ModifyPushConfig[0:len(c.CallOptions.ModifyPushConfig):len(c.CallOptions.ModifyPushConfig)], opts...)
err := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error {
var err error
@@ -400,7 +410,8 @@
// changed in backward-incompatible ways and is not recommended for production
// use. It is not subject to any SLA or deprecation policy.
func (c *SubscriberClient) ListSnapshots(ctx context.Context, req *pubsubpb.ListSnapshotsRequest, opts ...gax.CallOption) *SnapshotIterator {
- ctx = insertMetadata(ctx, c.xGoogMetadata)
+ md := metadata.Pairs("x-goog-request-params", fmt.Sprintf("%s=%v", "project", req.GetProject()))
+ ctx = insertMetadata(ctx, c.xGoogMetadata, md)
opts = append(c.CallOptions.ListSnapshots[0:len(c.CallOptions.ListSnapshots):len(c.CallOptions.ListSnapshots)], opts...)
it := &SnapshotIterator{}
req = proto.Clone(req).(*pubsubpb.ListSnapshotsRequest)
@@ -458,7 +469,8 @@
// generated name is populated in the returned Snapshot object. Note that for
// REST API requests, you must specify a name in the request.
func (c *SubscriberClient) CreateSnapshot(ctx context.Context, req *pubsubpb.CreateSnapshotRequest, opts ...gax.CallOption) (*pubsubpb.Snapshot, error) {
- ctx = insertMetadata(ctx, c.xGoogMetadata)
+ md := metadata.Pairs("x-goog-request-params", fmt.Sprintf("%s=%v", "name", req.GetName()))
+ ctx = insertMetadata(ctx, c.xGoogMetadata, md)
opts = append(c.CallOptions.CreateSnapshot[0:len(c.CallOptions.CreateSnapshot):len(c.CallOptions.CreateSnapshot)], opts...)
var resp *pubsubpb.Snapshot
err := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error {
@@ -483,7 +495,8 @@
// use. It is not subject to any SLA or deprecation policy.
// Note that certain properties of a snapshot are not modifiable.
func (c *SubscriberClient) UpdateSnapshot(ctx context.Context, req *pubsubpb.UpdateSnapshotRequest, opts ...gax.CallOption) (*pubsubpb.Snapshot, error) {
- ctx = insertMetadata(ctx, c.xGoogMetadata)
+ md := metadata.Pairs("x-goog-request-params", fmt.Sprintf("%s=%v", "snapshot.name", req.GetSnapshot().GetName()))
+ ctx = insertMetadata(ctx, c.xGoogMetadata, md)
opts = append(c.CallOptions.UpdateSnapshot[0:len(c.CallOptions.UpdateSnapshot):len(c.CallOptions.UpdateSnapshot)], opts...)
var resp *pubsubpb.Snapshot
err := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error {
@@ -511,7 +524,8 @@
// created with the same name, but the new one has no association with the old
// snapshot or its subscription, unless the same subscription is specified.
func (c *SubscriberClient) DeleteSnapshot(ctx context.Context, req *pubsubpb.DeleteSnapshotRequest, opts ...gax.CallOption) error {
- ctx = insertMetadata(ctx, c.xGoogMetadata)
+ md := metadata.Pairs("x-goog-request-params", fmt.Sprintf("%s=%v", "snapshot", req.GetSnapshot()))
+ ctx = insertMetadata(ctx, c.xGoogMetadata, md)
opts = append(c.CallOptions.DeleteSnapshot[0:len(c.CallOptions.DeleteSnapshot):len(c.CallOptions.DeleteSnapshot)], opts...)
err := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error {
var err error
@@ -533,7 +547,8 @@
// changed in backward-incompatible ways and is not recommended for production
// use. It is not subject to any SLA or deprecation policy.
func (c *SubscriberClient) Seek(ctx context.Context, req *pubsubpb.SeekRequest, opts ...gax.CallOption) (*pubsubpb.SeekResponse, error) {
- ctx = insertMetadata(ctx, c.xGoogMetadata)
+ md := metadata.Pairs("x-goog-request-params", fmt.Sprintf("%s=%v", "subscription", req.GetSubscription()))
+ ctx = insertMetadata(ctx, c.xGoogMetadata, md)
opts = append(c.CallOptions.Seek[0:len(c.CallOptions.Seek):len(c.CallOptions.Seek)], opts...)
var resp *pubsubpb.SeekResponse
err := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error {
diff --git a/redis/apiv1/cloud_redis_client.go b/redis/apiv1/cloud_redis_client.go
index 04e68a9..7fd4893 100644
--- a/redis/apiv1/cloud_redis_client.go
+++ b/redis/apiv1/cloud_redis_client.go
@@ -18,6 +18,7 @@
import (
"context"
+ "fmt"
"math"
"time"
@@ -163,7 +164,8 @@
// If location_id is specified as - (wildcard), then all regions
// available to the project are queried, and the results are aggregated.
func (c *CloudRedisClient) ListInstances(ctx context.Context, req *redispb.ListInstancesRequest, opts ...gax.CallOption) *InstanceIterator {
- ctx = insertMetadata(ctx, c.xGoogMetadata)
+ md := metadata.Pairs("x-goog-request-params", fmt.Sprintf("%s=%v", "parent", req.GetParent()))
+ ctx = insertMetadata(ctx, c.xGoogMetadata, md)
opts = append(c.CallOptions.ListInstances[0:len(c.CallOptions.ListInstances):len(c.CallOptions.ListInstances)], opts...)
it := &InstanceIterator{}
req = proto.Clone(req).(*redispb.ListInstancesRequest)
@@ -200,7 +202,8 @@
// GetInstance gets the details of a specific Redis instance.
func (c *CloudRedisClient) GetInstance(ctx context.Context, req *redispb.GetInstanceRequest, opts ...gax.CallOption) (*redispb.Instance, error) {
- ctx = insertMetadata(ctx, c.xGoogMetadata)
+ md := metadata.Pairs("x-goog-request-params", fmt.Sprintf("%s=%v", "name", req.GetName()))
+ ctx = insertMetadata(ctx, c.xGoogMetadata, md)
opts = append(c.CallOptions.GetInstance[0:len(c.CallOptions.GetInstance):len(c.CallOptions.GetInstance)], opts...)
var resp *redispb.Instance
err := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error {
@@ -227,7 +230,8 @@
// The returned operation is automatically deleted after a few hours, so there
// is no need to call DeleteOperation.
func (c *CloudRedisClient) CreateInstance(ctx context.Context, req *redispb.CreateInstanceRequest, opts ...gax.CallOption) (*CreateInstanceOperation, error) {
- ctx = insertMetadata(ctx, c.xGoogMetadata)
+ md := metadata.Pairs("x-goog-request-params", fmt.Sprintf("%s=%v", "parent", req.GetParent()))
+ ctx = insertMetadata(ctx, c.xGoogMetadata, md)
opts = append(c.CallOptions.CreateInstance[0:len(c.CallOptions.CreateInstance):len(c.CallOptions.CreateInstance)], opts...)
var resp *longrunningpb.Operation
err := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error {
@@ -249,7 +253,8 @@
// in the response field. The returned operation is automatically deleted
// after a few hours, so there is no need to call DeleteOperation.
func (c *CloudRedisClient) UpdateInstance(ctx context.Context, req *redispb.UpdateInstanceRequest, opts ...gax.CallOption) (*UpdateInstanceOperation, error) {
- ctx = insertMetadata(ctx, c.xGoogMetadata)
+ md := metadata.Pairs("x-goog-request-params", fmt.Sprintf("%s=%v", "instance.name", req.GetInstance().GetName()))
+ ctx = insertMetadata(ctx, c.xGoogMetadata, md)
opts = append(c.CallOptions.UpdateInstance[0:len(c.CallOptions.UpdateInstance):len(c.CallOptions.UpdateInstance)], opts...)
var resp *longrunningpb.Operation
err := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error {
@@ -268,7 +273,8 @@
// DeleteInstance deletes a specific Redis instance. Instance stops serving and data is
// deleted.
func (c *CloudRedisClient) DeleteInstance(ctx context.Context, req *redispb.DeleteInstanceRequest, opts ...gax.CallOption) (*DeleteInstanceOperation, error) {
- ctx = insertMetadata(ctx, c.xGoogMetadata)
+ md := metadata.Pairs("x-goog-request-params", fmt.Sprintf("%s=%v", "name", req.GetName()))
+ ctx = insertMetadata(ctx, c.xGoogMetadata, md)
opts = append(c.CallOptions.DeleteInstance[0:len(c.CallOptions.DeleteInstance):len(c.CallOptions.DeleteInstance)], opts...)
var resp *longrunningpb.Operation
err := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error {
@@ -287,7 +293,8 @@
// FailoverInstance failover the master role to current replica node against a specific
// STANDARD tier redis instance.
func (c *CloudRedisClient) FailoverInstance(ctx context.Context, req *redispb.FailoverInstanceRequest, opts ...gax.CallOption) (*FailoverInstanceOperation, error) {
- ctx = insertMetadata(ctx, c.xGoogMetadata)
+ md := metadata.Pairs("x-goog-request-params", fmt.Sprintf("%s=%v", "name", req.GetName()))
+ ctx = insertMetadata(ctx, c.xGoogMetadata, md)
opts = append(c.CallOptions.FailoverInstance[0:len(c.CallOptions.FailoverInstance):len(c.CallOptions.FailoverInstance)], opts...)
var resp *longrunningpb.Operation
err := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error {
diff --git a/redis/apiv1/doc.go b/redis/apiv1/doc.go
index 4c975bf..ab809c8 100644
--- a/redis/apiv1/doc.go
+++ b/redis/apiv1/doc.go
@@ -97,4 +97,4 @@
return "UNKNOWN"
}
-const versionClient = "20190322"
+const versionClient = "20190401"
diff --git a/redis/apiv1beta1/cloud_redis_client.go b/redis/apiv1beta1/cloud_redis_client.go
index a5e91d5..8d4cf56 100644
--- a/redis/apiv1beta1/cloud_redis_client.go
+++ b/redis/apiv1beta1/cloud_redis_client.go
@@ -18,6 +18,7 @@
import (
"context"
+ "fmt"
"math"
"time"
@@ -162,7 +163,8 @@
// If location_id is specified as - (wildcard), then all regions
// available to the project are queried, and the results are aggregated.
func (c *CloudRedisClient) ListInstances(ctx context.Context, req *redispb.ListInstancesRequest, opts ...gax.CallOption) *InstanceIterator {
- ctx = insertMetadata(ctx, c.xGoogMetadata)
+ md := metadata.Pairs("x-goog-request-params", fmt.Sprintf("%s=%v", "parent", req.GetParent()))
+ ctx = insertMetadata(ctx, c.xGoogMetadata, md)
opts = append(c.CallOptions.ListInstances[0:len(c.CallOptions.ListInstances):len(c.CallOptions.ListInstances)], opts...)
it := &InstanceIterator{}
req = proto.Clone(req).(*redispb.ListInstancesRequest)
@@ -199,7 +201,8 @@
// GetInstance gets the details of a specific Redis instance.
func (c *CloudRedisClient) GetInstance(ctx context.Context, req *redispb.GetInstanceRequest, opts ...gax.CallOption) (*redispb.Instance, error) {
- ctx = insertMetadata(ctx, c.xGoogMetadata)
+ md := metadata.Pairs("x-goog-request-params", fmt.Sprintf("%s=%v", "name", req.GetName()))
+ ctx = insertMetadata(ctx, c.xGoogMetadata, md)
opts = append(c.CallOptions.GetInstance[0:len(c.CallOptions.GetInstance):len(c.CallOptions.GetInstance)], opts...)
var resp *redispb.Instance
err := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error {
@@ -226,7 +229,8 @@
// The returned operation is automatically deleted after a few hours, so there
// is no need to call DeleteOperation.
func (c *CloudRedisClient) CreateInstance(ctx context.Context, req *redispb.CreateInstanceRequest, opts ...gax.CallOption) (*CreateInstanceOperation, error) {
- ctx = insertMetadata(ctx, c.xGoogMetadata)
+ md := metadata.Pairs("x-goog-request-params", fmt.Sprintf("%s=%v", "parent", req.GetParent()))
+ ctx = insertMetadata(ctx, c.xGoogMetadata, md)
opts = append(c.CallOptions.CreateInstance[0:len(c.CallOptions.CreateInstance):len(c.CallOptions.CreateInstance)], opts...)
var resp *longrunningpb.Operation
err := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error {
@@ -248,7 +252,8 @@
// in the response field. The returned operation is automatically deleted
// after a few hours, so there is no need to call DeleteOperation.
func (c *CloudRedisClient) UpdateInstance(ctx context.Context, req *redispb.UpdateInstanceRequest, opts ...gax.CallOption) (*UpdateInstanceOperation, error) {
- ctx = insertMetadata(ctx, c.xGoogMetadata)
+ md := metadata.Pairs("x-goog-request-params", fmt.Sprintf("%s=%v", "instance.name", req.GetInstance().GetName()))
+ ctx = insertMetadata(ctx, c.xGoogMetadata, md)
opts = append(c.CallOptions.UpdateInstance[0:len(c.CallOptions.UpdateInstance):len(c.CallOptions.UpdateInstance)], opts...)
var resp *longrunningpb.Operation
err := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error {
@@ -267,7 +272,8 @@
// DeleteInstance deletes a specific Redis instance. Instance stops serving and data is
// deleted.
func (c *CloudRedisClient) DeleteInstance(ctx context.Context, req *redispb.DeleteInstanceRequest, opts ...gax.CallOption) (*DeleteInstanceOperation, error) {
- ctx = insertMetadata(ctx, c.xGoogMetadata)
+ md := metadata.Pairs("x-goog-request-params", fmt.Sprintf("%s=%v", "name", req.GetName()))
+ ctx = insertMetadata(ctx, c.xGoogMetadata, md)
opts = append(c.CallOptions.DeleteInstance[0:len(c.CallOptions.DeleteInstance):len(c.CallOptions.DeleteInstance)], opts...)
var resp *longrunningpb.Operation
err := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error {
diff --git a/redis/apiv1beta1/doc.go b/redis/apiv1beta1/doc.go
index 40d5637..fe67847 100644
--- a/redis/apiv1beta1/doc.go
+++ b/redis/apiv1beta1/doc.go
@@ -99,4 +99,4 @@
return "UNKNOWN"
}
-const versionClient = "20190322"
+const versionClient = "20190401"
diff --git a/scheduler/apiv1/cloud_scheduler_client.go b/scheduler/apiv1/cloud_scheduler_client.go
index e397010..3bed608 100644
--- a/scheduler/apiv1/cloud_scheduler_client.go
+++ b/scheduler/apiv1/cloud_scheduler_client.go
@@ -18,6 +18,7 @@
import (
"context"
+ "fmt"
"math"
"time"
@@ -136,7 +137,8 @@
// ListJobs lists jobs.
func (c *CloudSchedulerClient) ListJobs(ctx context.Context, req *schedulerpb.ListJobsRequest, opts ...gax.CallOption) *JobIterator {
- ctx = insertMetadata(ctx, c.xGoogMetadata)
+ md := metadata.Pairs("x-goog-request-params", fmt.Sprintf("%s=%v", "parent", req.GetParent()))
+ ctx = insertMetadata(ctx, c.xGoogMetadata, md)
opts = append(c.CallOptions.ListJobs[0:len(c.CallOptions.ListJobs):len(c.CallOptions.ListJobs)], opts...)
it := &JobIterator{}
req = proto.Clone(req).(*schedulerpb.ListJobsRequest)
@@ -173,7 +175,8 @@
// GetJob gets a job.
func (c *CloudSchedulerClient) GetJob(ctx context.Context, req *schedulerpb.GetJobRequest, opts ...gax.CallOption) (*schedulerpb.Job, error) {
- ctx = insertMetadata(ctx, c.xGoogMetadata)
+ md := metadata.Pairs("x-goog-request-params", fmt.Sprintf("%s=%v", "name", req.GetName()))
+ ctx = insertMetadata(ctx, c.xGoogMetadata, md)
opts = append(c.CallOptions.GetJob[0:len(c.CallOptions.GetJob):len(c.CallOptions.GetJob)], opts...)
var resp *schedulerpb.Job
err := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error {
@@ -189,7 +192,8 @@
// CreateJob creates a job.
func (c *CloudSchedulerClient) CreateJob(ctx context.Context, req *schedulerpb.CreateJobRequest, opts ...gax.CallOption) (*schedulerpb.Job, error) {
- ctx = insertMetadata(ctx, c.xGoogMetadata)
+ md := metadata.Pairs("x-goog-request-params", fmt.Sprintf("%s=%v", "parent", req.GetParent()))
+ ctx = insertMetadata(ctx, c.xGoogMetadata, md)
opts = append(c.CallOptions.CreateJob[0:len(c.CallOptions.CreateJob):len(c.CallOptions.CreateJob)], opts...)
var resp *schedulerpb.Job
err := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error {
@@ -213,7 +217,8 @@
// not be executed. If this happens, retry the UpdateJob request
// until a successful response is received.
func (c *CloudSchedulerClient) UpdateJob(ctx context.Context, req *schedulerpb.UpdateJobRequest, opts ...gax.CallOption) (*schedulerpb.Job, error) {
- ctx = insertMetadata(ctx, c.xGoogMetadata)
+ md := metadata.Pairs("x-goog-request-params", fmt.Sprintf("%s=%v", "job.name", req.GetJob().GetName()))
+ ctx = insertMetadata(ctx, c.xGoogMetadata, md)
opts = append(c.CallOptions.UpdateJob[0:len(c.CallOptions.UpdateJob):len(c.CallOptions.UpdateJob)], opts...)
var resp *schedulerpb.Job
err := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error {
@@ -229,7 +234,8 @@
// DeleteJob deletes a job.
func (c *CloudSchedulerClient) DeleteJob(ctx context.Context, req *schedulerpb.DeleteJobRequest, opts ...gax.CallOption) error {
- ctx = insertMetadata(ctx, c.xGoogMetadata)
+ md := metadata.Pairs("x-goog-request-params", fmt.Sprintf("%s=%v", "name", req.GetName()))
+ ctx = insertMetadata(ctx, c.xGoogMetadata, md)
opts = append(c.CallOptions.DeleteJob[0:len(c.CallOptions.DeleteJob):len(c.CallOptions.DeleteJob)], opts...)
err := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error {
var err error
@@ -247,7 +253,8 @@
// will be set to [Job.State.PAUSED][google.cloud.scheduler.v1.Job.State.PAUSED]. A job must be in [Job.State.ENABLED][google.cloud.scheduler.v1.Job.State.ENABLED]
// to be paused.
func (c *CloudSchedulerClient) PauseJob(ctx context.Context, req *schedulerpb.PauseJobRequest, opts ...gax.CallOption) (*schedulerpb.Job, error) {
- ctx = insertMetadata(ctx, c.xGoogMetadata)
+ md := metadata.Pairs("x-goog-request-params", fmt.Sprintf("%s=%v", "name", req.GetName()))
+ ctx = insertMetadata(ctx, c.xGoogMetadata, md)
opts = append(c.CallOptions.PauseJob[0:len(c.CallOptions.PauseJob):len(c.CallOptions.PauseJob)], opts...)
var resp *schedulerpb.Job
err := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error {
@@ -268,7 +275,8 @@
// will be set to [Job.State.ENABLED][google.cloud.scheduler.v1.Job.State.ENABLED]. A job must be in
// [Job.State.PAUSED][google.cloud.scheduler.v1.Job.State.PAUSED] to be resumed.
func (c *CloudSchedulerClient) ResumeJob(ctx context.Context, req *schedulerpb.ResumeJobRequest, opts ...gax.CallOption) (*schedulerpb.Job, error) {
- ctx = insertMetadata(ctx, c.xGoogMetadata)
+ md := metadata.Pairs("x-goog-request-params", fmt.Sprintf("%s=%v", "name", req.GetName()))
+ ctx = insertMetadata(ctx, c.xGoogMetadata, md)
opts = append(c.CallOptions.ResumeJob[0:len(c.CallOptions.ResumeJob):len(c.CallOptions.ResumeJob)], opts...)
var resp *schedulerpb.Job
err := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error {
@@ -287,7 +295,8 @@
// When this method is called, Cloud Scheduler will dispatch the job, even
// if the job is already running.
func (c *CloudSchedulerClient) RunJob(ctx context.Context, req *schedulerpb.RunJobRequest, opts ...gax.CallOption) (*schedulerpb.Job, error) {
- ctx = insertMetadata(ctx, c.xGoogMetadata)
+ md := metadata.Pairs("x-goog-request-params", fmt.Sprintf("%s=%v", "name", req.GetName()))
+ ctx = insertMetadata(ctx, c.xGoogMetadata, md)
opts = append(c.CallOptions.RunJob[0:len(c.CallOptions.RunJob):len(c.CallOptions.RunJob)], opts...)
var resp *schedulerpb.Job
err := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error {
diff --git a/scheduler/apiv1/doc.go b/scheduler/apiv1/doc.go
index a606b1d..e640caf 100644
--- a/scheduler/apiv1/doc.go
+++ b/scheduler/apiv1/doc.go
@@ -97,4 +97,4 @@
return "UNKNOWN"
}
-const versionClient = "20190322"
+const versionClient = "20190401"
diff --git a/scheduler/apiv1beta1/cloud_scheduler_client.go b/scheduler/apiv1beta1/cloud_scheduler_client.go
index deab68c..4e8c773 100644
--- a/scheduler/apiv1beta1/cloud_scheduler_client.go
+++ b/scheduler/apiv1beta1/cloud_scheduler_client.go
@@ -18,6 +18,7 @@
import (
"context"
+ "fmt"
"math"
"time"
@@ -136,7 +137,8 @@
// ListJobs lists jobs.
func (c *CloudSchedulerClient) ListJobs(ctx context.Context, req *schedulerpb.ListJobsRequest, opts ...gax.CallOption) *JobIterator {
- ctx = insertMetadata(ctx, c.xGoogMetadata)
+ md := metadata.Pairs("x-goog-request-params", fmt.Sprintf("%s=%v", "parent", req.GetParent()))
+ ctx = insertMetadata(ctx, c.xGoogMetadata, md)
opts = append(c.CallOptions.ListJobs[0:len(c.CallOptions.ListJobs):len(c.CallOptions.ListJobs)], opts...)
it := &JobIterator{}
req = proto.Clone(req).(*schedulerpb.ListJobsRequest)
@@ -173,7 +175,8 @@
// GetJob gets a job.
func (c *CloudSchedulerClient) GetJob(ctx context.Context, req *schedulerpb.GetJobRequest, opts ...gax.CallOption) (*schedulerpb.Job, error) {
- ctx = insertMetadata(ctx, c.xGoogMetadata)
+ md := metadata.Pairs("x-goog-request-params", fmt.Sprintf("%s=%v", "name", req.GetName()))
+ ctx = insertMetadata(ctx, c.xGoogMetadata, md)
opts = append(c.CallOptions.GetJob[0:len(c.CallOptions.GetJob):len(c.CallOptions.GetJob)], opts...)
var resp *schedulerpb.Job
err := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error {
@@ -189,7 +192,8 @@
// CreateJob creates a job.
func (c *CloudSchedulerClient) CreateJob(ctx context.Context, req *schedulerpb.CreateJobRequest, opts ...gax.CallOption) (*schedulerpb.Job, error) {
- ctx = insertMetadata(ctx, c.xGoogMetadata)
+ md := metadata.Pairs("x-goog-request-params", fmt.Sprintf("%s=%v", "parent", req.GetParent()))
+ ctx = insertMetadata(ctx, c.xGoogMetadata, md)
opts = append(c.CallOptions.CreateJob[0:len(c.CallOptions.CreateJob):len(c.CallOptions.CreateJob)], opts...)
var resp *schedulerpb.Job
err := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error {
@@ -214,7 +218,8 @@
// state. A job in this state may not be executed. If this happens, retry the
// UpdateJob request until a successful response is received.
func (c *CloudSchedulerClient) UpdateJob(ctx context.Context, req *schedulerpb.UpdateJobRequest, opts ...gax.CallOption) (*schedulerpb.Job, error) {
- ctx = insertMetadata(ctx, c.xGoogMetadata)
+ md := metadata.Pairs("x-goog-request-params", fmt.Sprintf("%s=%v", "job.name", req.GetJob().GetName()))
+ ctx = insertMetadata(ctx, c.xGoogMetadata, md)
opts = append(c.CallOptions.UpdateJob[0:len(c.CallOptions.UpdateJob):len(c.CallOptions.UpdateJob)], opts...)
var resp *schedulerpb.Job
err := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error {
@@ -230,7 +235,8 @@
// DeleteJob deletes a job.
func (c *CloudSchedulerClient) DeleteJob(ctx context.Context, req *schedulerpb.DeleteJobRequest, opts ...gax.CallOption) error {
- ctx = insertMetadata(ctx, c.xGoogMetadata)
+ md := metadata.Pairs("x-goog-request-params", fmt.Sprintf("%s=%v", "name", req.GetName()))
+ ctx = insertMetadata(ctx, c.xGoogMetadata, md)
opts = append(c.CallOptions.DeleteJob[0:len(c.CallOptions.DeleteJob):len(c.CallOptions.DeleteJob)], opts...)
err := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error {
var err error
@@ -252,7 +258,8 @@
// [Job.State.ENABLED][google.cloud.scheduler.v1beta1.Job.State.ENABLED] to be
// paused.
func (c *CloudSchedulerClient) PauseJob(ctx context.Context, req *schedulerpb.PauseJobRequest, opts ...gax.CallOption) (*schedulerpb.Job, error) {
- ctx = insertMetadata(ctx, c.xGoogMetadata)
+ md := metadata.Pairs("x-goog-request-params", fmt.Sprintf("%s=%v", "name", req.GetName()))
+ ctx = insertMetadata(ctx, c.xGoogMetadata, md)
opts = append(c.CallOptions.PauseJob[0:len(c.CallOptions.PauseJob):len(c.CallOptions.PauseJob)], opts...)
var resp *schedulerpb.Job
err := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error {
@@ -278,7 +285,8 @@
// [Job.State.PAUSED][google.cloud.scheduler.v1beta1.Job.State.PAUSED] to be
// resumed.
func (c *CloudSchedulerClient) ResumeJob(ctx context.Context, req *schedulerpb.ResumeJobRequest, opts ...gax.CallOption) (*schedulerpb.Job, error) {
- ctx = insertMetadata(ctx, c.xGoogMetadata)
+ md := metadata.Pairs("x-goog-request-params", fmt.Sprintf("%s=%v", "name", req.GetName()))
+ ctx = insertMetadata(ctx, c.xGoogMetadata, md)
opts = append(c.CallOptions.ResumeJob[0:len(c.CallOptions.ResumeJob):len(c.CallOptions.ResumeJob)], opts...)
var resp *schedulerpb.Job
err := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error {
@@ -297,7 +305,8 @@
// When this method is called, Cloud Scheduler will dispatch the job, even
// if the job is already running.
func (c *CloudSchedulerClient) RunJob(ctx context.Context, req *schedulerpb.RunJobRequest, opts ...gax.CallOption) (*schedulerpb.Job, error) {
- ctx = insertMetadata(ctx, c.xGoogMetadata)
+ md := metadata.Pairs("x-goog-request-params", fmt.Sprintf("%s=%v", "name", req.GetName()))
+ ctx = insertMetadata(ctx, c.xGoogMetadata, md)
opts = append(c.CallOptions.RunJob[0:len(c.CallOptions.RunJob):len(c.CallOptions.RunJob)], opts...)
var resp *schedulerpb.Job
err := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error {
diff --git a/scheduler/apiv1beta1/doc.go b/scheduler/apiv1beta1/doc.go
index 1331330..49b2169 100644
--- a/scheduler/apiv1beta1/doc.go
+++ b/scheduler/apiv1beta1/doc.go
@@ -97,4 +97,4 @@
return "UNKNOWN"
}
-const versionClient = "20190322"
+const versionClient = "20190401"
diff --git a/securitycenter/apiv1/doc.go b/securitycenter/apiv1/doc.go
index 365ac28..8aea13b 100644
--- a/securitycenter/apiv1/doc.go
+++ b/securitycenter/apiv1/doc.go
@@ -98,4 +98,4 @@
return "UNKNOWN"
}
-const versionClient = "20190322"
+const versionClient = "20190401"
diff --git a/securitycenter/apiv1/security_center_client.go b/securitycenter/apiv1/security_center_client.go
index 408923d..d0b7c6b 100644
--- a/securitycenter/apiv1/security_center_client.go
+++ b/securitycenter/apiv1/security_center_client.go
@@ -18,6 +18,7 @@
import (
"context"
+ "fmt"
"math"
"time"
@@ -175,7 +176,8 @@
// CreateSource creates a source.
func (c *Client) CreateSource(ctx context.Context, req *securitycenterpb.CreateSourceRequest, opts ...gax.CallOption) (*securitycenterpb.Source, error) {
- ctx = insertMetadata(ctx, c.xGoogMetadata)
+ md := metadata.Pairs("x-goog-request-params", fmt.Sprintf("%s=%v", "parent", req.GetParent()))
+ ctx = insertMetadata(ctx, c.xGoogMetadata, md)
opts = append(c.CallOptions.CreateSource[0:len(c.CallOptions.CreateSource):len(c.CallOptions.CreateSource)], opts...)
var resp *securitycenterpb.Source
err := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error {
@@ -192,7 +194,8 @@
// CreateFinding creates a finding. The corresponding source must exist for finding creation
// to succeed.
func (c *Client) CreateFinding(ctx context.Context, req *securitycenterpb.CreateFindingRequest, opts ...gax.CallOption) (*securitycenterpb.Finding, error) {
- ctx = insertMetadata(ctx, c.xGoogMetadata)
+ md := metadata.Pairs("x-goog-request-params", fmt.Sprintf("%s=%v", "parent", req.GetParent()))
+ ctx = insertMetadata(ctx, c.xGoogMetadata, md)
opts = append(c.CallOptions.CreateFinding[0:len(c.CallOptions.CreateFinding):len(c.CallOptions.CreateFinding)], opts...)
var resp *securitycenterpb.Finding
err := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error {
@@ -208,7 +211,8 @@
// GetIamPolicy gets the access control policy on the specified Source.
func (c *Client) GetIamPolicy(ctx context.Context, req *iampb.GetIamPolicyRequest, opts ...gax.CallOption) (*iampb.Policy, error) {
- ctx = insertMetadata(ctx, c.xGoogMetadata)
+ md := metadata.Pairs("x-goog-request-params", fmt.Sprintf("%s=%v", "resource", req.GetResource()))
+ ctx = insertMetadata(ctx, c.xGoogMetadata, md)
opts = append(c.CallOptions.GetIamPolicy[0:len(c.CallOptions.GetIamPolicy):len(c.CallOptions.GetIamPolicy)], opts...)
var resp *iampb.Policy
err := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error {
@@ -224,7 +228,8 @@
// GetOrganizationSettings gets the settings for an organization.
func (c *Client) GetOrganizationSettings(ctx context.Context, req *securitycenterpb.GetOrganizationSettingsRequest, opts ...gax.CallOption) (*securitycenterpb.OrganizationSettings, error) {
- ctx = insertMetadata(ctx, c.xGoogMetadata)
+ md := metadata.Pairs("x-goog-request-params", fmt.Sprintf("%s=%v", "name", req.GetName()))
+ ctx = insertMetadata(ctx, c.xGoogMetadata, md)
opts = append(c.CallOptions.GetOrganizationSettings[0:len(c.CallOptions.GetOrganizationSettings):len(c.CallOptions.GetOrganizationSettings)], opts...)
var resp *securitycenterpb.OrganizationSettings
err := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error {
@@ -240,7 +245,8 @@
// GetSource gets a source.
func (c *Client) GetSource(ctx context.Context, req *securitycenterpb.GetSourceRequest, opts ...gax.CallOption) (*securitycenterpb.Source, error) {
- ctx = insertMetadata(ctx, c.xGoogMetadata)
+ md := metadata.Pairs("x-goog-request-params", fmt.Sprintf("%s=%v", "name", req.GetName()))
+ ctx = insertMetadata(ctx, c.xGoogMetadata, md)
opts = append(c.CallOptions.GetSource[0:len(c.CallOptions.GetSource):len(c.CallOptions.GetSource)], opts...)
var resp *securitycenterpb.Source
err := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error {
@@ -257,7 +263,8 @@
// GroupAssets filters an organization's assets and groups them by their specified
// properties.
func (c *Client) GroupAssets(ctx context.Context, req *securitycenterpb.GroupAssetsRequest, opts ...gax.CallOption) *GroupResultIterator {
- ctx = insertMetadata(ctx, c.xGoogMetadata)
+ md := metadata.Pairs("x-goog-request-params", fmt.Sprintf("%s=%v", "parent", req.GetParent()))
+ ctx = insertMetadata(ctx, c.xGoogMetadata, md)
opts = append(c.CallOptions.GroupAssets[0:len(c.CallOptions.GroupAssets):len(c.CallOptions.GroupAssets)], opts...)
it := &GroupResultIterator{}
req = proto.Clone(req).(*securitycenterpb.GroupAssetsRequest)
@@ -298,7 +305,8 @@
// To group across all sources provide a - as the source id.
// Example: /v1/organizations/123/sources/-/findings
func (c *Client) GroupFindings(ctx context.Context, req *securitycenterpb.GroupFindingsRequest, opts ...gax.CallOption) *GroupResultIterator {
- ctx = insertMetadata(ctx, c.xGoogMetadata)
+ md := metadata.Pairs("x-goog-request-params", fmt.Sprintf("%s=%v", "parent", req.GetParent()))
+ ctx = insertMetadata(ctx, c.xGoogMetadata, md)
opts = append(c.CallOptions.GroupFindings[0:len(c.CallOptions.GroupFindings):len(c.CallOptions.GroupFindings)], opts...)
it := &GroupResultIterator{}
req = proto.Clone(req).(*securitycenterpb.GroupFindingsRequest)
@@ -335,7 +343,8 @@
// ListAssets lists an organization's assets.
func (c *Client) ListAssets(ctx context.Context, req *securitycenterpb.ListAssetsRequest, opts ...gax.CallOption) *ListAssetsResponse_ListAssetsResultIterator {
- ctx = insertMetadata(ctx, c.xGoogMetadata)
+ md := metadata.Pairs("x-goog-request-params", fmt.Sprintf("%s=%v", "parent", req.GetParent()))
+ ctx = insertMetadata(ctx, c.xGoogMetadata, md)
opts = append(c.CallOptions.ListAssets[0:len(c.CallOptions.ListAssets):len(c.CallOptions.ListAssets)], opts...)
it := &ListAssetsResponse_ListAssetsResultIterator{}
req = proto.Clone(req).(*securitycenterpb.ListAssetsRequest)
@@ -375,7 +384,8 @@
// To list across all sources provide a - as the source id.
// Example: /v1/organizations/123/sources/-/findings
func (c *Client) ListFindings(ctx context.Context, req *securitycenterpb.ListFindingsRequest, opts ...gax.CallOption) *ListFindingsResponse_ListFindingsResultIterator {
- ctx = insertMetadata(ctx, c.xGoogMetadata)
+ md := metadata.Pairs("x-goog-request-params", fmt.Sprintf("%s=%v", "parent", req.GetParent()))
+ ctx = insertMetadata(ctx, c.xGoogMetadata, md)
opts = append(c.CallOptions.ListFindings[0:len(c.CallOptions.ListFindings):len(c.CallOptions.ListFindings)], opts...)
it := &ListFindingsResponse_ListFindingsResultIterator{}
req = proto.Clone(req).(*securitycenterpb.ListFindingsRequest)
@@ -412,7 +422,8 @@
// ListSources lists all sources belonging to an organization.
func (c *Client) ListSources(ctx context.Context, req *securitycenterpb.ListSourcesRequest, opts ...gax.CallOption) *SourceIterator {
- ctx = insertMetadata(ctx, c.xGoogMetadata)
+ md := metadata.Pairs("x-goog-request-params", fmt.Sprintf("%s=%v", "parent", req.GetParent()))
+ ctx = insertMetadata(ctx, c.xGoogMetadata, md)
opts = append(c.CallOptions.ListSources[0:len(c.CallOptions.ListSources):len(c.CallOptions.ListSources)], opts...)
it := &SourceIterator{}
req = proto.Clone(req).(*securitycenterpb.ListSourcesRequest)
@@ -454,7 +465,8 @@
// it is called too frequently the caller will receive a TOO_MANY_REQUESTS
// error.
func (c *Client) RunAssetDiscovery(ctx context.Context, req *securitycenterpb.RunAssetDiscoveryRequest, opts ...gax.CallOption) (*RunAssetDiscoveryOperation, error) {
- ctx = insertMetadata(ctx, c.xGoogMetadata)
+ md := metadata.Pairs("x-goog-request-params", fmt.Sprintf("%s=%v", "parent", req.GetParent()))
+ ctx = insertMetadata(ctx, c.xGoogMetadata, md)
opts = append(c.CallOptions.RunAssetDiscovery[0:len(c.CallOptions.RunAssetDiscovery):len(c.CallOptions.RunAssetDiscovery)], opts...)
var resp *longrunningpb.Operation
err := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error {
@@ -472,7 +484,8 @@
// SetFindingState updates the state of a finding.
func (c *Client) SetFindingState(ctx context.Context, req *securitycenterpb.SetFindingStateRequest, opts ...gax.CallOption) (*securitycenterpb.Finding, error) {
- ctx = insertMetadata(ctx, c.xGoogMetadata)
+ md := metadata.Pairs("x-goog-request-params", fmt.Sprintf("%s=%v", "name", req.GetName()))
+ ctx = insertMetadata(ctx, c.xGoogMetadata, md)
opts = append(c.CallOptions.SetFindingState[0:len(c.CallOptions.SetFindingState):len(c.CallOptions.SetFindingState)], opts...)
var resp *securitycenterpb.Finding
err := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error {
@@ -488,7 +501,8 @@
// SetIamPolicy sets the access control policy on the specified Source.
func (c *Client) SetIamPolicy(ctx context.Context, req *iampb.SetIamPolicyRequest, opts ...gax.CallOption) (*iampb.Policy, error) {
- ctx = insertMetadata(ctx, c.xGoogMetadata)
+ md := metadata.Pairs("x-goog-request-params", fmt.Sprintf("%s=%v", "resource", req.GetResource()))
+ ctx = insertMetadata(ctx, c.xGoogMetadata, md)
opts = append(c.CallOptions.SetIamPolicy[0:len(c.CallOptions.SetIamPolicy):len(c.CallOptions.SetIamPolicy)], opts...)
var resp *iampb.Policy
err := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error {
@@ -504,7 +518,8 @@
// TestIamPermissions returns the permissions that a caller has on the specified source.
func (c *Client) TestIamPermissions(ctx context.Context, req *iampb.TestIamPermissionsRequest, opts ...gax.CallOption) (*iampb.TestIamPermissionsResponse, error) {
- ctx = insertMetadata(ctx, c.xGoogMetadata)
+ md := metadata.Pairs("x-goog-request-params", fmt.Sprintf("%s=%v", "resource", req.GetResource()))
+ ctx = insertMetadata(ctx, c.xGoogMetadata, md)
opts = append(c.CallOptions.TestIamPermissions[0:len(c.CallOptions.TestIamPermissions):len(c.CallOptions.TestIamPermissions)], opts...)
var resp *iampb.TestIamPermissionsResponse
err := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error {
@@ -521,7 +536,8 @@
// UpdateFinding creates or updates a finding. The corresponding source must exist for a
// finding creation to succeed.
func (c *Client) UpdateFinding(ctx context.Context, req *securitycenterpb.UpdateFindingRequest, opts ...gax.CallOption) (*securitycenterpb.Finding, error) {
- ctx = insertMetadata(ctx, c.xGoogMetadata)
+ md := metadata.Pairs("x-goog-request-params", fmt.Sprintf("%s=%v", "finding.name", req.GetFinding().GetName()))
+ ctx = insertMetadata(ctx, c.xGoogMetadata, md)
opts = append(c.CallOptions.UpdateFinding[0:len(c.CallOptions.UpdateFinding):len(c.CallOptions.UpdateFinding)], opts...)
var resp *securitycenterpb.Finding
err := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error {
@@ -537,7 +553,8 @@
// UpdateOrganizationSettings updates an organization's settings.
func (c *Client) UpdateOrganizationSettings(ctx context.Context, req *securitycenterpb.UpdateOrganizationSettingsRequest, opts ...gax.CallOption) (*securitycenterpb.OrganizationSettings, error) {
- ctx = insertMetadata(ctx, c.xGoogMetadata)
+ md := metadata.Pairs("x-goog-request-params", fmt.Sprintf("%s=%v", "organization_settings.name", req.GetOrganizationSettings().GetName()))
+ ctx = insertMetadata(ctx, c.xGoogMetadata, md)
opts = append(c.CallOptions.UpdateOrganizationSettings[0:len(c.CallOptions.UpdateOrganizationSettings):len(c.CallOptions.UpdateOrganizationSettings)], opts...)
var resp *securitycenterpb.OrganizationSettings
err := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error {
@@ -553,7 +570,8 @@
// UpdateSource updates a source.
func (c *Client) UpdateSource(ctx context.Context, req *securitycenterpb.UpdateSourceRequest, opts ...gax.CallOption) (*securitycenterpb.Source, error) {
- ctx = insertMetadata(ctx, c.xGoogMetadata)
+ md := metadata.Pairs("x-goog-request-params", fmt.Sprintf("%s=%v", "source.name", req.GetSource().GetName()))
+ ctx = insertMetadata(ctx, c.xGoogMetadata, md)
opts = append(c.CallOptions.UpdateSource[0:len(c.CallOptions.UpdateSource):len(c.CallOptions.UpdateSource)], opts...)
var resp *securitycenterpb.Source
err := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error {
@@ -569,7 +587,8 @@
// UpdateSecurityMarks updates security marks.
func (c *Client) UpdateSecurityMarks(ctx context.Context, req *securitycenterpb.UpdateSecurityMarksRequest, opts ...gax.CallOption) (*securitycenterpb.SecurityMarks, error) {
- ctx = insertMetadata(ctx, c.xGoogMetadata)
+ md := metadata.Pairs("x-goog-request-params", fmt.Sprintf("%s=%v", "security_marks.name", req.GetSecurityMarks().GetName()))
+ ctx = insertMetadata(ctx, c.xGoogMetadata, md)
opts = append(c.CallOptions.UpdateSecurityMarks[0:len(c.CallOptions.UpdateSecurityMarks):len(c.CallOptions.UpdateSecurityMarks)], opts...)
var resp *securitycenterpb.SecurityMarks
err := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error {
diff --git a/securitycenter/apiv1beta1/doc.go b/securitycenter/apiv1beta1/doc.go
index 694df66..2a8e3aa 100644
--- a/securitycenter/apiv1beta1/doc.go
+++ b/securitycenter/apiv1beta1/doc.go
@@ -98,4 +98,4 @@
return "UNKNOWN"
}
-const versionClient = "20190322"
+const versionClient = "20190401"
diff --git a/securitycenter/apiv1beta1/security_center_client.go b/securitycenter/apiv1beta1/security_center_client.go
index 3cb3a0f..7003a35 100644
--- a/securitycenter/apiv1beta1/security_center_client.go
+++ b/securitycenter/apiv1beta1/security_center_client.go
@@ -18,6 +18,7 @@
import (
"context"
+ "fmt"
"math"
"time"
@@ -175,7 +176,8 @@
// CreateSource creates a source.
func (c *Client) CreateSource(ctx context.Context, req *securitycenterpb.CreateSourceRequest, opts ...gax.CallOption) (*securitycenterpb.Source, error) {
- ctx = insertMetadata(ctx, c.xGoogMetadata)
+ md := metadata.Pairs("x-goog-request-params", fmt.Sprintf("%s=%v", "parent", req.GetParent()))
+ ctx = insertMetadata(ctx, c.xGoogMetadata, md)
opts = append(c.CallOptions.CreateSource[0:len(c.CallOptions.CreateSource):len(c.CallOptions.CreateSource)], opts...)
var resp *securitycenterpb.Source
err := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error {
@@ -192,7 +194,8 @@
// CreateFinding creates a finding. The corresponding source must exist for finding creation
// to succeed.
func (c *Client) CreateFinding(ctx context.Context, req *securitycenterpb.CreateFindingRequest, opts ...gax.CallOption) (*securitycenterpb.Finding, error) {
- ctx = insertMetadata(ctx, c.xGoogMetadata)
+ md := metadata.Pairs("x-goog-request-params", fmt.Sprintf("%s=%v", "parent", req.GetParent()))
+ ctx = insertMetadata(ctx, c.xGoogMetadata, md)
opts = append(c.CallOptions.CreateFinding[0:len(c.CallOptions.CreateFinding):len(c.CallOptions.CreateFinding)], opts...)
var resp *securitycenterpb.Finding
err := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error {
@@ -208,7 +211,8 @@
// GetIamPolicy gets the access control policy on the specified Source.
func (c *Client) GetIamPolicy(ctx context.Context, req *iampb.GetIamPolicyRequest, opts ...gax.CallOption) (*iampb.Policy, error) {
- ctx = insertMetadata(ctx, c.xGoogMetadata)
+ md := metadata.Pairs("x-goog-request-params", fmt.Sprintf("%s=%v", "resource", req.GetResource()))
+ ctx = insertMetadata(ctx, c.xGoogMetadata, md)
opts = append(c.CallOptions.GetIamPolicy[0:len(c.CallOptions.GetIamPolicy):len(c.CallOptions.GetIamPolicy)], opts...)
var resp *iampb.Policy
err := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error {
@@ -224,7 +228,8 @@
// GetOrganizationSettings gets the settings for an organization.
func (c *Client) GetOrganizationSettings(ctx context.Context, req *securitycenterpb.GetOrganizationSettingsRequest, opts ...gax.CallOption) (*securitycenterpb.OrganizationSettings, error) {
- ctx = insertMetadata(ctx, c.xGoogMetadata)
+ md := metadata.Pairs("x-goog-request-params", fmt.Sprintf("%s=%v", "name", req.GetName()))
+ ctx = insertMetadata(ctx, c.xGoogMetadata, md)
opts = append(c.CallOptions.GetOrganizationSettings[0:len(c.CallOptions.GetOrganizationSettings):len(c.CallOptions.GetOrganizationSettings)], opts...)
var resp *securitycenterpb.OrganizationSettings
err := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error {
@@ -240,7 +245,8 @@
// GetSource gets a source.
func (c *Client) GetSource(ctx context.Context, req *securitycenterpb.GetSourceRequest, opts ...gax.CallOption) (*securitycenterpb.Source, error) {
- ctx = insertMetadata(ctx, c.xGoogMetadata)
+ md := metadata.Pairs("x-goog-request-params", fmt.Sprintf("%s=%v", "name", req.GetName()))
+ ctx = insertMetadata(ctx, c.xGoogMetadata, md)
opts = append(c.CallOptions.GetSource[0:len(c.CallOptions.GetSource):len(c.CallOptions.GetSource)], opts...)
var resp *securitycenterpb.Source
err := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error {
@@ -257,7 +263,8 @@
// GroupAssets filters an organization's assets and groups them by their specified
// properties.
func (c *Client) GroupAssets(ctx context.Context, req *securitycenterpb.GroupAssetsRequest, opts ...gax.CallOption) *GroupResultIterator {
- ctx = insertMetadata(ctx, c.xGoogMetadata)
+ md := metadata.Pairs("x-goog-request-params", fmt.Sprintf("%s=%v", "parent", req.GetParent()))
+ ctx = insertMetadata(ctx, c.xGoogMetadata, md)
opts = append(c.CallOptions.GroupAssets[0:len(c.CallOptions.GroupAssets):len(c.CallOptions.GroupAssets)], opts...)
it := &GroupResultIterator{}
req = proto.Clone(req).(*securitycenterpb.GroupAssetsRequest)
@@ -298,7 +305,8 @@
// To group across all sources provide a - as the source id.
// Example: /v1beta1/organizations/123/sources/-/findings
func (c *Client) GroupFindings(ctx context.Context, req *securitycenterpb.GroupFindingsRequest, opts ...gax.CallOption) *GroupResultIterator {
- ctx = insertMetadata(ctx, c.xGoogMetadata)
+ md := metadata.Pairs("x-goog-request-params", fmt.Sprintf("%s=%v", "parent", req.GetParent()))
+ ctx = insertMetadata(ctx, c.xGoogMetadata, md)
opts = append(c.CallOptions.GroupFindings[0:len(c.CallOptions.GroupFindings):len(c.CallOptions.GroupFindings)], opts...)
it := &GroupResultIterator{}
req = proto.Clone(req).(*securitycenterpb.GroupFindingsRequest)
@@ -335,7 +343,8 @@
// ListAssets lists an organization's assets.
func (c *Client) ListAssets(ctx context.Context, req *securitycenterpb.ListAssetsRequest, opts ...gax.CallOption) *ListAssetsResponse_ListAssetsResultIterator {
- ctx = insertMetadata(ctx, c.xGoogMetadata)
+ md := metadata.Pairs("x-goog-request-params", fmt.Sprintf("%s=%v", "parent", req.GetParent()))
+ ctx = insertMetadata(ctx, c.xGoogMetadata, md)
opts = append(c.CallOptions.ListAssets[0:len(c.CallOptions.ListAssets):len(c.CallOptions.ListAssets)], opts...)
it := &ListAssetsResponse_ListAssetsResultIterator{}
req = proto.Clone(req).(*securitycenterpb.ListAssetsRequest)
@@ -375,7 +384,8 @@
// To list across all sources provide a - as the source id.
// Example: /v1beta1/organizations/123/sources/-/findings
func (c *Client) ListFindings(ctx context.Context, req *securitycenterpb.ListFindingsRequest, opts ...gax.CallOption) *FindingIterator {
- ctx = insertMetadata(ctx, c.xGoogMetadata)
+ md := metadata.Pairs("x-goog-request-params", fmt.Sprintf("%s=%v", "parent", req.GetParent()))
+ ctx = insertMetadata(ctx, c.xGoogMetadata, md)
opts = append(c.CallOptions.ListFindings[0:len(c.CallOptions.ListFindings):len(c.CallOptions.ListFindings)], opts...)
it := &FindingIterator{}
req = proto.Clone(req).(*securitycenterpb.ListFindingsRequest)
@@ -412,7 +422,8 @@
// ListSources lists all sources belonging to an organization.
func (c *Client) ListSources(ctx context.Context, req *securitycenterpb.ListSourcesRequest, opts ...gax.CallOption) *SourceIterator {
- ctx = insertMetadata(ctx, c.xGoogMetadata)
+ md := metadata.Pairs("x-goog-request-params", fmt.Sprintf("%s=%v", "parent", req.GetParent()))
+ ctx = insertMetadata(ctx, c.xGoogMetadata, md)
opts = append(c.CallOptions.ListSources[0:len(c.CallOptions.ListSources):len(c.CallOptions.ListSources)], opts...)
it := &SourceIterator{}
req = proto.Clone(req).(*securitycenterpb.ListSourcesRequest)
@@ -454,7 +465,8 @@
// it is called too frequently the caller will receive a TOO_MANY_REQUESTS
// error.
func (c *Client) RunAssetDiscovery(ctx context.Context, req *securitycenterpb.RunAssetDiscoveryRequest, opts ...gax.CallOption) (*RunAssetDiscoveryOperation, error) {
- ctx = insertMetadata(ctx, c.xGoogMetadata)
+ md := metadata.Pairs("x-goog-request-params", fmt.Sprintf("%s=%v", "parent", req.GetParent()))
+ ctx = insertMetadata(ctx, c.xGoogMetadata, md)
opts = append(c.CallOptions.RunAssetDiscovery[0:len(c.CallOptions.RunAssetDiscovery):len(c.CallOptions.RunAssetDiscovery)], opts...)
var resp *longrunningpb.Operation
err := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error {
@@ -472,7 +484,8 @@
// SetFindingState updates the state of a finding.
func (c *Client) SetFindingState(ctx context.Context, req *securitycenterpb.SetFindingStateRequest, opts ...gax.CallOption) (*securitycenterpb.Finding, error) {
- ctx = insertMetadata(ctx, c.xGoogMetadata)
+ md := metadata.Pairs("x-goog-request-params", fmt.Sprintf("%s=%v", "name", req.GetName()))
+ ctx = insertMetadata(ctx, c.xGoogMetadata, md)
opts = append(c.CallOptions.SetFindingState[0:len(c.CallOptions.SetFindingState):len(c.CallOptions.SetFindingState)], opts...)
var resp *securitycenterpb.Finding
err := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error {
@@ -488,7 +501,8 @@
// SetIamPolicy sets the access control policy on the specified Source.
func (c *Client) SetIamPolicy(ctx context.Context, req *iampb.SetIamPolicyRequest, opts ...gax.CallOption) (*iampb.Policy, error) {
- ctx = insertMetadata(ctx, c.xGoogMetadata)
+ md := metadata.Pairs("x-goog-request-params", fmt.Sprintf("%s=%v", "resource", req.GetResource()))
+ ctx = insertMetadata(ctx, c.xGoogMetadata, md)
opts = append(c.CallOptions.SetIamPolicy[0:len(c.CallOptions.SetIamPolicy):len(c.CallOptions.SetIamPolicy)], opts...)
var resp *iampb.Policy
err := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error {
@@ -504,7 +518,8 @@
// TestIamPermissions returns the permissions that a caller has on the specified source.
func (c *Client) TestIamPermissions(ctx context.Context, req *iampb.TestIamPermissionsRequest, opts ...gax.CallOption) (*iampb.TestIamPermissionsResponse, error) {
- ctx = insertMetadata(ctx, c.xGoogMetadata)
+ md := metadata.Pairs("x-goog-request-params", fmt.Sprintf("%s=%v", "resource", req.GetResource()))
+ ctx = insertMetadata(ctx, c.xGoogMetadata, md)
opts = append(c.CallOptions.TestIamPermissions[0:len(c.CallOptions.TestIamPermissions):len(c.CallOptions.TestIamPermissions)], opts...)
var resp *iampb.TestIamPermissionsResponse
err := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error {
@@ -521,7 +536,8 @@
// UpdateFinding creates or updates a finding. The corresponding source must exist for a
// finding creation to succeed.
func (c *Client) UpdateFinding(ctx context.Context, req *securitycenterpb.UpdateFindingRequest, opts ...gax.CallOption) (*securitycenterpb.Finding, error) {
- ctx = insertMetadata(ctx, c.xGoogMetadata)
+ md := metadata.Pairs("x-goog-request-params", fmt.Sprintf("%s=%v", "finding.name", req.GetFinding().GetName()))
+ ctx = insertMetadata(ctx, c.xGoogMetadata, md)
opts = append(c.CallOptions.UpdateFinding[0:len(c.CallOptions.UpdateFinding):len(c.CallOptions.UpdateFinding)], opts...)
var resp *securitycenterpb.Finding
err := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error {
@@ -537,7 +553,8 @@
// UpdateOrganizationSettings updates an organization's settings.
func (c *Client) UpdateOrganizationSettings(ctx context.Context, req *securitycenterpb.UpdateOrganizationSettingsRequest, opts ...gax.CallOption) (*securitycenterpb.OrganizationSettings, error) {
- ctx = insertMetadata(ctx, c.xGoogMetadata)
+ md := metadata.Pairs("x-goog-request-params", fmt.Sprintf("%s=%v", "organization_settings.name", req.GetOrganizationSettings().GetName()))
+ ctx = insertMetadata(ctx, c.xGoogMetadata, md)
opts = append(c.CallOptions.UpdateOrganizationSettings[0:len(c.CallOptions.UpdateOrganizationSettings):len(c.CallOptions.UpdateOrganizationSettings)], opts...)
var resp *securitycenterpb.OrganizationSettings
err := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error {
@@ -553,7 +570,8 @@
// UpdateSource updates a source.
func (c *Client) UpdateSource(ctx context.Context, req *securitycenterpb.UpdateSourceRequest, opts ...gax.CallOption) (*securitycenterpb.Source, error) {
- ctx = insertMetadata(ctx, c.xGoogMetadata)
+ md := metadata.Pairs("x-goog-request-params", fmt.Sprintf("%s=%v", "source.name", req.GetSource().GetName()))
+ ctx = insertMetadata(ctx, c.xGoogMetadata, md)
opts = append(c.CallOptions.UpdateSource[0:len(c.CallOptions.UpdateSource):len(c.CallOptions.UpdateSource)], opts...)
var resp *securitycenterpb.Source
err := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error {
@@ -569,7 +587,8 @@
// UpdateSecurityMarks updates security marks.
func (c *Client) UpdateSecurityMarks(ctx context.Context, req *securitycenterpb.UpdateSecurityMarksRequest, opts ...gax.CallOption) (*securitycenterpb.SecurityMarks, error) {
- ctx = insertMetadata(ctx, c.xGoogMetadata)
+ md := metadata.Pairs("x-goog-request-params", fmt.Sprintf("%s=%v", "security_marks.name", req.GetSecurityMarks().GetName()))
+ ctx = insertMetadata(ctx, c.xGoogMetadata, md)
opts = append(c.CallOptions.UpdateSecurityMarks[0:len(c.CallOptions.UpdateSecurityMarks):len(c.CallOptions.UpdateSecurityMarks)], opts...)
var resp *securitycenterpb.SecurityMarks
err := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error {
diff --git a/spanner/admin/database/apiv1/database_admin_client.go b/spanner/admin/database/apiv1/database_admin_client.go
index 1c42bff..6c4894f 100644
--- a/spanner/admin/database/apiv1/database_admin_client.go
+++ b/spanner/admin/database/apiv1/database_admin_client.go
@@ -18,6 +18,7 @@
import (
"context"
+ "fmt"
"math"
"time"
@@ -161,7 +162,8 @@
// ListDatabases lists Cloud Spanner databases.
func (c *DatabaseAdminClient) ListDatabases(ctx context.Context, req *databasepb.ListDatabasesRequest, opts ...gax.CallOption) *DatabaseIterator {
- ctx = insertMetadata(ctx, c.xGoogMetadata)
+ md := metadata.Pairs("x-goog-request-params", fmt.Sprintf("%s=%v", "parent", req.GetParent()))
+ ctx = insertMetadata(ctx, c.xGoogMetadata, md)
opts = append(c.CallOptions.ListDatabases[0:len(c.CallOptions.ListDatabases):len(c.CallOptions.ListDatabases)], opts...)
it := &DatabaseIterator{}
req = proto.Clone(req).(*databasepb.ListDatabasesRequest)
@@ -205,7 +207,8 @@
// The [response][google.longrunning.Operation.response] field type is
// [Database][google.spanner.admin.database.v1.Database], if successful.
func (c *DatabaseAdminClient) CreateDatabase(ctx context.Context, req *databasepb.CreateDatabaseRequest, opts ...gax.CallOption) (*CreateDatabaseOperation, error) {
- ctx = insertMetadata(ctx, c.xGoogMetadata)
+ md := metadata.Pairs("x-goog-request-params", fmt.Sprintf("%s=%v", "parent", req.GetParent()))
+ ctx = insertMetadata(ctx, c.xGoogMetadata, md)
opts = append(c.CallOptions.CreateDatabase[0:len(c.CallOptions.CreateDatabase):len(c.CallOptions.CreateDatabase)], opts...)
var resp *longrunningpb.Operation
err := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error {
@@ -223,7 +226,8 @@
// GetDatabase gets the state of a Cloud Spanner database.
func (c *DatabaseAdminClient) GetDatabase(ctx context.Context, req *databasepb.GetDatabaseRequest, opts ...gax.CallOption) (*databasepb.Database, error) {
- ctx = insertMetadata(ctx, c.xGoogMetadata)
+ md := metadata.Pairs("x-goog-request-params", fmt.Sprintf("%s=%v", "name", req.GetName()))
+ ctx = insertMetadata(ctx, c.xGoogMetadata, md)
opts = append(c.CallOptions.GetDatabase[0:len(c.CallOptions.GetDatabase):len(c.CallOptions.GetDatabase)], opts...)
var resp *databasepb.Database
err := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error {
@@ -246,7 +250,8 @@
// [UpdateDatabaseDdlMetadata][google.spanner.admin.database.v1.UpdateDatabaseDdlMetadata].
// The operation has no response.
func (c *DatabaseAdminClient) UpdateDatabaseDdl(ctx context.Context, req *databasepb.UpdateDatabaseDdlRequest, opts ...gax.CallOption) (*UpdateDatabaseDdlOperation, error) {
- ctx = insertMetadata(ctx, c.xGoogMetadata)
+ md := metadata.Pairs("x-goog-request-params", fmt.Sprintf("%s=%v", "database", req.GetDatabase()))
+ ctx = insertMetadata(ctx, c.xGoogMetadata, md)
opts = append(c.CallOptions.UpdateDatabaseDdl[0:len(c.CallOptions.UpdateDatabaseDdl):len(c.CallOptions.UpdateDatabaseDdl)], opts...)
var resp *longrunningpb.Operation
err := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error {
@@ -264,7 +269,8 @@
// DropDatabase drops (aka deletes) a Cloud Spanner database.
func (c *DatabaseAdminClient) DropDatabase(ctx context.Context, req *databasepb.DropDatabaseRequest, opts ...gax.CallOption) error {
- ctx = insertMetadata(ctx, c.xGoogMetadata)
+ md := metadata.Pairs("x-goog-request-params", fmt.Sprintf("%s=%v", "database", req.GetDatabase()))
+ ctx = insertMetadata(ctx, c.xGoogMetadata, md)
opts = append(c.CallOptions.DropDatabase[0:len(c.CallOptions.DropDatabase):len(c.CallOptions.DropDatabase)], opts...)
err := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error {
var err error
@@ -278,7 +284,8 @@
// DDL statements. This method does not show pending schema updates, those may
// be queried using the [Operations][google.longrunning.Operations] API.
func (c *DatabaseAdminClient) GetDatabaseDdl(ctx context.Context, req *databasepb.GetDatabaseDdlRequest, opts ...gax.CallOption) (*databasepb.GetDatabaseDdlResponse, error) {
- ctx = insertMetadata(ctx, c.xGoogMetadata)
+ md := metadata.Pairs("x-goog-request-params", fmt.Sprintf("%s=%v", "database", req.GetDatabase()))
+ ctx = insertMetadata(ctx, c.xGoogMetadata, md)
opts = append(c.CallOptions.GetDatabaseDdl[0:len(c.CallOptions.GetDatabaseDdl):len(c.CallOptions.GetDatabaseDdl)], opts...)
var resp *databasepb.GetDatabaseDdlResponse
err := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error {
@@ -298,7 +305,8 @@
// Authorization requires spanner.databases.setIamPolicy permission on
// [resource][google.iam.v1.SetIamPolicyRequest.resource].
func (c *DatabaseAdminClient) SetIamPolicy(ctx context.Context, req *iampb.SetIamPolicyRequest, opts ...gax.CallOption) (*iampb.Policy, error) {
- ctx = insertMetadata(ctx, c.xGoogMetadata)
+ md := metadata.Pairs("x-goog-request-params", fmt.Sprintf("%s=%v", "resource", req.GetResource()))
+ ctx = insertMetadata(ctx, c.xGoogMetadata, md)
opts = append(c.CallOptions.SetIamPolicy[0:len(c.CallOptions.SetIamPolicy):len(c.CallOptions.SetIamPolicy)], opts...)
var resp *iampb.Policy
err := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error {
@@ -318,7 +326,8 @@
// Authorization requires spanner.databases.getIamPolicy permission on
// [resource][google.iam.v1.GetIamPolicyRequest.resource].
func (c *DatabaseAdminClient) GetIamPolicy(ctx context.Context, req *iampb.GetIamPolicyRequest, opts ...gax.CallOption) (*iampb.Policy, error) {
- ctx = insertMetadata(ctx, c.xGoogMetadata)
+ md := metadata.Pairs("x-goog-request-params", fmt.Sprintf("%s=%v", "resource", req.GetResource()))
+ ctx = insertMetadata(ctx, c.xGoogMetadata, md)
opts = append(c.CallOptions.GetIamPolicy[0:len(c.CallOptions.GetIamPolicy):len(c.CallOptions.GetIamPolicy)], opts...)
var resp *iampb.Policy
err := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error {
@@ -339,7 +348,8 @@
// the containing Cloud Spanner instance. Otherwise returns an empty set of
// permissions.
func (c *DatabaseAdminClient) TestIamPermissions(ctx context.Context, req *iampb.TestIamPermissionsRequest, opts ...gax.CallOption) (*iampb.TestIamPermissionsResponse, error) {
- ctx = insertMetadata(ctx, c.xGoogMetadata)
+ md := metadata.Pairs("x-goog-request-params", fmt.Sprintf("%s=%v", "resource", req.GetResource()))
+ ctx = insertMetadata(ctx, c.xGoogMetadata, md)
opts = append(c.CallOptions.TestIamPermissions[0:len(c.CallOptions.TestIamPermissions):len(c.CallOptions.TestIamPermissions)], opts...)
var resp *iampb.TestIamPermissionsResponse
err := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error {
diff --git a/spanner/admin/database/apiv1/doc.go b/spanner/admin/database/apiv1/doc.go
index da928ac..4c031a0 100644
--- a/spanner/admin/database/apiv1/doc.go
+++ b/spanner/admin/database/apiv1/doc.go
@@ -97,4 +97,4 @@
return "UNKNOWN"
}
-const versionClient = "20190322"
+const versionClient = "20190401"
diff --git a/spanner/admin/instance/apiv1/doc.go b/spanner/admin/instance/apiv1/doc.go
index e9f350d..50fd082 100644
--- a/spanner/admin/instance/apiv1/doc.go
+++ b/spanner/admin/instance/apiv1/doc.go
@@ -97,4 +97,4 @@
return "UNKNOWN"
}
-const versionClient = "20190322"
+const versionClient = "20190401"
diff --git a/spanner/admin/instance/apiv1/instance_admin_client.go b/spanner/admin/instance/apiv1/instance_admin_client.go
index 2c23989..6d72b91 100644
--- a/spanner/admin/instance/apiv1/instance_admin_client.go
+++ b/spanner/admin/instance/apiv1/instance_admin_client.go
@@ -18,6 +18,7 @@
import (
"context"
+ "fmt"
"math"
"time"
@@ -179,7 +180,8 @@
// ListInstanceConfigs lists the supported instance configurations for a given project.
func (c *InstanceAdminClient) ListInstanceConfigs(ctx context.Context, req *instancepb.ListInstanceConfigsRequest, opts ...gax.CallOption) *InstanceConfigIterator {
- ctx = insertMetadata(ctx, c.xGoogMetadata)
+ md := metadata.Pairs("x-goog-request-params", fmt.Sprintf("%s=%v", "parent", req.GetParent()))
+ ctx = insertMetadata(ctx, c.xGoogMetadata, md)
opts = append(c.CallOptions.ListInstanceConfigs[0:len(c.CallOptions.ListInstanceConfigs):len(c.CallOptions.ListInstanceConfigs)], opts...)
it := &InstanceConfigIterator{}
req = proto.Clone(req).(*instancepb.ListInstanceConfigsRequest)
@@ -216,7 +218,8 @@
// GetInstanceConfig gets information about a particular instance configuration.
func (c *InstanceAdminClient) GetInstanceConfig(ctx context.Context, req *instancepb.GetInstanceConfigRequest, opts ...gax.CallOption) (*instancepb.InstanceConfig, error) {
- ctx = insertMetadata(ctx, c.xGoogMetadata)
+ md := metadata.Pairs("x-goog-request-params", fmt.Sprintf("%s=%v", "name", req.GetName()))
+ ctx = insertMetadata(ctx, c.xGoogMetadata, md)
opts = append(c.CallOptions.GetInstanceConfig[0:len(c.CallOptions.GetInstanceConfig):len(c.CallOptions.GetInstanceConfig)], opts...)
var resp *instancepb.InstanceConfig
err := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error {
@@ -232,7 +235,8 @@
// ListInstances lists all instances in the given project.
func (c *InstanceAdminClient) ListInstances(ctx context.Context, req *instancepb.ListInstancesRequest, opts ...gax.CallOption) *InstanceIterator {
- ctx = insertMetadata(ctx, c.xGoogMetadata)
+ md := metadata.Pairs("x-goog-request-params", fmt.Sprintf("%s=%v", "parent", req.GetParent()))
+ ctx = insertMetadata(ctx, c.xGoogMetadata, md)
opts = append(c.CallOptions.ListInstances[0:len(c.CallOptions.ListInstances):len(c.CallOptions.ListInstances)], opts...)
it := &InstanceIterator{}
req = proto.Clone(req).(*instancepb.ListInstancesRequest)
@@ -269,7 +273,8 @@
// GetInstance gets information about a particular instance.
func (c *InstanceAdminClient) GetInstance(ctx context.Context, req *instancepb.GetInstanceRequest, opts ...gax.CallOption) (*instancepb.Instance, error) {
- ctx = insertMetadata(ctx, c.xGoogMetadata)
+ md := metadata.Pairs("x-goog-request-params", fmt.Sprintf("%s=%v", "name", req.GetName()))
+ ctx = insertMetadata(ctx, c.xGoogMetadata, md)
opts = append(c.CallOptions.GetInstance[0:len(c.CallOptions.GetInstance):len(c.CallOptions.GetInstance)], opts...)
var resp *instancepb.Instance
err := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error {
@@ -323,7 +328,8 @@
// The [response][google.longrunning.Operation.response] field type is
// [Instance][google.spanner.admin.instance.v1.Instance], if successful.
func (c *InstanceAdminClient) CreateInstance(ctx context.Context, req *instancepb.CreateInstanceRequest, opts ...gax.CallOption) (*CreateInstanceOperation, error) {
- ctx = insertMetadata(ctx, c.xGoogMetadata)
+ md := metadata.Pairs("x-goog-request-params", fmt.Sprintf("%s=%v", "parent", req.GetParent()))
+ ctx = insertMetadata(ctx, c.xGoogMetadata, md)
opts = append(c.CallOptions.CreateInstance[0:len(c.CallOptions.CreateInstance):len(c.CallOptions.CreateInstance)], opts...)
var resp *longrunningpb.Operation
err := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error {
@@ -384,7 +390,8 @@
// Authorization requires spanner.instances.update permission on
// resource [name][google.spanner.admin.instance.v1.Instance.name].
func (c *InstanceAdminClient) UpdateInstance(ctx context.Context, req *instancepb.UpdateInstanceRequest, opts ...gax.CallOption) (*UpdateInstanceOperation, error) {
- ctx = insertMetadata(ctx, c.xGoogMetadata)
+ md := metadata.Pairs("x-goog-request-params", fmt.Sprintf("%s=%v", "instance.name", req.GetInstance().GetName()))
+ ctx = insertMetadata(ctx, c.xGoogMetadata, md)
opts = append(c.CallOptions.UpdateInstance[0:len(c.CallOptions.UpdateInstance):len(c.CallOptions.UpdateInstance)], opts...)
var resp *longrunningpb.Operation
err := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error {
@@ -412,7 +419,8 @@
// irrevocably disappear from the API. All data in the databases
// is permanently deleted.
func (c *InstanceAdminClient) DeleteInstance(ctx context.Context, req *instancepb.DeleteInstanceRequest, opts ...gax.CallOption) error {
- ctx = insertMetadata(ctx, c.xGoogMetadata)
+ md := metadata.Pairs("x-goog-request-params", fmt.Sprintf("%s=%v", "name", req.GetName()))
+ ctx = insertMetadata(ctx, c.xGoogMetadata, md)
opts = append(c.CallOptions.DeleteInstance[0:len(c.CallOptions.DeleteInstance):len(c.CallOptions.DeleteInstance)], opts...)
err := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error {
var err error
@@ -428,7 +436,8 @@
// Authorization requires spanner.instances.setIamPolicy on
// [resource][google.iam.v1.SetIamPolicyRequest.resource].
func (c *InstanceAdminClient) SetIamPolicy(ctx context.Context, req *iampb.SetIamPolicyRequest, opts ...gax.CallOption) (*iampb.Policy, error) {
- ctx = insertMetadata(ctx, c.xGoogMetadata)
+ md := metadata.Pairs("x-goog-request-params", fmt.Sprintf("%s=%v", "resource", req.GetResource()))
+ ctx = insertMetadata(ctx, c.xGoogMetadata, md)
opts = append(c.CallOptions.SetIamPolicy[0:len(c.CallOptions.SetIamPolicy):len(c.CallOptions.SetIamPolicy)], opts...)
var resp *iampb.Policy
err := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error {
@@ -448,7 +457,8 @@
// Authorization requires spanner.instances.getIamPolicy on
// [resource][google.iam.v1.GetIamPolicyRequest.resource].
func (c *InstanceAdminClient) GetIamPolicy(ctx context.Context, req *iampb.GetIamPolicyRequest, opts ...gax.CallOption) (*iampb.Policy, error) {
- ctx = insertMetadata(ctx, c.xGoogMetadata)
+ md := metadata.Pairs("x-goog-request-params", fmt.Sprintf("%s=%v", "resource", req.GetResource()))
+ ctx = insertMetadata(ctx, c.xGoogMetadata, md)
opts = append(c.CallOptions.GetIamPolicy[0:len(c.CallOptions.GetIamPolicy):len(c.CallOptions.GetIamPolicy)], opts...)
var resp *iampb.Policy
err := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error {
@@ -469,7 +479,8 @@
// permission on the containing Google Cloud Project. Otherwise returns an
// empty set of permissions.
func (c *InstanceAdminClient) TestIamPermissions(ctx context.Context, req *iampb.TestIamPermissionsRequest, opts ...gax.CallOption) (*iampb.TestIamPermissionsResponse, error) {
- ctx = insertMetadata(ctx, c.xGoogMetadata)
+ md := metadata.Pairs("x-goog-request-params", fmt.Sprintf("%s=%v", "resource", req.GetResource()))
+ ctx = insertMetadata(ctx, c.xGoogMetadata, md)
opts = append(c.CallOptions.TestIamPermissions[0:len(c.CallOptions.TestIamPermissions):len(c.CallOptions.TestIamPermissions)], opts...)
var resp *iampb.TestIamPermissionsResponse
err := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error {
diff --git a/spanner/apiv1/doc.go b/spanner/apiv1/doc.go
index afa665b..7bf9e93 100644
--- a/spanner/apiv1/doc.go
+++ b/spanner/apiv1/doc.go
@@ -100,4 +100,4 @@
return "UNKNOWN"
}
-const versionClient = "20190322"
+const versionClient = "20190401"
diff --git a/spanner/apiv1/spanner_client.go b/spanner/apiv1/spanner_client.go
index 35743fb..8b7e967 100644
--- a/spanner/apiv1/spanner_client.go
+++ b/spanner/apiv1/spanner_client.go
@@ -18,6 +18,7 @@
import (
"context"
+ "fmt"
"math"
"time"
@@ -179,7 +180,8 @@
// Idle sessions can be kept alive by sending a trivial SQL query
// periodically, e.g., "SELECT 1".
func (c *Client) CreateSession(ctx context.Context, req *spannerpb.CreateSessionRequest, opts ...gax.CallOption) (*spannerpb.Session, error) {
- ctx = insertMetadata(ctx, c.xGoogMetadata)
+ md := metadata.Pairs("x-goog-request-params", fmt.Sprintf("%s=%v", "database", req.GetDatabase()))
+ ctx = insertMetadata(ctx, c.xGoogMetadata, md)
opts = append(c.CallOptions.CreateSession[0:len(c.CallOptions.CreateSession):len(c.CallOptions.CreateSession)], opts...)
var resp *spannerpb.Session
err := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error {
@@ -197,7 +199,8 @@
// This is mainly useful for determining whether a session is still
// alive.
func (c *Client) GetSession(ctx context.Context, req *spannerpb.GetSessionRequest, opts ...gax.CallOption) (*spannerpb.Session, error) {
- ctx = insertMetadata(ctx, c.xGoogMetadata)
+ md := metadata.Pairs("x-goog-request-params", fmt.Sprintf("%s=%v", "name", req.GetName()))
+ ctx = insertMetadata(ctx, c.xGoogMetadata, md)
opts = append(c.CallOptions.GetSession[0:len(c.CallOptions.GetSession):len(c.CallOptions.GetSession)], opts...)
var resp *spannerpb.Session
err := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error {
@@ -213,7 +216,8 @@
// ListSessions lists all sessions in a given database.
func (c *Client) ListSessions(ctx context.Context, req *spannerpb.ListSessionsRequest, opts ...gax.CallOption) *SessionIterator {
- ctx = insertMetadata(ctx, c.xGoogMetadata)
+ md := metadata.Pairs("x-goog-request-params", fmt.Sprintf("%s=%v", "database", req.GetDatabase()))
+ ctx = insertMetadata(ctx, c.xGoogMetadata, md)
opts = append(c.CallOptions.ListSessions[0:len(c.CallOptions.ListSessions):len(c.CallOptions.ListSessions)], opts...)
it := &SessionIterator{}
req = proto.Clone(req).(*spannerpb.ListSessionsRequest)
@@ -252,7 +256,8 @@
// asynchronously trigger cancellation of any operations that are running with
// this session.
func (c *Client) DeleteSession(ctx context.Context, req *spannerpb.DeleteSessionRequest, opts ...gax.CallOption) error {
- ctx = insertMetadata(ctx, c.xGoogMetadata)
+ md := metadata.Pairs("x-goog-request-params", fmt.Sprintf("%s=%v", "name", req.GetName()))
+ ctx = insertMetadata(ctx, c.xGoogMetadata, md)
opts = append(c.CallOptions.DeleteSession[0:len(c.CallOptions.DeleteSession):len(c.CallOptions.DeleteSession)], opts...)
err := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error {
var err error
@@ -276,7 +281,8 @@
// [ExecuteStreamingSql][google.spanner.v1.Spanner.ExecuteStreamingSql]
// instead.
func (c *Client) ExecuteSql(ctx context.Context, req *spannerpb.ExecuteSqlRequest, opts ...gax.CallOption) (*spannerpb.ResultSet, error) {
- ctx = insertMetadata(ctx, c.xGoogMetadata)
+ md := metadata.Pairs("x-goog-request-params", fmt.Sprintf("%s=%v", "session", req.GetSession()))
+ ctx = insertMetadata(ctx, c.xGoogMetadata, md)
opts = append(c.CallOptions.ExecuteSql[0:len(c.CallOptions.ExecuteSql):len(c.CallOptions.ExecuteSql)], opts...)
var resp *spannerpb.ResultSet
err := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error {
@@ -296,7 +302,8 @@
// the size of the returned result set. However, no individual row in the
// result set can exceed 100 MiB, and no column value can exceed 10 MiB.
func (c *Client) ExecuteStreamingSql(ctx context.Context, req *spannerpb.ExecuteSqlRequest, opts ...gax.CallOption) (spannerpb.Spanner_ExecuteStreamingSqlClient, error) {
- ctx = insertMetadata(ctx, c.xGoogMetadata)
+ md := metadata.Pairs("x-goog-request-params", fmt.Sprintf("%s=%v", "session", req.GetSession()))
+ ctx = insertMetadata(ctx, c.xGoogMetadata, md)
opts = append(c.CallOptions.ExecuteStreamingSql[0:len(c.CallOptions.ExecuteStreamingSql):len(c.CallOptions.ExecuteStreamingSql)], opts...)
var resp spannerpb.Spanner_ExecuteStreamingSqlClient
err := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error {
@@ -330,7 +337,8 @@
// [ExecuteBatchDmlRequest][Spanner.ExecuteBatchDmlRequest] and
// [ExecuteBatchDmlResponse][Spanner.ExecuteBatchDmlResponse].
func (c *Client) ExecuteBatchDml(ctx context.Context, req *spannerpb.ExecuteBatchDmlRequest, opts ...gax.CallOption) (*spannerpb.ExecuteBatchDmlResponse, error) {
- ctx = insertMetadata(ctx, c.xGoogMetadata)
+ md := metadata.Pairs("x-goog-request-params", fmt.Sprintf("%s=%v", "session", req.GetSession()))
+ ctx = insertMetadata(ctx, c.xGoogMetadata, md)
opts = append(c.CallOptions.ExecuteBatchDml[0:len(c.CallOptions.ExecuteBatchDml):len(c.CallOptions.ExecuteBatchDml)], opts...)
var resp *spannerpb.ExecuteBatchDmlResponse
err := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error {
@@ -359,7 +367,8 @@
// Larger result sets can be yielded in streaming fashion by calling
// [StreamingRead][google.spanner.v1.Spanner.StreamingRead] instead.
func (c *Client) Read(ctx context.Context, req *spannerpb.ReadRequest, opts ...gax.CallOption) (*spannerpb.ResultSet, error) {
- ctx = insertMetadata(ctx, c.xGoogMetadata)
+ md := metadata.Pairs("x-goog-request-params", fmt.Sprintf("%s=%v", "session", req.GetSession()))
+ ctx = insertMetadata(ctx, c.xGoogMetadata, md)
opts = append(c.CallOptions.Read[0:len(c.CallOptions.Read):len(c.CallOptions.Read)], opts...)
var resp *spannerpb.ResultSet
err := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error {
@@ -379,7 +388,8 @@
// the result set can exceed 100 MiB, and no column value can exceed
// 10 MiB.
func (c *Client) StreamingRead(ctx context.Context, req *spannerpb.ReadRequest, opts ...gax.CallOption) (spannerpb.Spanner_StreamingReadClient, error) {
- ctx = insertMetadata(ctx, c.xGoogMetadata)
+ md := metadata.Pairs("x-goog-request-params", fmt.Sprintf("%s=%v", "session", req.GetSession()))
+ ctx = insertMetadata(ctx, c.xGoogMetadata, md)
opts = append(c.CallOptions.StreamingRead[0:len(c.CallOptions.StreamingRead):len(c.CallOptions.StreamingRead)], opts...)
var resp spannerpb.Spanner_StreamingReadClient
err := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error {
@@ -399,7 +409,8 @@
// [Commit][google.spanner.v1.Spanner.Commit] can begin a new transaction as a
// side-effect.
func (c *Client) BeginTransaction(ctx context.Context, req *spannerpb.BeginTransactionRequest, opts ...gax.CallOption) (*spannerpb.Transaction, error) {
- ctx = insertMetadata(ctx, c.xGoogMetadata)
+ md := metadata.Pairs("x-goog-request-params", fmt.Sprintf("%s=%v", "session", req.GetSession()))
+ ctx = insertMetadata(ctx, c.xGoogMetadata, md)
opts = append(c.CallOptions.BeginTransaction[0:len(c.CallOptions.BeginTransaction):len(c.CallOptions.BeginTransaction)], opts...)
var resp *spannerpb.Transaction
err := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error {
@@ -422,7 +433,8 @@
// reasons. If Commit returns ABORTED, the caller should re-attempt
// the transaction from the beginning, re-using the same session.
func (c *Client) Commit(ctx context.Context, req *spannerpb.CommitRequest, opts ...gax.CallOption) (*spannerpb.CommitResponse, error) {
- ctx = insertMetadata(ctx, c.xGoogMetadata)
+ md := metadata.Pairs("x-goog-request-params", fmt.Sprintf("%s=%v", "session", req.GetSession()))
+ ctx = insertMetadata(ctx, c.xGoogMetadata, md)
opts = append(c.CallOptions.Commit[0:len(c.CallOptions.Commit):len(c.CallOptions.Commit)], opts...)
var resp *spannerpb.CommitResponse
err := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error {
@@ -446,7 +458,8 @@
// transaction was already aborted, or the transaction is not
// found. Rollback never returns ABORTED.
func (c *Client) Rollback(ctx context.Context, req *spannerpb.RollbackRequest, opts ...gax.CallOption) error {
- ctx = insertMetadata(ctx, c.xGoogMetadata)
+ md := metadata.Pairs("x-goog-request-params", fmt.Sprintf("%s=%v", "session", req.GetSession()))
+ ctx = insertMetadata(ctx, c.xGoogMetadata, md)
opts = append(c.CallOptions.Rollback[0:len(c.CallOptions.Rollback):len(c.CallOptions.Rollback)], opts...)
err := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error {
var err error
@@ -469,7 +482,8 @@
// old. When any of these happen, it is not possible to resume the query, and
// the whole operation must be restarted from the beginning.
func (c *Client) PartitionQuery(ctx context.Context, req *spannerpb.PartitionQueryRequest, opts ...gax.CallOption) (*spannerpb.PartitionResponse, error) {
- ctx = insertMetadata(ctx, c.xGoogMetadata)
+ md := metadata.Pairs("x-goog-request-params", fmt.Sprintf("%s=%v", "session", req.GetSession()))
+ ctx = insertMetadata(ctx, c.xGoogMetadata, md)
opts = append(c.CallOptions.PartitionQuery[0:len(c.CallOptions.PartitionQuery):len(c.CallOptions.PartitionQuery)], opts...)
var resp *spannerpb.PartitionResponse
err := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error {
@@ -498,7 +512,8 @@
// old. When any of these happen, it is not possible to resume the read, and
// the whole operation must be restarted from the beginning.
func (c *Client) PartitionRead(ctx context.Context, req *spannerpb.PartitionReadRequest, opts ...gax.CallOption) (*spannerpb.PartitionResponse, error) {
- ctx = insertMetadata(ctx, c.xGoogMetadata)
+ md := metadata.Pairs("x-goog-request-params", fmt.Sprintf("%s=%v", "session", req.GetSession()))
+ ctx = insertMetadata(ctx, c.xGoogMetadata, md)
opts = append(c.CallOptions.PartitionRead[0:len(c.CallOptions.PartitionRead):len(c.CallOptions.PartitionRead)], opts...)
var resp *spannerpb.PartitionResponse
err := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error {
diff --git a/speech/apiv1/doc.go b/speech/apiv1/doc.go
index 18bc67b..1f2b410 100644
--- a/speech/apiv1/doc.go
+++ b/speech/apiv1/doc.go
@@ -96,4 +96,4 @@
return "UNKNOWN"
}
-const versionClient = "20190322"
+const versionClient = "20190401"
diff --git a/speech/apiv1p1beta1/doc.go b/speech/apiv1p1beta1/doc.go
index 19095d3..0775d8f 100644
--- a/speech/apiv1p1beta1/doc.go
+++ b/speech/apiv1p1beta1/doc.go
@@ -97,4 +97,4 @@
return "UNKNOWN"
}
-const versionClient = "20190322"
+const versionClient = "20190401"
diff --git a/talent/apiv4beta1/application_client.go b/talent/apiv4beta1/application_client.go
new file mode 100644
index 0000000..df1ee11
--- /dev/null
+++ b/talent/apiv4beta1/application_client.go
@@ -0,0 +1,274 @@
+// Copyright 2019 Google LLC
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// https://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+// Code generated by gapic-generator. DO NOT EDIT.
+
+package talent
+
+import (
+ "context"
+ "fmt"
+ "math"
+ "time"
+
+ "github.com/golang/protobuf/proto"
+ gax "github.com/googleapis/gax-go/v2"
+ "google.golang.org/api/iterator"
+ "google.golang.org/api/option"
+ "google.golang.org/api/transport"
+ talentpb "google.golang.org/genproto/googleapis/cloud/talent/v4beta1"
+ "google.golang.org/grpc"
+ "google.golang.org/grpc/codes"
+ "google.golang.org/grpc/metadata"
+)
+
+// ApplicationCallOptions contains the retry settings for each method of ApplicationClient.
+type ApplicationCallOptions struct {
+ CreateApplication []gax.CallOption
+ GetApplication []gax.CallOption
+ UpdateApplication []gax.CallOption
+ DeleteApplication []gax.CallOption
+ ListApplications []gax.CallOption
+}
+
+func defaultApplicationClientOptions() []option.ClientOption {
+ return []option.ClientOption{
+ option.WithEndpoint("jobs.googleapis.com:443"),
+ option.WithScopes(DefaultAuthScopes()...),
+ }
+}
+
+func defaultApplicationCallOptions() *ApplicationCallOptions {
+ retry := map[[2]string][]gax.CallOption{
+ {"default", "idempotent"}: {
+ gax.WithRetry(func() gax.Retryer {
+ return gax.OnCodes([]codes.Code{
+ codes.DeadlineExceeded,
+ codes.Unavailable,
+ }, gax.Backoff{
+ Initial: 100 * time.Millisecond,
+ Max: 60000 * time.Millisecond,
+ Multiplier: 1.3,
+ })
+ }),
+ },
+ }
+ return &ApplicationCallOptions{
+ CreateApplication: retry[[2]string{"default", "non_idempotent"}],
+ GetApplication: retry[[2]string{"default", "idempotent"}],
+ UpdateApplication: retry[[2]string{"default", "non_idempotent"}],
+ DeleteApplication: retry[[2]string{"default", "idempotent"}],
+ ListApplications: retry[[2]string{"default", "idempotent"}],
+ }
+}
+
+// ApplicationClient is a client for interacting with Cloud Talent Solution API.
+//
+// Methods, except Close, may be called concurrently. However, fields must not be modified concurrently with method calls.
+type ApplicationClient struct {
+ // The connection to the service.
+ conn *grpc.ClientConn
+
+ // The gRPC API client.
+ applicationClient talentpb.ApplicationServiceClient
+
+ // The call options for this service.
+ CallOptions *ApplicationCallOptions
+
+ // The x-goog-* metadata to be sent with each request.
+ xGoogMetadata metadata.MD
+}
+
+// NewApplicationClient creates a new application service client.
+//
+// A service that handles application management, including CRUD and
+// enumeration.
+func NewApplicationClient(ctx context.Context, opts ...option.ClientOption) (*ApplicationClient, error) {
+ conn, err := transport.DialGRPC(ctx, append(defaultApplicationClientOptions(), opts...)...)
+ if err != nil {
+ return nil, err
+ }
+ c := &ApplicationClient{
+ conn: conn,
+ CallOptions: defaultApplicationCallOptions(),
+
+ applicationClient: talentpb.NewApplicationServiceClient(conn),
+ }
+ c.setGoogleClientInfo()
+ return c, nil
+}
+
+// Connection returns the client's connection to the API service.
+func (c *ApplicationClient) Connection() *grpc.ClientConn {
+ return c.conn
+}
+
+// Close closes the connection to the API service. The user should invoke this when
+// the client is no longer required.
+func (c *ApplicationClient) Close() error {
+ return c.conn.Close()
+}
+
+// setGoogleClientInfo sets the name and version of the application in
+// the `x-goog-api-client` header passed on each request. Intended for
+// use by Google-written clients.
+func (c *ApplicationClient) setGoogleClientInfo(keyval ...string) {
+ kv := append([]string{"gl-go", versionGo()}, keyval...)
+ kv = append(kv, "gapic", versionClient, "gax", gax.Version, "grpc", grpc.Version)
+ c.xGoogMetadata = metadata.Pairs("x-goog-api-client", gax.XGoogHeader(kv...))
+}
+
+// CreateApplication creates a new application entity.
+func (c *ApplicationClient) CreateApplication(ctx context.Context, req *talentpb.CreateApplicationRequest, opts ...gax.CallOption) (*talentpb.Application, error) {
+ md := metadata.Pairs("x-goog-request-params", fmt.Sprintf("%s=%v", "parent", req.GetParent()))
+ ctx = insertMetadata(ctx, c.xGoogMetadata, md)
+ opts = append(c.CallOptions.CreateApplication[0:len(c.CallOptions.CreateApplication):len(c.CallOptions.CreateApplication)], opts...)
+ var resp *talentpb.Application
+ err := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error {
+ var err error
+ resp, err = c.applicationClient.CreateApplication(ctx, req, settings.GRPC...)
+ return err
+ }, opts...)
+ if err != nil {
+ return nil, err
+ }
+ return resp, nil
+}
+
+// GetApplication retrieves specified application.
+func (c *ApplicationClient) GetApplication(ctx context.Context, req *talentpb.GetApplicationRequest, opts ...gax.CallOption) (*talentpb.Application, error) {
+ md := metadata.Pairs("x-goog-request-params", fmt.Sprintf("%s=%v", "name", req.GetName()))
+ ctx = insertMetadata(ctx, c.xGoogMetadata, md)
+ opts = append(c.CallOptions.GetApplication[0:len(c.CallOptions.GetApplication):len(c.CallOptions.GetApplication)], opts...)
+ var resp *talentpb.Application
+ err := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error {
+ var err error
+ resp, err = c.applicationClient.GetApplication(ctx, req, settings.GRPC...)
+ return err
+ }, opts...)
+ if err != nil {
+ return nil, err
+ }
+ return resp, nil
+}
+
+// UpdateApplication updates specified application.
+func (c *ApplicationClient) UpdateApplication(ctx context.Context, req *talentpb.UpdateApplicationRequest, opts ...gax.CallOption) (*talentpb.Application, error) {
+ md := metadata.Pairs("x-goog-request-params", fmt.Sprintf("%s=%v", "application.name", req.GetApplication().GetName()))
+ ctx = insertMetadata(ctx, c.xGoogMetadata, md)
+ opts = append(c.CallOptions.UpdateApplication[0:len(c.CallOptions.UpdateApplication):len(c.CallOptions.UpdateApplication)], opts...)
+ var resp *talentpb.Application
+ err := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error {
+ var err error
+ resp, err = c.applicationClient.UpdateApplication(ctx, req, settings.GRPC...)
+ return err
+ }, opts...)
+ if err != nil {
+ return nil, err
+ }
+ return resp, nil
+}
+
+// DeleteApplication deletes specified application.
+func (c *ApplicationClient) DeleteApplication(ctx context.Context, req *talentpb.DeleteApplicationRequest, opts ...gax.CallOption) error {
+ md := metadata.Pairs("x-goog-request-params", fmt.Sprintf("%s=%v", "name", req.GetName()))
+ ctx = insertMetadata(ctx, c.xGoogMetadata, md)
+ opts = append(c.CallOptions.DeleteApplication[0:len(c.CallOptions.DeleteApplication):len(c.CallOptions.DeleteApplication)], opts...)
+ err := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error {
+ var err error
+ _, err = c.applicationClient.DeleteApplication(ctx, req, settings.GRPC...)
+ return err
+ }, opts...)
+ return err
+}
+
+// ListApplications lists all applications associated with the profile.
+func (c *ApplicationClient) ListApplications(ctx context.Context, req *talentpb.ListApplicationsRequest, opts ...gax.CallOption) *ApplicationIterator {
+ md := metadata.Pairs("x-goog-request-params", fmt.Sprintf("%s=%v", "parent", req.GetParent()))
+ ctx = insertMetadata(ctx, c.xGoogMetadata, md)
+ opts = append(c.CallOptions.ListApplications[0:len(c.CallOptions.ListApplications):len(c.CallOptions.ListApplications)], opts...)
+ it := &ApplicationIterator{}
+ req = proto.Clone(req).(*talentpb.ListApplicationsRequest)
+ it.InternalFetch = func(pageSize int, pageToken string) ([]*talentpb.Application, string, error) {
+ var resp *talentpb.ListApplicationsResponse
+ req.PageToken = pageToken
+ if pageSize > math.MaxInt32 {
+ req.PageSize = math.MaxInt32
+ } else {
+ req.PageSize = int32(pageSize)
+ }
+ err := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error {
+ var err error
+ resp, err = c.applicationClient.ListApplications(ctx, req, settings.GRPC...)
+ return err
+ }, opts...)
+ if err != nil {
+ return nil, "", err
+ }
+ return resp.Applications, resp.NextPageToken, nil
+ }
+ fetch := func(pageSize int, pageToken string) (string, error) {
+ items, nextPageToken, err := it.InternalFetch(pageSize, pageToken)
+ if err != nil {
+ return "", err
+ }
+ it.items = append(it.items, items...)
+ return nextPageToken, nil
+ }
+ it.pageInfo, it.nextFunc = iterator.NewPageInfo(fetch, it.bufLen, it.takeBuf)
+ it.pageInfo.MaxSize = int(req.PageSize)
+ return it
+}
+
+// ApplicationIterator manages a stream of *talentpb.Application.
+type ApplicationIterator struct {
+ items []*talentpb.Application
+ pageInfo *iterator.PageInfo
+ nextFunc func() error
+
+ // InternalFetch is for use by the Google Cloud Libraries only.
+ // It is not part of the stable interface of this package.
+ //
+ // InternalFetch returns results from a single call to the underlying RPC.
+ // The number of results is no greater than pageSize.
+ // If there are no more results, nextPageToken is empty and err is nil.
+ InternalFetch func(pageSize int, pageToken string) (results []*talentpb.Application, nextPageToken string, err error)
+}
+
+// PageInfo supports pagination. See the google.golang.org/api/iterator package for details.
+func (it *ApplicationIterator) PageInfo() *iterator.PageInfo {
+ return it.pageInfo
+}
+
+// Next returns the next result. Its second return value is iterator.Done if there are no more
+// results. Once Next returns Done, all subsequent calls will return Done.
+func (it *ApplicationIterator) Next() (*talentpb.Application, error) {
+ var item *talentpb.Application
+ if err := it.nextFunc(); err != nil {
+ return item, err
+ }
+ item = it.items[0]
+ it.items = it.items[1:]
+ return item, nil
+}
+
+func (it *ApplicationIterator) bufLen() int {
+ return len(it.items)
+}
+
+func (it *ApplicationIterator) takeBuf() interface{} {
+ b := it.items
+ it.items = nil
+ return b
+}
diff --git a/talent/apiv4beta1/application_client_example_test.go b/talent/apiv4beta1/application_client_example_test.go
new file mode 100644
index 0000000..94d25dc
--- /dev/null
+++ b/talent/apiv4beta1/application_client_example_test.go
@@ -0,0 +1,129 @@
+// Copyright 2019 Google LLC
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// https://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+// Code generated by gapic-generator. DO NOT EDIT.
+
+package talent_test
+
+import (
+ "context"
+
+ talent "cloud.google.com/go/talent/apiv4beta1"
+ "google.golang.org/api/iterator"
+ talentpb "google.golang.org/genproto/googleapis/cloud/talent/v4beta1"
+)
+
+func ExampleNewApplicationClient() {
+ ctx := context.Background()
+ c, err := talent.NewApplicationClient(ctx)
+ if err != nil {
+ // TODO: Handle error.
+ }
+ // TODO: Use client.
+ _ = c
+}
+
+func ExampleApplicationClient_CreateApplication() {
+ ctx := context.Background()
+ c, err := talent.NewApplicationClient(ctx)
+ if err != nil {
+ // TODO: Handle error.
+ }
+
+ req := &talentpb.CreateApplicationRequest{
+ // TODO: Fill request struct fields.
+ }
+ resp, err := c.CreateApplication(ctx, req)
+ if err != nil {
+ // TODO: Handle error.
+ }
+ // TODO: Use resp.
+ _ = resp
+}
+
+func ExampleApplicationClient_GetApplication() {
+ ctx := context.Background()
+ c, err := talent.NewApplicationClient(ctx)
+ if err != nil {
+ // TODO: Handle error.
+ }
+
+ req := &talentpb.GetApplicationRequest{
+ // TODO: Fill request struct fields.
+ }
+ resp, err := c.GetApplication(ctx, req)
+ if err != nil {
+ // TODO: Handle error.
+ }
+ // TODO: Use resp.
+ _ = resp
+}
+
+func ExampleApplicationClient_UpdateApplication() {
+ ctx := context.Background()
+ c, err := talent.NewApplicationClient(ctx)
+ if err != nil {
+ // TODO: Handle error.
+ }
+
+ req := &talentpb.UpdateApplicationRequest{
+ // TODO: Fill request struct fields.
+ }
+ resp, err := c.UpdateApplication(ctx, req)
+ if err != nil {
+ // TODO: Handle error.
+ }
+ // TODO: Use resp.
+ _ = resp
+}
+
+func ExampleApplicationClient_DeleteApplication() {
+ ctx := context.Background()
+ c, err := talent.NewApplicationClient(ctx)
+ if err != nil {
+ // TODO: Handle error.
+ }
+
+ req := &talentpb.DeleteApplicationRequest{
+ // TODO: Fill request struct fields.
+ }
+ err = c.DeleteApplication(ctx, req)
+ if err != nil {
+ // TODO: Handle error.
+ }
+}
+
+func ExampleApplicationClient_ListApplications() {
+ ctx := context.Background()
+ c, err := talent.NewApplicationClient(ctx)
+ if err != nil {
+ // TODO: Handle error.
+ }
+
+ req := &talentpb.ListApplicationsRequest{
+ // TODO: Fill request struct fields.
+ }
+ it := c.ListApplications(ctx, req)
+ for {
+ resp, err := it.Next()
+ if err == iterator.Done {
+ break
+ }
+ if err != nil {
+ // TODO: Handle error.
+ }
+ // TODO: Use resp.
+ _ = resp
+ }
+}
diff --git a/talent/apiv4beta1/company_client.go b/talent/apiv4beta1/company_client.go
index f35b11e..8e8bb31 100644
--- a/talent/apiv4beta1/company_client.go
+++ b/talent/apiv4beta1/company_client.go
@@ -18,6 +18,7 @@
import (
"context"
+ "fmt"
"math"
"time"
@@ -129,7 +130,8 @@
// CreateCompany creates a new company entity.
func (c *CompanyClient) CreateCompany(ctx context.Context, req *talentpb.CreateCompanyRequest, opts ...gax.CallOption) (*talentpb.Company, error) {
- ctx = insertMetadata(ctx, c.xGoogMetadata)
+ md := metadata.Pairs("x-goog-request-params", fmt.Sprintf("%s=%v", "parent", req.GetParent()))
+ ctx = insertMetadata(ctx, c.xGoogMetadata, md)
opts = append(c.CallOptions.CreateCompany[0:len(c.CallOptions.CreateCompany):len(c.CallOptions.CreateCompany)], opts...)
var resp *talentpb.Company
err := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error {
@@ -145,7 +147,8 @@
// GetCompany retrieves specified company.
func (c *CompanyClient) GetCompany(ctx context.Context, req *talentpb.GetCompanyRequest, opts ...gax.CallOption) (*talentpb.Company, error) {
- ctx = insertMetadata(ctx, c.xGoogMetadata)
+ md := metadata.Pairs("x-goog-request-params", fmt.Sprintf("%s=%v", "name", req.GetName()))
+ ctx = insertMetadata(ctx, c.xGoogMetadata, md)
opts = append(c.CallOptions.GetCompany[0:len(c.CallOptions.GetCompany):len(c.CallOptions.GetCompany)], opts...)
var resp *talentpb.Company
err := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error {
@@ -161,7 +164,8 @@
// UpdateCompany updates specified company.
func (c *CompanyClient) UpdateCompany(ctx context.Context, req *talentpb.UpdateCompanyRequest, opts ...gax.CallOption) (*talentpb.Company, error) {
- ctx = insertMetadata(ctx, c.xGoogMetadata)
+ md := metadata.Pairs("x-goog-request-params", fmt.Sprintf("%s=%v", "company.name", req.GetCompany().GetName()))
+ ctx = insertMetadata(ctx, c.xGoogMetadata, md)
opts = append(c.CallOptions.UpdateCompany[0:len(c.CallOptions.UpdateCompany):len(c.CallOptions.UpdateCompany)], opts...)
var resp *talentpb.Company
err := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error {
@@ -178,7 +182,8 @@
// DeleteCompany deletes specified company.
// Prerequisite: The company has no jobs associated with it.
func (c *CompanyClient) DeleteCompany(ctx context.Context, req *talentpb.DeleteCompanyRequest, opts ...gax.CallOption) error {
- ctx = insertMetadata(ctx, c.xGoogMetadata)
+ md := metadata.Pairs("x-goog-request-params", fmt.Sprintf("%s=%v", "name", req.GetName()))
+ ctx = insertMetadata(ctx, c.xGoogMetadata, md)
opts = append(c.CallOptions.DeleteCompany[0:len(c.CallOptions.DeleteCompany):len(c.CallOptions.DeleteCompany)], opts...)
err := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error {
var err error
@@ -190,7 +195,8 @@
// ListCompanies lists all companies associated with the project.
func (c *CompanyClient) ListCompanies(ctx context.Context, req *talentpb.ListCompaniesRequest, opts ...gax.CallOption) *CompanyIterator {
- ctx = insertMetadata(ctx, c.xGoogMetadata)
+ md := metadata.Pairs("x-goog-request-params", fmt.Sprintf("%s=%v", "parent", req.GetParent()))
+ ctx = insertMetadata(ctx, c.xGoogMetadata, md)
opts = append(c.CallOptions.ListCompanies[0:len(c.CallOptions.ListCompanies):len(c.CallOptions.ListCompanies)], opts...)
it := &CompanyIterator{}
req = proto.Clone(req).(*talentpb.ListCompaniesRequest)
diff --git a/talent/apiv4beta1/completion_client.go b/talent/apiv4beta1/completion_client.go
index c46bc4a..274498a 100644
--- a/talent/apiv4beta1/completion_client.go
+++ b/talent/apiv4beta1/completion_client.go
@@ -18,6 +18,7 @@
import (
"context"
+ "fmt"
"time"
gax "github.com/googleapis/gax-go/v2"
@@ -119,7 +120,8 @@
// CompleteQuery completes the specified prefix with keyword suggestions.
// Intended for use by a job search auto-complete search box.
func (c *CompletionClient) CompleteQuery(ctx context.Context, req *talentpb.CompleteQueryRequest, opts ...gax.CallOption) (*talentpb.CompleteQueryResponse, error) {
- ctx = insertMetadata(ctx, c.xGoogMetadata)
+ md := metadata.Pairs("x-goog-request-params", fmt.Sprintf("%s=%v", "parent", req.GetParent()))
+ ctx = insertMetadata(ctx, c.xGoogMetadata, md)
opts = append(c.CallOptions.CompleteQuery[0:len(c.CallOptions.CompleteQuery):len(c.CallOptions.CompleteQuery)], opts...)
var resp *talentpb.CompleteQueryResponse
err := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error {
diff --git a/talent/apiv4beta1/doc.go b/talent/apiv4beta1/doc.go
index 6a111ca..c89642c 100644
--- a/talent/apiv4beta1/doc.go
+++ b/talent/apiv4beta1/doc.go
@@ -99,4 +99,4 @@
return "UNKNOWN"
}
-const versionClient = "20190322"
+const versionClient = "20190401"
diff --git a/talent/apiv4beta1/event_client.go b/talent/apiv4beta1/event_client.go
index 62a2ca6..75e74d9 100644
--- a/talent/apiv4beta1/event_client.go
+++ b/talent/apiv4beta1/event_client.go
@@ -18,6 +18,7 @@
import (
"context"
+ "fmt"
gax "github.com/googleapis/gax-go/v2"
"google.golang.org/api/option"
@@ -109,7 +110,8 @@
// more (at https://cloud.google.com/talent-solution/docs/management-tools)
// about self service tools.
func (c *EventClient) CreateClientEvent(ctx context.Context, req *talentpb.CreateClientEventRequest, opts ...gax.CallOption) (*talentpb.ClientEvent, error) {
- ctx = insertMetadata(ctx, c.xGoogMetadata)
+ md := metadata.Pairs("x-goog-request-params", fmt.Sprintf("%s=%v", "parent", req.GetParent()))
+ ctx = insertMetadata(ctx, c.xGoogMetadata, md)
opts = append(c.CallOptions.CreateClientEvent[0:len(c.CallOptions.CreateClientEvent):len(c.CallOptions.CreateClientEvent)], opts...)
var resp *talentpb.ClientEvent
err := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error {
diff --git a/talent/apiv4beta1/job_client.go b/talent/apiv4beta1/job_client.go
index 453aa7f..c8b1dc9 100644
--- a/talent/apiv4beta1/job_client.go
+++ b/talent/apiv4beta1/job_client.go
@@ -18,6 +18,7 @@
import (
"context"
+ "fmt"
"math"
"time"
@@ -138,7 +139,8 @@
// Typically, the job becomes searchable within 10 seconds, but it may take
// up to 5 minutes.
func (c *JobClient) CreateJob(ctx context.Context, req *talentpb.CreateJobRequest, opts ...gax.CallOption) (*talentpb.Job, error) {
- ctx = insertMetadata(ctx, c.xGoogMetadata)
+ md := metadata.Pairs("x-goog-request-params", fmt.Sprintf("%s=%v", "parent", req.GetParent()))
+ ctx = insertMetadata(ctx, c.xGoogMetadata, md)
opts = append(c.CallOptions.CreateJob[0:len(c.CallOptions.CreateJob):len(c.CallOptions.CreateJob)], opts...)
var resp *talentpb.Job
err := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error {
@@ -155,7 +157,8 @@
// GetJob retrieves the specified job, whose status is OPEN or recently EXPIRED
// within the last 90 days.
func (c *JobClient) GetJob(ctx context.Context, req *talentpb.GetJobRequest, opts ...gax.CallOption) (*talentpb.Job, error) {
- ctx = insertMetadata(ctx, c.xGoogMetadata)
+ md := metadata.Pairs("x-goog-request-params", fmt.Sprintf("%s=%v", "name", req.GetName()))
+ ctx = insertMetadata(ctx, c.xGoogMetadata, md)
opts = append(c.CallOptions.GetJob[0:len(c.CallOptions.GetJob):len(c.CallOptions.GetJob)], opts...)
var resp *talentpb.Job
err := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error {
@@ -174,7 +177,8 @@
// Typically, updated contents become visible in search results within 10
// seconds, but it may take up to 5 minutes.
func (c *JobClient) UpdateJob(ctx context.Context, req *talentpb.UpdateJobRequest, opts ...gax.CallOption) (*talentpb.Job, error) {
- ctx = insertMetadata(ctx, c.xGoogMetadata)
+ md := metadata.Pairs("x-goog-request-params", fmt.Sprintf("%s=%v", "job.name", req.GetJob().GetName()))
+ ctx = insertMetadata(ctx, c.xGoogMetadata, md)
opts = append(c.CallOptions.UpdateJob[0:len(c.CallOptions.UpdateJob):len(c.CallOptions.UpdateJob)], opts...)
var resp *talentpb.Job
err := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error {
@@ -193,7 +197,8 @@
// Typically, the job becomes unsearchable within 10 seconds, but it may take
// up to 5 minutes.
func (c *JobClient) DeleteJob(ctx context.Context, req *talentpb.DeleteJobRequest, opts ...gax.CallOption) error {
- ctx = insertMetadata(ctx, c.xGoogMetadata)
+ md := metadata.Pairs("x-goog-request-params", fmt.Sprintf("%s=%v", "name", req.GetName()))
+ ctx = insertMetadata(ctx, c.xGoogMetadata, md)
opts = append(c.CallOptions.DeleteJob[0:len(c.CallOptions.DeleteJob):len(c.CallOptions.DeleteJob)], opts...)
err := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error {
var err error
@@ -205,7 +210,8 @@
// ListJobs lists jobs by filter.
func (c *JobClient) ListJobs(ctx context.Context, req *talentpb.ListJobsRequest, opts ...gax.CallOption) *JobIterator {
- ctx = insertMetadata(ctx, c.xGoogMetadata)
+ md := metadata.Pairs("x-goog-request-params", fmt.Sprintf("%s=%v", "parent", req.GetParent()))
+ ctx = insertMetadata(ctx, c.xGoogMetadata, md)
opts = append(c.CallOptions.ListJobs[0:len(c.CallOptions.ListJobs):len(c.CallOptions.ListJobs)], opts...)
it := &JobIterator{}
req = proto.Clone(req).(*talentpb.ListJobsRequest)
@@ -242,7 +248,8 @@
// BatchDeleteJobs deletes a list of [Job][google.cloud.talent.v4beta1.Job]s by filter.
func (c *JobClient) BatchDeleteJobs(ctx context.Context, req *talentpb.BatchDeleteJobsRequest, opts ...gax.CallOption) error {
- ctx = insertMetadata(ctx, c.xGoogMetadata)
+ md := metadata.Pairs("x-goog-request-params", fmt.Sprintf("%s=%v", "parent", req.GetParent()))
+ ctx = insertMetadata(ctx, c.xGoogMetadata, md)
opts = append(c.CallOptions.BatchDeleteJobs[0:len(c.CallOptions.BatchDeleteJobs):len(c.CallOptions.BatchDeleteJobs)], opts...)
err := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error {
var err error
@@ -260,7 +267,8 @@
// the database, and only returns jobs that the caller has permission to
// search against.
func (c *JobClient) SearchJobs(ctx context.Context, req *talentpb.SearchJobsRequest, opts ...gax.CallOption) *SearchJobsResponse_MatchingJobIterator {
- ctx = insertMetadata(ctx, c.xGoogMetadata)
+ md := metadata.Pairs("x-goog-request-params", fmt.Sprintf("%s=%v", "parent", req.GetParent()))
+ ctx = insertMetadata(ctx, c.xGoogMetadata, md)
opts = append(c.CallOptions.SearchJobs[0:len(c.CallOptions.SearchJobs):len(c.CallOptions.SearchJobs)], opts...)
it := &SearchJobsResponse_MatchingJobIterator{}
req = proto.Clone(req).(*talentpb.SearchJobsRequest)
@@ -308,7 +316,8 @@
// the database, and only returns jobs the caller has permission to search
// against.
func (c *JobClient) SearchJobsForAlert(ctx context.Context, req *talentpb.SearchJobsRequest, opts ...gax.CallOption) *SearchJobsResponse_MatchingJobIterator {
- ctx = insertMetadata(ctx, c.xGoogMetadata)
+ md := metadata.Pairs("x-goog-request-params", fmt.Sprintf("%s=%v", "parent", req.GetParent()))
+ ctx = insertMetadata(ctx, c.xGoogMetadata, md)
opts = append(c.CallOptions.SearchJobsForAlert[0:len(c.CallOptions.SearchJobsForAlert):len(c.CallOptions.SearchJobsForAlert)], opts...)
it := &SearchJobsResponse_MatchingJobIterator{}
req = proto.Clone(req).(*talentpb.SearchJobsRequest)
diff --git a/talent/apiv4beta1/mock_test.go b/talent/apiv4beta1/mock_test.go
index 655e4c0..c307477 100644
--- a/talent/apiv4beta1/mock_test.go
+++ b/talent/apiv4beta1/mock_test.go
@@ -46,6 +46,81 @@
var _ = ptypes.MarshalAny
var _ status.Status
+type mockApplicationServer struct {
+ // Embed for forward compatibility.
+ // Tests will keep working if more methods are added
+ // in the future.
+ talentpb.ApplicationServiceServer
+
+ reqs []proto.Message
+
+ // If set, all calls return this error.
+ err error
+
+ // responses to return if err == nil
+ resps []proto.Message
+}
+
+func (s *mockApplicationServer) CreateApplication(ctx context.Context, req *talentpb.CreateApplicationRequest) (*talentpb.Application, error) {
+ md, _ := metadata.FromIncomingContext(ctx)
+ if xg := md["x-goog-api-client"]; len(xg) == 0 || !strings.Contains(xg[0], "gl-go/") {
+ return nil, fmt.Errorf("x-goog-api-client = %v, expected gl-go key", xg)
+ }
+ s.reqs = append(s.reqs, req)
+ if s.err != nil {
+ return nil, s.err
+ }
+ return s.resps[0].(*talentpb.Application), nil
+}
+
+func (s *mockApplicationServer) GetApplication(ctx context.Context, req *talentpb.GetApplicationRequest) (*talentpb.Application, error) {
+ md, _ := metadata.FromIncomingContext(ctx)
+ if xg := md["x-goog-api-client"]; len(xg) == 0 || !strings.Contains(xg[0], "gl-go/") {
+ return nil, fmt.Errorf("x-goog-api-client = %v, expected gl-go key", xg)
+ }
+ s.reqs = append(s.reqs, req)
+ if s.err != nil {
+ return nil, s.err
+ }
+ return s.resps[0].(*talentpb.Application), nil
+}
+
+func (s *mockApplicationServer) UpdateApplication(ctx context.Context, req *talentpb.UpdateApplicationRequest) (*talentpb.Application, error) {
+ md, _ := metadata.FromIncomingContext(ctx)
+ if xg := md["x-goog-api-client"]; len(xg) == 0 || !strings.Contains(xg[0], "gl-go/") {
+ return nil, fmt.Errorf("x-goog-api-client = %v, expected gl-go key", xg)
+ }
+ s.reqs = append(s.reqs, req)
+ if s.err != nil {
+ return nil, s.err
+ }
+ return s.resps[0].(*talentpb.Application), nil
+}
+
+func (s *mockApplicationServer) DeleteApplication(ctx context.Context, req *talentpb.DeleteApplicationRequest) (*emptypb.Empty, error) {
+ md, _ := metadata.FromIncomingContext(ctx)
+ if xg := md["x-goog-api-client"]; len(xg) == 0 || !strings.Contains(xg[0], "gl-go/") {
+ return nil, fmt.Errorf("x-goog-api-client = %v, expected gl-go key", xg)
+ }
+ s.reqs = append(s.reqs, req)
+ if s.err != nil {
+ return nil, s.err
+ }
+ return s.resps[0].(*emptypb.Empty), nil
+}
+
+func (s *mockApplicationServer) ListApplications(ctx context.Context, req *talentpb.ListApplicationsRequest) (*talentpb.ListApplicationsResponse, error) {
+ md, _ := metadata.FromIncomingContext(ctx)
+ if xg := md["x-goog-api-client"]; len(xg) == 0 || !strings.Contains(xg[0], "gl-go/") {
+ return nil, fmt.Errorf("x-goog-api-client = %v, expected gl-go key", xg)
+ }
+ s.reqs = append(s.reqs, req)
+ if s.err != nil {
+ return nil, s.err
+ }
+ return s.resps[0].(*talentpb.ListApplicationsResponse), nil
+}
+
type mockCompanyServer struct {
// Embed for forward compatibility.
// Tests will keep working if more methods are added
@@ -373,33 +448,6 @@
return s.resps[0].(*talentpb.SearchProfilesResponse), nil
}
-type mockResumeServer struct {
- // Embed for forward compatibility.
- // Tests will keep working if more methods are added
- // in the future.
- talentpb.ResumeServiceServer
-
- reqs []proto.Message
-
- // If set, all calls return this error.
- err error
-
- // responses to return if err == nil
- resps []proto.Message
-}
-
-func (s *mockResumeServer) ParseResume(ctx context.Context, req *talentpb.ParseResumeRequest) (*talentpb.ParseResumeResponse, error) {
- md, _ := metadata.FromIncomingContext(ctx)
- if xg := md["x-goog-api-client"]; len(xg) == 0 || !strings.Contains(xg[0], "gl-go/") {
- return nil, fmt.Errorf("x-goog-api-client = %v, expected gl-go key", xg)
- }
- s.reqs = append(s.reqs, req)
- if s.err != nil {
- return nil, s.err
- }
- return s.resps[0].(*talentpb.ParseResumeResponse), nil
-}
-
type mockTenantServer struct {
// Embed for forward compatibility.
// Tests will keep working if more methods are added
@@ -480,25 +528,25 @@
var clientOpt option.ClientOption
var (
- mockCompany mockCompanyServer
- mockCompletion mockCompletionServer
- mockEvent mockEventServer
- mockJob mockJobServer
- mockProfile mockProfileServer
- mockResume mockResumeServer
- mockTenant mockTenantServer
+ mockApplication mockApplicationServer
+ mockCompany mockCompanyServer
+ mockCompletion mockCompletionServer
+ mockEvent mockEventServer
+ mockJob mockJobServer
+ mockProfile mockProfileServer
+ mockTenant mockTenantServer
)
func TestMain(m *testing.M) {
flag.Parse()
serv := grpc.NewServer()
+ talentpb.RegisterApplicationServiceServer(serv, &mockApplication)
talentpb.RegisterCompanyServiceServer(serv, &mockCompany)
talentpb.RegisterCompletionServer(serv, &mockCompletion)
talentpb.RegisterEventServiceServer(serv, &mockEvent)
talentpb.RegisterJobServiceServer(serv, &mockJob)
talentpb.RegisterProfileServiceServer(serv, &mockProfile)
- talentpb.RegisterResumeServiceServer(serv, &mockResume)
talentpb.RegisterTenantServiceServer(serv, &mockTenant)
lis, err := net.Listen("tcp", "localhost:0")
@@ -516,6 +564,347 @@
os.Exit(m.Run())
}
+func TestApplicationServiceCreateApplication(t *testing.T) {
+ var name string = "name3373707"
+ var externalId string = "externalId-1153075697"
+ var profile string = "profile-309425751"
+ var job string = "job105405"
+ var company string = "company950484093"
+ var outcomeNotes string = "outcomeNotes-355961964"
+ var jobTitleSnippet string = "jobTitleSnippet-1100512972"
+ var expectedResponse = &talentpb.Application{
+ Name: name,
+ ExternalId: externalId,
+ Profile: profile,
+ Job: job,
+ Company: company,
+ OutcomeNotes: outcomeNotes,
+ JobTitleSnippet: jobTitleSnippet,
+ }
+
+ mockApplication.err = nil
+ mockApplication.reqs = nil
+
+ mockApplication.resps = append(mockApplication.resps[:0], expectedResponse)
+
+ var formattedParent string = fmt.Sprintf("projects/%s/tenants/%s/profiles/%s", "[PROJECT]", "[TENANT]", "[PROFILE]")
+ var application *talentpb.Application = &talentpb.Application{}
+ var request = &talentpb.CreateApplicationRequest{
+ Parent: formattedParent,
+ Application: application,
+ }
+
+ c, err := NewApplicationClient(context.Background(), clientOpt)
+ if err != nil {
+ t.Fatal(err)
+ }
+
+ resp, err := c.CreateApplication(context.Background(), request)
+
+ if err != nil {
+ t.Fatal(err)
+ }
+
+ if want, got := request, mockApplication.reqs[0]; !proto.Equal(want, got) {
+ t.Errorf("wrong request %q, want %q", got, want)
+ }
+
+ if want, got := expectedResponse, resp; !proto.Equal(want, got) {
+ t.Errorf("wrong response %q, want %q)", got, want)
+ }
+}
+
+func TestApplicationServiceCreateApplicationError(t *testing.T) {
+ errCode := codes.PermissionDenied
+ mockApplication.err = gstatus.Error(errCode, "test error")
+
+ var formattedParent string = fmt.Sprintf("projects/%s/tenants/%s/profiles/%s", "[PROJECT]", "[TENANT]", "[PROFILE]")
+ var application *talentpb.Application = &talentpb.Application{}
+ var request = &talentpb.CreateApplicationRequest{
+ Parent: formattedParent,
+ Application: application,
+ }
+
+ c, err := NewApplicationClient(context.Background(), clientOpt)
+ if err != nil {
+ t.Fatal(err)
+ }
+
+ resp, err := c.CreateApplication(context.Background(), request)
+
+ if st, ok := gstatus.FromError(err); !ok {
+ t.Errorf("got error %v, expected grpc error", err)
+ } else if c := st.Code(); c != errCode {
+ t.Errorf("got error code %q, want %q", c, errCode)
+ }
+ _ = resp
+}
+func TestApplicationServiceGetApplication(t *testing.T) {
+ var name2 string = "name2-1052831874"
+ var externalId string = "externalId-1153075697"
+ var profile string = "profile-309425751"
+ var job string = "job105405"
+ var company string = "company950484093"
+ var outcomeNotes string = "outcomeNotes-355961964"
+ var jobTitleSnippet string = "jobTitleSnippet-1100512972"
+ var expectedResponse = &talentpb.Application{
+ Name: name2,
+ ExternalId: externalId,
+ Profile: profile,
+ Job: job,
+ Company: company,
+ OutcomeNotes: outcomeNotes,
+ JobTitleSnippet: jobTitleSnippet,
+ }
+
+ mockApplication.err = nil
+ mockApplication.reqs = nil
+
+ mockApplication.resps = append(mockApplication.resps[:0], expectedResponse)
+
+ var formattedName string = fmt.Sprintf("projects/%s/tenants/%s/profiles/%s/applications/%s", "[PROJECT]", "[TENANT]", "[PROFILE]", "[APPLICATION]")
+ var request = &talentpb.GetApplicationRequest{
+ Name: formattedName,
+ }
+
+ c, err := NewApplicationClient(context.Background(), clientOpt)
+ if err != nil {
+ t.Fatal(err)
+ }
+
+ resp, err := c.GetApplication(context.Background(), request)
+
+ if err != nil {
+ t.Fatal(err)
+ }
+
+ if want, got := request, mockApplication.reqs[0]; !proto.Equal(want, got) {
+ t.Errorf("wrong request %q, want %q", got, want)
+ }
+
+ if want, got := expectedResponse, resp; !proto.Equal(want, got) {
+ t.Errorf("wrong response %q, want %q)", got, want)
+ }
+}
+
+func TestApplicationServiceGetApplicationError(t *testing.T) {
+ errCode := codes.PermissionDenied
+ mockApplication.err = gstatus.Error(errCode, "test error")
+
+ var formattedName string = fmt.Sprintf("projects/%s/tenants/%s/profiles/%s/applications/%s", "[PROJECT]", "[TENANT]", "[PROFILE]", "[APPLICATION]")
+ var request = &talentpb.GetApplicationRequest{
+ Name: formattedName,
+ }
+
+ c, err := NewApplicationClient(context.Background(), clientOpt)
+ if err != nil {
+ t.Fatal(err)
+ }
+
+ resp, err := c.GetApplication(context.Background(), request)
+
+ if st, ok := gstatus.FromError(err); !ok {
+ t.Errorf("got error %v, expected grpc error", err)
+ } else if c := st.Code(); c != errCode {
+ t.Errorf("got error code %q, want %q", c, errCode)
+ }
+ _ = resp
+}
+func TestApplicationServiceUpdateApplication(t *testing.T) {
+ var name string = "name3373707"
+ var externalId string = "externalId-1153075697"
+ var profile string = "profile-309425751"
+ var job string = "job105405"
+ var company string = "company950484093"
+ var outcomeNotes string = "outcomeNotes-355961964"
+ var jobTitleSnippet string = "jobTitleSnippet-1100512972"
+ var expectedResponse = &talentpb.Application{
+ Name: name,
+ ExternalId: externalId,
+ Profile: profile,
+ Job: job,
+ Company: company,
+ OutcomeNotes: outcomeNotes,
+ JobTitleSnippet: jobTitleSnippet,
+ }
+
+ mockApplication.err = nil
+ mockApplication.reqs = nil
+
+ mockApplication.resps = append(mockApplication.resps[:0], expectedResponse)
+
+ var application *talentpb.Application = &talentpb.Application{}
+ var request = &talentpb.UpdateApplicationRequest{
+ Application: application,
+ }
+
+ c, err := NewApplicationClient(context.Background(), clientOpt)
+ if err != nil {
+ t.Fatal(err)
+ }
+
+ resp, err := c.UpdateApplication(context.Background(), request)
+
+ if err != nil {
+ t.Fatal(err)
+ }
+
+ if want, got := request, mockApplication.reqs[0]; !proto.Equal(want, got) {
+ t.Errorf("wrong request %q, want %q", got, want)
+ }
+
+ if want, got := expectedResponse, resp; !proto.Equal(want, got) {
+ t.Errorf("wrong response %q, want %q)", got, want)
+ }
+}
+
+func TestApplicationServiceUpdateApplicationError(t *testing.T) {
+ errCode := codes.PermissionDenied
+ mockApplication.err = gstatus.Error(errCode, "test error")
+
+ var application *talentpb.Application = &talentpb.Application{}
+ var request = &talentpb.UpdateApplicationRequest{
+ Application: application,
+ }
+
+ c, err := NewApplicationClient(context.Background(), clientOpt)
+ if err != nil {
+ t.Fatal(err)
+ }
+
+ resp, err := c.UpdateApplication(context.Background(), request)
+
+ if st, ok := gstatus.FromError(err); !ok {
+ t.Errorf("got error %v, expected grpc error", err)
+ } else if c := st.Code(); c != errCode {
+ t.Errorf("got error code %q, want %q", c, errCode)
+ }
+ _ = resp
+}
+func TestApplicationServiceDeleteApplication(t *testing.T) {
+ var expectedResponse *emptypb.Empty = &emptypb.Empty{}
+
+ mockApplication.err = nil
+ mockApplication.reqs = nil
+
+ mockApplication.resps = append(mockApplication.resps[:0], expectedResponse)
+
+ var formattedName string = fmt.Sprintf("projects/%s/tenants/%s/profiles/%s/applications/%s", "[PROJECT]", "[TENANT]", "[PROFILE]", "[APPLICATION]")
+ var request = &talentpb.DeleteApplicationRequest{
+ Name: formattedName,
+ }
+
+ c, err := NewApplicationClient(context.Background(), clientOpt)
+ if err != nil {
+ t.Fatal(err)
+ }
+
+ err = c.DeleteApplication(context.Background(), request)
+
+ if err != nil {
+ t.Fatal(err)
+ }
+
+ if want, got := request, mockApplication.reqs[0]; !proto.Equal(want, got) {
+ t.Errorf("wrong request %q, want %q", got, want)
+ }
+
+}
+
+func TestApplicationServiceDeleteApplicationError(t *testing.T) {
+ errCode := codes.PermissionDenied
+ mockApplication.err = gstatus.Error(errCode, "test error")
+
+ var formattedName string = fmt.Sprintf("projects/%s/tenants/%s/profiles/%s/applications/%s", "[PROJECT]", "[TENANT]", "[PROFILE]", "[APPLICATION]")
+ var request = &talentpb.DeleteApplicationRequest{
+ Name: formattedName,
+ }
+
+ c, err := NewApplicationClient(context.Background(), clientOpt)
+ if err != nil {
+ t.Fatal(err)
+ }
+
+ err = c.DeleteApplication(context.Background(), request)
+
+ if st, ok := gstatus.FromError(err); !ok {
+ t.Errorf("got error %v, expected grpc error", err)
+ } else if c := st.Code(); c != errCode {
+ t.Errorf("got error code %q, want %q", c, errCode)
+ }
+}
+func TestApplicationServiceListApplications(t *testing.T) {
+ var nextPageToken string = ""
+ var applicationsElement *talentpb.Application = &talentpb.Application{}
+ var applications = []*talentpb.Application{applicationsElement}
+ var expectedResponse = &talentpb.ListApplicationsResponse{
+ NextPageToken: nextPageToken,
+ Applications: applications,
+ }
+
+ mockApplication.err = nil
+ mockApplication.reqs = nil
+
+ mockApplication.resps = append(mockApplication.resps[:0], expectedResponse)
+
+ var formattedParent string = fmt.Sprintf("projects/%s/tenants/%s/profiles/%s", "[PROJECT]", "[TENANT]", "[PROFILE]")
+ var request = &talentpb.ListApplicationsRequest{
+ Parent: formattedParent,
+ }
+
+ c, err := NewApplicationClient(context.Background(), clientOpt)
+ if err != nil {
+ t.Fatal(err)
+ }
+
+ resp, err := c.ListApplications(context.Background(), request).Next()
+
+ if err != nil {
+ t.Fatal(err)
+ }
+
+ if want, got := request, mockApplication.reqs[0]; !proto.Equal(want, got) {
+ t.Errorf("wrong request %q, want %q", got, want)
+ }
+
+ want := (interface{})(expectedResponse.Applications[0])
+ got := (interface{})(resp)
+ var ok bool
+
+ switch want := (want).(type) {
+ case proto.Message:
+ ok = proto.Equal(want, got.(proto.Message))
+ default:
+ ok = want == got
+ }
+ if !ok {
+ t.Errorf("wrong response %q, want %q)", got, want)
+ }
+}
+
+func TestApplicationServiceListApplicationsError(t *testing.T) {
+ errCode := codes.PermissionDenied
+ mockApplication.err = gstatus.Error(errCode, "test error")
+
+ var formattedParent string = fmt.Sprintf("projects/%s/tenants/%s/profiles/%s", "[PROJECT]", "[TENANT]", "[PROFILE]")
+ var request = &talentpb.ListApplicationsRequest{
+ Parent: formattedParent,
+ }
+
+ c, err := NewApplicationClient(context.Background(), clientOpt)
+ if err != nil {
+ t.Fatal(err)
+ }
+
+ resp, err := c.ListApplications(context.Background(), request).Next()
+
+ if st, ok := gstatus.FromError(err); !ok {
+ t.Errorf("got error %v, expected grpc error", err)
+ } else if c := st.Code(); c != errCode {
+ t.Errorf("got error code %q, want %q", c, errCode)
+ }
+ _ = resp
+}
func TestCompanyServiceCreateCompany(t *testing.T) {
var name string = "name3373707"
var displayName string = "displayName1615086568"
@@ -545,7 +934,7 @@
mockCompany.resps = append(mockCompany.resps[:0], expectedResponse)
- var formattedParent string = fmt.Sprintf("projects/%s", "[PROJECT]")
+ var formattedParent string = fmt.Sprintf("projects/%s/tenants/%s", "[PROJECT]", "[TENANT]")
var company *talentpb.Company = &talentpb.Company{}
var request = &talentpb.CreateCompanyRequest{
Parent: formattedParent,
@@ -576,7 +965,7 @@
errCode := codes.PermissionDenied
mockCompany.err = gstatus.Error(errCode, "test error")
- var formattedParent string = fmt.Sprintf("projects/%s", "[PROJECT]")
+ var formattedParent string = fmt.Sprintf("projects/%s/tenants/%s", "[PROJECT]", "[TENANT]")
var company *talentpb.Company = &talentpb.Company{}
var request = &talentpb.CreateCompanyRequest{
Parent: formattedParent,
@@ -817,7 +1206,7 @@
mockCompany.resps = append(mockCompany.resps[:0], expectedResponse)
- var formattedParent string = fmt.Sprintf("projects/%s", "[PROJECT]")
+ var formattedParent string = fmt.Sprintf("projects/%s/tenants/%s", "[PROJECT]", "[TENANT]")
var request = &talentpb.ListCompaniesRequest{
Parent: formattedParent,
}
@@ -856,7 +1245,7 @@
errCode := codes.PermissionDenied
mockCompany.err = gstatus.Error(errCode, "test error")
- var formattedParent string = fmt.Sprintf("projects/%s", "[PROJECT]")
+ var formattedParent string = fmt.Sprintf("projects/%s/tenants/%s", "[PROJECT]", "[TENANT]")
var request = &talentpb.ListCompaniesRequest{
Parent: formattedParent,
}
@@ -883,11 +1272,11 @@
mockCompletion.resps = append(mockCompletion.resps[:0], expectedResponse)
- var formattedName string = fmt.Sprintf("projects/%s", "[PROJECT]")
+ var formattedParent string = fmt.Sprintf("projects/%s/tenants/%s", "[PROJECT]", "[TENANT]")
var query string = "query107944136"
var pageSize int32 = 883849137
var request = &talentpb.CompleteQueryRequest{
- Name: formattedName,
+ Parent: formattedParent,
Query: query,
PageSize: pageSize,
}
@@ -916,11 +1305,11 @@
errCode := codes.PermissionDenied
mockCompletion.err = gstatus.Error(errCode, "test error")
- var formattedName string = fmt.Sprintf("projects/%s", "[PROJECT]")
+ var formattedParent string = fmt.Sprintf("projects/%s/tenants/%s", "[PROJECT]", "[TENANT]")
var query string = "query107944136"
var pageSize int32 = 883849137
var request = &talentpb.CompleteQueryRequest{
- Name: formattedName,
+ Parent: formattedParent,
Query: query,
PageSize: pageSize,
}
@@ -942,9 +1331,11 @@
func TestEventServiceCreateClientEvent(t *testing.T) {
var requestId string = "requestId37109963"
var eventId string = "eventId278118624"
+ var eventNotes string = "eventNotes445073628"
var expectedResponse = &talentpb.ClientEvent{
- RequestId: requestId,
- EventId: eventId,
+ RequestId: requestId,
+ EventId: eventId,
+ EventNotes: eventNotes,
}
mockEvent.err = nil
@@ -952,7 +1343,7 @@
mockEvent.resps = append(mockEvent.resps[:0], expectedResponse)
- var formattedParent string = fmt.Sprintf("projects/%s", "[PROJECT]")
+ var formattedParent string = fmt.Sprintf("projects/%s/tenants/%s", "[PROJECT]", "[TENANT]")
var clientEvent *talentpb.ClientEvent = &talentpb.ClientEvent{}
var request = &talentpb.CreateClientEventRequest{
Parent: formattedParent,
@@ -983,7 +1374,7 @@
errCode := codes.PermissionDenied
mockEvent.err = gstatus.Error(errCode, "test error")
- var formattedParent string = fmt.Sprintf("projects/%s", "[PROJECT]")
+ var formattedParent string = fmt.Sprintf("projects/%s/tenants/%s", "[PROJECT]", "[TENANT]")
var clientEvent *talentpb.ClientEvent = &talentpb.ClientEvent{}
var request = &talentpb.CreateClientEventRequest{
Parent: formattedParent,
@@ -1006,7 +1397,7 @@
}
func TestJobServiceCreateJob(t *testing.T) {
var name string = "name3373707"
- var companyName string = "companyName1429880077"
+ var company string = "company950484093"
var requisitionId string = "requisitionId980224926"
var title string = "title110371416"
var description string = "description-1724546052"
@@ -1019,7 +1410,7 @@
var companyDisplayName string = "companyDisplayName1982424170"
var expectedResponse = &talentpb.Job{
Name: name,
- CompanyName: companyName,
+ Company: company,
RequisitionId: requisitionId,
Title: title,
Description: description,
@@ -1037,7 +1428,7 @@
mockJob.resps = append(mockJob.resps[:0], expectedResponse)
- var formattedParent string = fmt.Sprintf("projects/%s", "[PROJECT]")
+ var formattedParent string = fmt.Sprintf("projects/%s/tenants/%s", "[PROJECT]", "[TENANT]")
var job *talentpb.Job = &talentpb.Job{}
var request = &talentpb.CreateJobRequest{
Parent: formattedParent,
@@ -1068,7 +1459,7 @@
errCode := codes.PermissionDenied
mockJob.err = gstatus.Error(errCode, "test error")
- var formattedParent string = fmt.Sprintf("projects/%s", "[PROJECT]")
+ var formattedParent string = fmt.Sprintf("projects/%s/tenants/%s", "[PROJECT]", "[TENANT]")
var job *talentpb.Job = &talentpb.Job{}
var request = &talentpb.CreateJobRequest{
Parent: formattedParent,
@@ -1091,7 +1482,7 @@
}
func TestJobServiceGetJob(t *testing.T) {
var name2 string = "name2-1052831874"
- var companyName string = "companyName1429880077"
+ var company string = "company950484093"
var requisitionId string = "requisitionId980224926"
var title string = "title110371416"
var description string = "description-1724546052"
@@ -1104,7 +1495,7 @@
var companyDisplayName string = "companyDisplayName1982424170"
var expectedResponse = &talentpb.Job{
Name: name2,
- CompanyName: companyName,
+ Company: company,
RequisitionId: requisitionId,
Title: title,
Description: description,
@@ -1172,7 +1563,7 @@
}
func TestJobServiceUpdateJob(t *testing.T) {
var name string = "name3373707"
- var companyName string = "companyName1429880077"
+ var company string = "company950484093"
var requisitionId string = "requisitionId980224926"
var title string = "title110371416"
var description string = "description-1724546052"
@@ -1185,7 +1576,7 @@
var companyDisplayName string = "companyDisplayName1982424170"
var expectedResponse = &talentpb.Job{
Name: name,
- CompanyName: companyName,
+ Company: company,
RequisitionId: requisitionId,
Title: title,
Description: description,
@@ -1317,7 +1708,7 @@
mockJob.resps = append(mockJob.resps[:0], expectedResponse)
- var formattedParent string = fmt.Sprintf("projects/%s", "[PROJECT]")
+ var formattedParent string = fmt.Sprintf("projects/%s/tenants/%s", "[PROJECT]", "[TENANT]")
var filter string = "filter-1274492040"
var request = &talentpb.ListJobsRequest{
Parent: formattedParent,
@@ -1358,7 +1749,7 @@
errCode := codes.PermissionDenied
mockJob.err = gstatus.Error(errCode, "test error")
- var formattedParent string = fmt.Sprintf("projects/%s", "[PROJECT]")
+ var formattedParent string = fmt.Sprintf("projects/%s/tenants/%s", "[PROJECT]", "[TENANT]")
var filter string = "filter-1274492040"
var request = &talentpb.ListJobsRequest{
Parent: formattedParent,
@@ -1387,7 +1778,7 @@
mockJob.resps = append(mockJob.resps[:0], expectedResponse)
- var formattedParent string = fmt.Sprintf("projects/%s", "[PROJECT]")
+ var formattedParent string = fmt.Sprintf("projects/%s/tenants/%s", "[PROJECT]", "[TENANT]")
var filter string = "filter-1274492040"
var request = &talentpb.BatchDeleteJobsRequest{
Parent: formattedParent,
@@ -1415,7 +1806,7 @@
errCode := codes.PermissionDenied
mockJob.err = gstatus.Error(errCode, "test error")
- var formattedParent string = fmt.Sprintf("projects/%s", "[PROJECT]")
+ var formattedParent string = fmt.Sprintf("projects/%s/tenants/%s", "[PROJECT]", "[TENANT]")
var filter string = "filter-1274492040"
var request = &talentpb.BatchDeleteJobsRequest{
Parent: formattedParent,
@@ -1455,7 +1846,7 @@
mockJob.resps = append(mockJob.resps[:0], expectedResponse)
- var formattedParent string = fmt.Sprintf("projects/%s", "[PROJECT]")
+ var formattedParent string = fmt.Sprintf("projects/%s/tenants/%s", "[PROJECT]", "[TENANT]")
var requestMetadata *talentpb.RequestMetadata = &talentpb.RequestMetadata{}
var request = &talentpb.SearchJobsRequest{
Parent: formattedParent,
@@ -1496,7 +1887,7 @@
errCode := codes.PermissionDenied
mockJob.err = gstatus.Error(errCode, "test error")
- var formattedParent string = fmt.Sprintf("projects/%s", "[PROJECT]")
+ var formattedParent string = fmt.Sprintf("projects/%s/tenants/%s", "[PROJECT]", "[TENANT]")
var requestMetadata *talentpb.RequestMetadata = &talentpb.RequestMetadata{}
var request = &talentpb.SearchJobsRequest{
Parent: formattedParent,
@@ -1537,7 +1928,7 @@
mockJob.resps = append(mockJob.resps[:0], expectedResponse)
- var formattedParent string = fmt.Sprintf("projects/%s", "[PROJECT]")
+ var formattedParent string = fmt.Sprintf("projects/%s/tenants/%s", "[PROJECT]", "[TENANT]")
var requestMetadata *talentpb.RequestMetadata = &talentpb.RequestMetadata{}
var request = &talentpb.SearchJobsRequest{
Parent: formattedParent,
@@ -1578,7 +1969,7 @@
errCode := codes.PermissionDenied
mockJob.err = gstatus.Error(errCode, "test error")
- var formattedParent string = fmt.Sprintf("projects/%s", "[PROJECT]")
+ var formattedParent string = fmt.Sprintf("projects/%s/tenants/%s", "[PROJECT]", "[TENANT]")
var requestMetadata *talentpb.RequestMetadata = &talentpb.RequestMetadata{}
var request = &talentpb.SearchJobsRequest{
Parent: formattedParent,
@@ -2024,69 +2415,6 @@
}
_ = resp
}
-func TestResumeServiceParseResume(t *testing.T) {
- var rawText string = "rawText503586532"
- var expectedResponse = &talentpb.ParseResumeResponse{
- RawText: rawText,
- }
-
- mockResume.err = nil
- mockResume.reqs = nil
-
- mockResume.resps = append(mockResume.resps[:0], expectedResponse)
-
- var formattedParent string = fmt.Sprintf("projects/%s", "[PROJECT]")
- var resume []byte = []byte("45")
- var request = &talentpb.ParseResumeRequest{
- Parent: formattedParent,
- Resume: resume,
- }
-
- c, err := NewResumeClient(context.Background(), clientOpt)
- if err != nil {
- t.Fatal(err)
- }
-
- resp, err := c.ParseResume(context.Background(), request)
-
- if err != nil {
- t.Fatal(err)
- }
-
- if want, got := request, mockResume.reqs[0]; !proto.Equal(want, got) {
- t.Errorf("wrong request %q, want %q", got, want)
- }
-
- if want, got := expectedResponse, resp; !proto.Equal(want, got) {
- t.Errorf("wrong response %q, want %q)", got, want)
- }
-}
-
-func TestResumeServiceParseResumeError(t *testing.T) {
- errCode := codes.PermissionDenied
- mockResume.err = gstatus.Error(errCode, "test error")
-
- var formattedParent string = fmt.Sprintf("projects/%s", "[PROJECT]")
- var resume []byte = []byte("45")
- var request = &talentpb.ParseResumeRequest{
- Parent: formattedParent,
- Resume: resume,
- }
-
- c, err := NewResumeClient(context.Background(), clientOpt)
- if err != nil {
- t.Fatal(err)
- }
-
- resp, err := c.ParseResume(context.Background(), request)
-
- if st, ok := gstatus.FromError(err); !ok {
- t.Errorf("got error %v, expected grpc error", err)
- } else if c := st.Code(); c != errCode {
- t.Errorf("got error code %q, want %q", c, errCode)
- }
- _ = resp
-}
func TestTenantServiceCreateTenant(t *testing.T) {
var name string = "name3373707"
var externalId string = "externalId-1153075697"
diff --git a/talent/apiv4beta1/profile_client.go b/talent/apiv4beta1/profile_client.go
index 3ef64ad..9255b50 100644
--- a/talent/apiv4beta1/profile_client.go
+++ b/talent/apiv4beta1/profile_client.go
@@ -18,6 +18,7 @@
import (
"context"
+ "fmt"
"math"
"time"
@@ -132,7 +133,8 @@
// ListProfiles lists profiles by filter. The order is unspecified.
func (c *ProfileClient) ListProfiles(ctx context.Context, req *talentpb.ListProfilesRequest, opts ...gax.CallOption) *ProfileIterator {
- ctx = insertMetadata(ctx, c.xGoogMetadata)
+ md := metadata.Pairs("x-goog-request-params", fmt.Sprintf("%s=%v", "parent", req.GetParent()))
+ ctx = insertMetadata(ctx, c.xGoogMetadata, md)
opts = append(c.CallOptions.ListProfiles[0:len(c.CallOptions.ListProfiles):len(c.CallOptions.ListProfiles)], opts...)
it := &ProfileIterator{}
req = proto.Clone(req).(*talentpb.ListProfilesRequest)
@@ -169,7 +171,8 @@
// CreateProfile creates and returns a new profile.
func (c *ProfileClient) CreateProfile(ctx context.Context, req *talentpb.CreateProfileRequest, opts ...gax.CallOption) (*talentpb.Profile, error) {
- ctx = insertMetadata(ctx, c.xGoogMetadata)
+ md := metadata.Pairs("x-goog-request-params", fmt.Sprintf("%s=%v", "parent", req.GetParent()))
+ ctx = insertMetadata(ctx, c.xGoogMetadata, md)
opts = append(c.CallOptions.CreateProfile[0:len(c.CallOptions.CreateProfile):len(c.CallOptions.CreateProfile)], opts...)
var resp *talentpb.Profile
err := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error {
@@ -185,7 +188,8 @@
// GetProfile gets the specified profile.
func (c *ProfileClient) GetProfile(ctx context.Context, req *talentpb.GetProfileRequest, opts ...gax.CallOption) (*talentpb.Profile, error) {
- ctx = insertMetadata(ctx, c.xGoogMetadata)
+ md := metadata.Pairs("x-goog-request-params", fmt.Sprintf("%s=%v", "name", req.GetName()))
+ ctx = insertMetadata(ctx, c.xGoogMetadata, md)
opts = append(c.CallOptions.GetProfile[0:len(c.CallOptions.GetProfile):len(c.CallOptions.GetProfile)], opts...)
var resp *talentpb.Profile
err := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error {
@@ -201,7 +205,8 @@
// UpdateProfile updates the specified profile and returns the updated result.
func (c *ProfileClient) UpdateProfile(ctx context.Context, req *talentpb.UpdateProfileRequest, opts ...gax.CallOption) (*talentpb.Profile, error) {
- ctx = insertMetadata(ctx, c.xGoogMetadata)
+ md := metadata.Pairs("x-goog-request-params", fmt.Sprintf("%s=%v", "profile.name", req.GetProfile().GetName()))
+ ctx = insertMetadata(ctx, c.xGoogMetadata, md)
opts = append(c.CallOptions.UpdateProfile[0:len(c.CallOptions.UpdateProfile):len(c.CallOptions.UpdateProfile)], opts...)
var resp *talentpb.Profile
err := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error {
@@ -216,8 +221,11 @@
}
// DeleteProfile deletes the specified profile.
+// Prerequisite: The profile has no associated applications or assignments
+// associated.
func (c *ProfileClient) DeleteProfile(ctx context.Context, req *talentpb.DeleteProfileRequest, opts ...gax.CallOption) error {
- ctx = insertMetadata(ctx, c.xGoogMetadata)
+ md := metadata.Pairs("x-goog-request-params", fmt.Sprintf("%s=%v", "name", req.GetName()))
+ ctx = insertMetadata(ctx, c.xGoogMetadata, md)
opts = append(c.CallOptions.DeleteProfile[0:len(c.CallOptions.DeleteProfile):len(c.CallOptions.DeleteProfile)], opts...)
err := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error {
var err error
@@ -236,7 +244,8 @@
// [SearchProfilesRequest][google.cloud.talent.v4beta1.SearchProfilesRequest]
// for more information.
func (c *ProfileClient) SearchProfiles(ctx context.Context, req *talentpb.SearchProfilesRequest, opts ...gax.CallOption) *HistogramQueryResultIterator {
- ctx = insertMetadata(ctx, c.xGoogMetadata)
+ md := metadata.Pairs("x-goog-request-params", fmt.Sprintf("%s=%v", "parent", req.GetParent()))
+ ctx = insertMetadata(ctx, c.xGoogMetadata, md)
opts = append(c.CallOptions.SearchProfiles[0:len(c.CallOptions.SearchProfiles):len(c.CallOptions.SearchProfiles)], opts...)
it := &HistogramQueryResultIterator{}
req = proto.Clone(req).(*talentpb.SearchProfilesRequest)
diff --git a/talent/apiv4beta1/resume_client.go b/talent/apiv4beta1/resume_client.go
deleted file mode 100644
index da2ed4f..0000000
--- a/talent/apiv4beta1/resume_client.go
+++ /dev/null
@@ -1,158 +0,0 @@
-// Copyright 2019 Google LLC
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// https://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-
-// Code generated by gapic-generator. DO NOT EDIT.
-
-package talent
-
-import (
- "context"
-
- gax "github.com/googleapis/gax-go/v2"
- "google.golang.org/api/option"
- "google.golang.org/api/transport"
- talentpb "google.golang.org/genproto/googleapis/cloud/talent/v4beta1"
- "google.golang.org/grpc"
- "google.golang.org/grpc/metadata"
-)
-
-// ResumeCallOptions contains the retry settings for each method of ResumeClient.
-type ResumeCallOptions struct {
- ParseResume []gax.CallOption
-}
-
-func defaultResumeClientOptions() []option.ClientOption {
- return []option.ClientOption{
- option.WithEndpoint("jobs.googleapis.com:443"),
- option.WithScopes(DefaultAuthScopes()...),
- }
-}
-
-func defaultResumeCallOptions() *ResumeCallOptions {
- retry := map[[2]string][]gax.CallOption{}
- return &ResumeCallOptions{
- ParseResume: retry[[2]string{"default", "non_idempotent"}],
- }
-}
-
-// ResumeClient is a client for interacting with Cloud Talent Solution API.
-//
-// Methods, except Close, may be called concurrently. However, fields must not be modified concurrently with method calls.
-type ResumeClient struct {
- // The connection to the service.
- conn *grpc.ClientConn
-
- // The gRPC API client.
- resumeClient talentpb.ResumeServiceClient
-
- // The call options for this service.
- CallOptions *ResumeCallOptions
-
- // The x-goog-* metadata to be sent with each request.
- xGoogMetadata metadata.MD
-}
-
-// NewResumeClient creates a new resume service client.
-//
-// A service that handles resume parsing.
-func NewResumeClient(ctx context.Context, opts ...option.ClientOption) (*ResumeClient, error) {
- conn, err := transport.DialGRPC(ctx, append(defaultResumeClientOptions(), opts...)...)
- if err != nil {
- return nil, err
- }
- c := &ResumeClient{
- conn: conn,
- CallOptions: defaultResumeCallOptions(),
-
- resumeClient: talentpb.NewResumeServiceClient(conn),
- }
- c.setGoogleClientInfo()
- return c, nil
-}
-
-// Connection returns the client's connection to the API service.
-func (c *ResumeClient) Connection() *grpc.ClientConn {
- return c.conn
-}
-
-// Close closes the connection to the API service. The user should invoke this when
-// the client is no longer required.
-func (c *ResumeClient) Close() error {
- return c.conn.Close()
-}
-
-// setGoogleClientInfo sets the name and version of the application in
-// the `x-goog-api-client` header passed on each request. Intended for
-// use by Google-written clients.
-func (c *ResumeClient) setGoogleClientInfo(keyval ...string) {
- kv := append([]string{"gl-go", versionGo()}, keyval...)
- kv = append(kv, "gapic", versionClient, "gax", gax.Version, "grpc", grpc.Version)
- c.xGoogMetadata = metadata.Pairs("x-goog-api-client", gax.XGoogHeader(kv...))
-}
-
-// ParseResume parses a resume into a [Profile][google.cloud.talent.v4beta1.Profile]. The
-// API attempts to fill out the following profile fields if present within the
-// resume:
-//
-// personNames
-//
-// addresses
-//
-// emailAddress
-//
-// phoneNumbers
-//
-// personalUris
-//
-// employmentRecords
-//
-// educationRecords
-//
-// skills
-//
-// Note that some attributes in these fields may not be populated if they're
-// not present within the resume or unrecognizable by the resume parser.
-//
-// This API does not save the resume or profile. To create a profile from this
-// resume, clients need to call the CreateProfile method again with the
-// profile returned.
-//
-// The following list of formats are supported:
-//
-// PDF
-//
-// TXT
-//
-// DOC
-//
-// RTF
-//
-// DOCX
-//
-// PNG (only when [ParseResumeRequest.enable_ocr][] is set to true,
-// otherwise an error is thrown)
-func (c *ResumeClient) ParseResume(ctx context.Context, req *talentpb.ParseResumeRequest, opts ...gax.CallOption) (*talentpb.ParseResumeResponse, error) {
- ctx = insertMetadata(ctx, c.xGoogMetadata)
- opts = append(c.CallOptions.ParseResume[0:len(c.CallOptions.ParseResume):len(c.CallOptions.ParseResume)], opts...)
- var resp *talentpb.ParseResumeResponse
- err := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error {
- var err error
- resp, err = c.resumeClient.ParseResume(ctx, req, settings.GRPC...)
- return err
- }, opts...)
- if err != nil {
- return nil, err
- }
- return resp, nil
-}
diff --git a/talent/apiv4beta1/resume_client_example_test.go b/talent/apiv4beta1/resume_client_example_test.go
deleted file mode 100644
index a1c0c56..0000000
--- a/talent/apiv4beta1/resume_client_example_test.go
+++ /dev/null
@@ -1,52 +0,0 @@
-// Copyright 2019 Google LLC
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// https://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-
-// Code generated by gapic-generator. DO NOT EDIT.
-
-package talent_test
-
-import (
- "context"
-
- talent "cloud.google.com/go/talent/apiv4beta1"
- talentpb "google.golang.org/genproto/googleapis/cloud/talent/v4beta1"
-)
-
-func ExampleNewResumeClient() {
- ctx := context.Background()
- c, err := talent.NewResumeClient(ctx)
- if err != nil {
- // TODO: Handle error.
- }
- // TODO: Use client.
- _ = c
-}
-
-func ExampleResumeClient_ParseResume() {
- ctx := context.Background()
- c, err := talent.NewResumeClient(ctx)
- if err != nil {
- // TODO: Handle error.
- }
-
- req := &talentpb.ParseResumeRequest{
- // TODO: Fill request struct fields.
- }
- resp, err := c.ParseResume(ctx, req)
- if err != nil {
- // TODO: Handle error.
- }
- // TODO: Use resp.
- _ = resp
-}
diff --git a/talent/apiv4beta1/tenant_client.go b/talent/apiv4beta1/tenant_client.go
index dc834a2..50832da 100644
--- a/talent/apiv4beta1/tenant_client.go
+++ b/talent/apiv4beta1/tenant_client.go
@@ -18,6 +18,7 @@
import (
"context"
+ "fmt"
"math"
"time"
@@ -129,7 +130,8 @@
// CreateTenant creates a new tenant entity.
func (c *TenantClient) CreateTenant(ctx context.Context, req *talentpb.CreateTenantRequest, opts ...gax.CallOption) (*talentpb.Tenant, error) {
- ctx = insertMetadata(ctx, c.xGoogMetadata)
+ md := metadata.Pairs("x-goog-request-params", fmt.Sprintf("%s=%v", "parent", req.GetParent()))
+ ctx = insertMetadata(ctx, c.xGoogMetadata, md)
opts = append(c.CallOptions.CreateTenant[0:len(c.CallOptions.CreateTenant):len(c.CallOptions.CreateTenant)], opts...)
var resp *talentpb.Tenant
err := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error {
@@ -145,7 +147,8 @@
// GetTenant retrieves specified tenant.
func (c *TenantClient) GetTenant(ctx context.Context, req *talentpb.GetTenantRequest, opts ...gax.CallOption) (*talentpb.Tenant, error) {
- ctx = insertMetadata(ctx, c.xGoogMetadata)
+ md := metadata.Pairs("x-goog-request-params", fmt.Sprintf("%s=%v", "name", req.GetName()))
+ ctx = insertMetadata(ctx, c.xGoogMetadata, md)
opts = append(c.CallOptions.GetTenant[0:len(c.CallOptions.GetTenant):len(c.CallOptions.GetTenant)], opts...)
var resp *talentpb.Tenant
err := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error {
@@ -161,7 +164,8 @@
// UpdateTenant updates specified tenant.
func (c *TenantClient) UpdateTenant(ctx context.Context, req *talentpb.UpdateTenantRequest, opts ...gax.CallOption) (*talentpb.Tenant, error) {
- ctx = insertMetadata(ctx, c.xGoogMetadata)
+ md := metadata.Pairs("x-goog-request-params", fmt.Sprintf("%s=%v", "tenant.name", req.GetTenant().GetName()))
+ ctx = insertMetadata(ctx, c.xGoogMetadata, md)
opts = append(c.CallOptions.UpdateTenant[0:len(c.CallOptions.UpdateTenant):len(c.CallOptions.UpdateTenant)], opts...)
var resp *talentpb.Tenant
err := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error {
@@ -177,7 +181,8 @@
// DeleteTenant deletes specified tenant.
func (c *TenantClient) DeleteTenant(ctx context.Context, req *talentpb.DeleteTenantRequest, opts ...gax.CallOption) error {
- ctx = insertMetadata(ctx, c.xGoogMetadata)
+ md := metadata.Pairs("x-goog-request-params", fmt.Sprintf("%s=%v", "name", req.GetName()))
+ ctx = insertMetadata(ctx, c.xGoogMetadata, md)
opts = append(c.CallOptions.DeleteTenant[0:len(c.CallOptions.DeleteTenant):len(c.CallOptions.DeleteTenant)], opts...)
err := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error {
var err error
@@ -189,7 +194,8 @@
// ListTenants lists all tenants associated with the project.
func (c *TenantClient) ListTenants(ctx context.Context, req *talentpb.ListTenantsRequest, opts ...gax.CallOption) *TenantIterator {
- ctx = insertMetadata(ctx, c.xGoogMetadata)
+ md := metadata.Pairs("x-goog-request-params", fmt.Sprintf("%s=%v", "parent", req.GetParent()))
+ ctx = insertMetadata(ctx, c.xGoogMetadata, md)
opts = append(c.CallOptions.ListTenants[0:len(c.CallOptions.ListTenants):len(c.CallOptions.ListTenants)], opts...)
it := &TenantIterator{}
req = proto.Clone(req).(*talentpb.ListTenantsRequest)
diff --git a/texttospeech/apiv1/doc.go b/texttospeech/apiv1/doc.go
index f270dd3..dfd1577 100644
--- a/texttospeech/apiv1/doc.go
+++ b/texttospeech/apiv1/doc.go
@@ -98,4 +98,4 @@
return "UNKNOWN"
}
-const versionClient = "20190322"
+const versionClient = "20190401"
diff --git a/trace/apiv1/doc.go b/trace/apiv1/doc.go
index b38cccd..972ac84 100644
--- a/trace/apiv1/doc.go
+++ b/trace/apiv1/doc.go
@@ -105,4 +105,4 @@
return "UNKNOWN"
}
-const versionClient = "20190322"
+const versionClient = "20190401"
diff --git a/trace/apiv1/trace_client.go b/trace/apiv1/trace_client.go
index 929ba9f..6932d13 100644
--- a/trace/apiv1/trace_client.go
+++ b/trace/apiv1/trace_client.go
@@ -18,6 +18,7 @@
import (
"context"
+ "fmt"
"math"
"time"
@@ -133,7 +134,8 @@
// and any new fields provided are merged with the existing trace data. If the
// ID does not match, a new trace is created.
func (c *Client) PatchTraces(ctx context.Context, req *cloudtracepb.PatchTracesRequest, opts ...gax.CallOption) error {
- ctx = insertMetadata(ctx, c.xGoogMetadata)
+ md := metadata.Pairs("x-goog-request-params", fmt.Sprintf("%s=%v", "project_id", req.GetProjectId()))
+ ctx = insertMetadata(ctx, c.xGoogMetadata, md)
opts = append(c.CallOptions.PatchTraces[0:len(c.CallOptions.PatchTraces):len(c.CallOptions.PatchTraces)], opts...)
err := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error {
var err error
@@ -161,7 +163,8 @@
// ListTraces returns of a list of traces that match the specified filter conditions.
func (c *Client) ListTraces(ctx context.Context, req *cloudtracepb.ListTracesRequest, opts ...gax.CallOption) *TraceIterator {
- ctx = insertMetadata(ctx, c.xGoogMetadata)
+ md := metadata.Pairs("x-goog-request-params", fmt.Sprintf("%s=%v", "project_id", req.GetProjectId()))
+ ctx = insertMetadata(ctx, c.xGoogMetadata, md)
opts = append(c.CallOptions.ListTraces[0:len(c.CallOptions.ListTraces):len(c.CallOptions.ListTraces)], opts...)
it := &TraceIterator{}
req = proto.Clone(req).(*cloudtracepb.ListTracesRequest)
diff --git a/trace/apiv2/doc.go b/trace/apiv2/doc.go
index 0bd7fa8..f1e08fe 100644
--- a/trace/apiv2/doc.go
+++ b/trace/apiv2/doc.go
@@ -102,4 +102,4 @@
return "UNKNOWN"
}
-const versionClient = "20190322"
+const versionClient = "20190401"
diff --git a/trace/apiv2/trace_client.go b/trace/apiv2/trace_client.go
index cbc96c9..a9948d2 100644
--- a/trace/apiv2/trace_client.go
+++ b/trace/apiv2/trace_client.go
@@ -18,6 +18,7 @@
import (
"context"
+ "fmt"
"time"
gax "github.com/googleapis/gax-go/v2"
@@ -125,7 +126,8 @@
// BatchWriteSpans sends new spans to new or existing traces. You cannot update
// existing spans.
func (c *Client) BatchWriteSpans(ctx context.Context, req *cloudtracepb.BatchWriteSpansRequest, opts ...gax.CallOption) error {
- ctx = insertMetadata(ctx, c.xGoogMetadata)
+ md := metadata.Pairs("x-goog-request-params", fmt.Sprintf("%s=%v", "name", req.GetName()))
+ ctx = insertMetadata(ctx, c.xGoogMetadata, md)
opts = append(c.CallOptions.BatchWriteSpans[0:len(c.CallOptions.BatchWriteSpans):len(c.CallOptions.BatchWriteSpans)], opts...)
err := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error {
var err error
@@ -137,7 +139,8 @@
// CreateSpan creates a new span.
func (c *Client) CreateSpan(ctx context.Context, req *cloudtracepb.Span, opts ...gax.CallOption) (*cloudtracepb.Span, error) {
- ctx = insertMetadata(ctx, c.xGoogMetadata)
+ md := metadata.Pairs("x-goog-request-params", fmt.Sprintf("%s=%v", "name", req.GetName()))
+ ctx = insertMetadata(ctx, c.xGoogMetadata, md)
opts = append(c.CallOptions.CreateSpan[0:len(c.CallOptions.CreateSpan):len(c.CallOptions.CreateSpan)], opts...)
var resp *cloudtracepb.Span
err := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error {
diff --git a/videointelligence/apiv1/doc.go b/videointelligence/apiv1/doc.go
index 744d9d2..0afa6f8 100644
--- a/videointelligence/apiv1/doc.go
+++ b/videointelligence/apiv1/doc.go
@@ -97,4 +97,4 @@
return "UNKNOWN"
}
-const versionClient = "20190322"
+const versionClient = "20190401"
diff --git a/videointelligence/apiv1beta1/doc.go b/videointelligence/apiv1beta1/doc.go
index 77c713b..fa89906 100644
--- a/videointelligence/apiv1beta1/doc.go
+++ b/videointelligence/apiv1beta1/doc.go
@@ -97,4 +97,4 @@
return "UNKNOWN"
}
-const versionClient = "20190322"
+const versionClient = "20190401"
diff --git a/videointelligence/apiv1beta2/doc.go b/videointelligence/apiv1beta2/doc.go
index af1e541..7ff028e 100644
--- a/videointelligence/apiv1beta2/doc.go
+++ b/videointelligence/apiv1beta2/doc.go
@@ -97,4 +97,4 @@
return "UNKNOWN"
}
-const versionClient = "20190322"
+const versionClient = "20190401"
diff --git a/vision/apiv1/doc.go b/vision/apiv1/doc.go
index db2976c..c239e01 100644
--- a/vision/apiv1/doc.go
+++ b/vision/apiv1/doc.go
@@ -100,4 +100,4 @@
return "UNKNOWN"
}
-const versionClient = "20190322"
+const versionClient = "20190401"
diff --git a/vision/apiv1/product_search_client.go b/vision/apiv1/product_search_client.go
index 91a3ac0..66d2776 100644
--- a/vision/apiv1/product_search_client.go
+++ b/vision/apiv1/product_search_client.go
@@ -18,6 +18,7 @@
import (
"context"
+ "fmt"
"math"
"time"
@@ -198,7 +199,8 @@
//
// Returns INVALID_ARGUMENT if product_category is missing or invalid.
func (c *ProductSearchClient) CreateProduct(ctx context.Context, req *visionpb.CreateProductRequest, opts ...gax.CallOption) (*visionpb.Product, error) {
- ctx = insertMetadata(ctx, c.xGoogMetadata)
+ md := metadata.Pairs("x-goog-request-params", fmt.Sprintf("%s=%v", "parent", req.GetParent()))
+ ctx = insertMetadata(ctx, c.xGoogMetadata, md)
opts = append(c.CallOptions.CreateProduct[0:len(c.CallOptions.CreateProduct):len(c.CallOptions.CreateProduct)], opts...)
var resp *visionpb.Product
err := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error {
@@ -218,7 +220,8 @@
//
// Returns INVALID_ARGUMENT if page_size is greater than 100 or less than 1.
func (c *ProductSearchClient) ListProducts(ctx context.Context, req *visionpb.ListProductsRequest, opts ...gax.CallOption) *ProductIterator {
- ctx = insertMetadata(ctx, c.xGoogMetadata)
+ md := metadata.Pairs("x-goog-request-params", fmt.Sprintf("%s=%v", "parent", req.GetParent()))
+ ctx = insertMetadata(ctx, c.xGoogMetadata, md)
opts = append(c.CallOptions.ListProducts[0:len(c.CallOptions.ListProducts):len(c.CallOptions.ListProducts)], opts...)
it := &ProductIterator{}
req = proto.Clone(req).(*visionpb.ListProductsRequest)
@@ -259,7 +262,8 @@
//
// Returns NOT_FOUND if the Product does not exist.
func (c *ProductSearchClient) GetProduct(ctx context.Context, req *visionpb.GetProductRequest, opts ...gax.CallOption) (*visionpb.Product, error) {
- ctx = insertMetadata(ctx, c.xGoogMetadata)
+ md := metadata.Pairs("x-goog-request-params", fmt.Sprintf("%s=%v", "name", req.GetName()))
+ ctx = insertMetadata(ctx, c.xGoogMetadata, md)
opts = append(c.CallOptions.GetProduct[0:len(c.CallOptions.GetProduct):len(c.CallOptions.GetProduct)], opts...)
var resp *visionpb.Product
err := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error {
@@ -292,7 +296,8 @@
//
// Returns INVALID_ARGUMENT if product_category is present in update_mask.
func (c *ProductSearchClient) UpdateProduct(ctx context.Context, req *visionpb.UpdateProductRequest, opts ...gax.CallOption) (*visionpb.Product, error) {
- ctx = insertMetadata(ctx, c.xGoogMetadata)
+ md := metadata.Pairs("x-goog-request-params", fmt.Sprintf("%s=%v", "product.name", req.GetProduct().GetName()))
+ ctx = insertMetadata(ctx, c.xGoogMetadata, md)
opts = append(c.CallOptions.UpdateProduct[0:len(c.CallOptions.UpdateProduct):len(c.CallOptions.UpdateProduct)], opts...)
var resp *visionpb.Product
err := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error {
@@ -316,7 +321,8 @@
//
// Returns NOT_FOUND if the product does not exist.
func (c *ProductSearchClient) DeleteProduct(ctx context.Context, req *visionpb.DeleteProductRequest, opts ...gax.CallOption) error {
- ctx = insertMetadata(ctx, c.xGoogMetadata)
+ md := metadata.Pairs("x-goog-request-params", fmt.Sprintf("%s=%v", "name", req.GetName()))
+ ctx = insertMetadata(ctx, c.xGoogMetadata, md)
opts = append(c.CallOptions.DeleteProduct[0:len(c.CallOptions.DeleteProduct):len(c.CallOptions.DeleteProduct)], opts...)
err := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error {
var err error
@@ -335,7 +341,8 @@
// Returns INVALID_ARGUMENT if the page_size is greater than 100, or less
// than 1.
func (c *ProductSearchClient) ListReferenceImages(ctx context.Context, req *visionpb.ListReferenceImagesRequest, opts ...gax.CallOption) *ReferenceImageIterator {
- ctx = insertMetadata(ctx, c.xGoogMetadata)
+ md := metadata.Pairs("x-goog-request-params", fmt.Sprintf("%s=%v", "parent", req.GetParent()))
+ ctx = insertMetadata(ctx, c.xGoogMetadata, md)
opts = append(c.CallOptions.ListReferenceImages[0:len(c.CallOptions.ListReferenceImages):len(c.CallOptions.ListReferenceImages)], opts...)
it := &ReferenceImageIterator{}
req = proto.Clone(req).(*visionpb.ListReferenceImagesRequest)
@@ -376,7 +383,8 @@
//
// Returns NOT_FOUND if the specified image does not exist.
func (c *ProductSearchClient) GetReferenceImage(ctx context.Context, req *visionpb.GetReferenceImageRequest, opts ...gax.CallOption) (*visionpb.ReferenceImage, error) {
- ctx = insertMetadata(ctx, c.xGoogMetadata)
+ md := metadata.Pairs("x-goog-request-params", fmt.Sprintf("%s=%v", "name", req.GetName()))
+ ctx = insertMetadata(ctx, c.xGoogMetadata, md)
opts = append(c.CallOptions.GetReferenceImage[0:len(c.CallOptions.GetReferenceImage):len(c.CallOptions.GetReferenceImage)], opts...)
var resp *visionpb.ReferenceImage
err := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error {
@@ -402,7 +410,8 @@
//
// Returns NOT_FOUND if the reference image does not exist.
func (c *ProductSearchClient) DeleteReferenceImage(ctx context.Context, req *visionpb.DeleteReferenceImageRequest, opts ...gax.CallOption) error {
- ctx = insertMetadata(ctx, c.xGoogMetadata)
+ md := metadata.Pairs("x-goog-request-params", fmt.Sprintf("%s=%v", "name", req.GetName()))
+ ctx = insertMetadata(ctx, c.xGoogMetadata, md)
opts = append(c.CallOptions.DeleteReferenceImage[0:len(c.CallOptions.DeleteReferenceImage):len(c.CallOptions.DeleteReferenceImage)], opts...)
err := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error {
var err error
@@ -435,7 +444,8 @@
//
// Returns INVALID_ARGUMENT if bounding_poly contains more than 10 polygons.
func (c *ProductSearchClient) CreateReferenceImage(ctx context.Context, req *visionpb.CreateReferenceImageRequest, opts ...gax.CallOption) (*visionpb.ReferenceImage, error) {
- ctx = insertMetadata(ctx, c.xGoogMetadata)
+ md := metadata.Pairs("x-goog-request-params", fmt.Sprintf("%s=%v", "parent", req.GetParent()))
+ ctx = insertMetadata(ctx, c.xGoogMetadata, md)
opts = append(c.CallOptions.CreateReferenceImage[0:len(c.CallOptions.CreateReferenceImage):len(c.CallOptions.CreateReferenceImage)], opts...)
var resp *visionpb.ReferenceImage
err := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error {
@@ -456,7 +466,8 @@
// Returns INVALID_ARGUMENT if display_name is missing, or is longer than
// 4096 characters.
func (c *ProductSearchClient) CreateProductSet(ctx context.Context, req *visionpb.CreateProductSetRequest, opts ...gax.CallOption) (*visionpb.ProductSet, error) {
- ctx = insertMetadata(ctx, c.xGoogMetadata)
+ md := metadata.Pairs("x-goog-request-params", fmt.Sprintf("%s=%v", "parent", req.GetParent()))
+ ctx = insertMetadata(ctx, c.xGoogMetadata, md)
opts = append(c.CallOptions.CreateProductSet[0:len(c.CallOptions.CreateProductSet):len(c.CallOptions.CreateProductSet)], opts...)
var resp *visionpb.ProductSet
err := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error {
@@ -477,7 +488,8 @@
// Returns INVALID_ARGUMENT if page_size is greater than 100, or less
// than 1.
func (c *ProductSearchClient) ListProductSets(ctx context.Context, req *visionpb.ListProductSetsRequest, opts ...gax.CallOption) *ProductSetIterator {
- ctx = insertMetadata(ctx, c.xGoogMetadata)
+ md := metadata.Pairs("x-goog-request-params", fmt.Sprintf("%s=%v", "parent", req.GetParent()))
+ ctx = insertMetadata(ctx, c.xGoogMetadata, md)
opts = append(c.CallOptions.ListProductSets[0:len(c.CallOptions.ListProductSets):len(c.CallOptions.ListProductSets)], opts...)
it := &ProductSetIterator{}
req = proto.Clone(req).(*visionpb.ListProductSetsRequest)
@@ -518,7 +530,8 @@
//
// Returns NOT_FOUND if the ProductSet does not exist.
func (c *ProductSearchClient) GetProductSet(ctx context.Context, req *visionpb.GetProductSetRequest, opts ...gax.CallOption) (*visionpb.ProductSet, error) {
- ctx = insertMetadata(ctx, c.xGoogMetadata)
+ md := metadata.Pairs("x-goog-request-params", fmt.Sprintf("%s=%v", "name", req.GetName()))
+ ctx = insertMetadata(ctx, c.xGoogMetadata, md)
opts = append(c.CallOptions.GetProductSet[0:len(c.CallOptions.GetProductSet):len(c.CallOptions.GetProductSet)], opts...)
var resp *visionpb.ProductSet
err := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error {
@@ -542,7 +555,8 @@
// Returns INVALID_ARGUMENT if display_name is present in update_mask but
// missing from the request or longer than 4096 characters.
func (c *ProductSearchClient) UpdateProductSet(ctx context.Context, req *visionpb.UpdateProductSetRequest, opts ...gax.CallOption) (*visionpb.ProductSet, error) {
- ctx = insertMetadata(ctx, c.xGoogMetadata)
+ md := metadata.Pairs("x-goog-request-params", fmt.Sprintf("%s=%v", "product_set.name", req.GetProductSet().GetName()))
+ ctx = insertMetadata(ctx, c.xGoogMetadata, md)
opts = append(c.CallOptions.UpdateProductSet[0:len(c.CallOptions.UpdateProductSet):len(c.CallOptions.UpdateProductSet)], opts...)
var resp *visionpb.ProductSet
err := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error {
@@ -565,7 +579,8 @@
//
// Returns NOT_FOUND if the ProductSet does not exist.
func (c *ProductSearchClient) DeleteProductSet(ctx context.Context, req *visionpb.DeleteProductSetRequest, opts ...gax.CallOption) error {
- ctx = insertMetadata(ctx, c.xGoogMetadata)
+ md := metadata.Pairs("x-goog-request-params", fmt.Sprintf("%s=%v", "name", req.GetName()))
+ ctx = insertMetadata(ctx, c.xGoogMetadata, md)
opts = append(c.CallOptions.DeleteProductSet[0:len(c.CallOptions.DeleteProductSet):len(c.CallOptions.DeleteProductSet)], opts...)
err := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error {
var err error
@@ -584,7 +599,8 @@
//
// Returns NOT_FOUND if the Product or the ProductSet doesn't exist.
func (c *ProductSearchClient) AddProductToProductSet(ctx context.Context, req *visionpb.AddProductToProductSetRequest, opts ...gax.CallOption) error {
- ctx = insertMetadata(ctx, c.xGoogMetadata)
+ md := metadata.Pairs("x-goog-request-params", fmt.Sprintf("%s=%v", "name", req.GetName()))
+ ctx = insertMetadata(ctx, c.xGoogMetadata, md)
opts = append(c.CallOptions.AddProductToProductSet[0:len(c.CallOptions.AddProductToProductSet):len(c.CallOptions.AddProductToProductSet)], opts...)
err := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error {
var err error
@@ -600,7 +616,8 @@
//
// Returns NOT_FOUND If the Product is not found under the ProductSet.
func (c *ProductSearchClient) RemoveProductFromProductSet(ctx context.Context, req *visionpb.RemoveProductFromProductSetRequest, opts ...gax.CallOption) error {
- ctx = insertMetadata(ctx, c.xGoogMetadata)
+ md := metadata.Pairs("x-goog-request-params", fmt.Sprintf("%s=%v", "name", req.GetName()))
+ ctx = insertMetadata(ctx, c.xGoogMetadata, md)
opts = append(c.CallOptions.RemoveProductFromProductSet[0:len(c.CallOptions.RemoveProductFromProductSet):len(c.CallOptions.RemoveProductFromProductSet)], opts...)
err := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error {
var err error
@@ -618,7 +635,8 @@
//
// Returns INVALID_ARGUMENT if page_size is greater than 100 or less than 1.
func (c *ProductSearchClient) ListProductsInProductSet(ctx context.Context, req *visionpb.ListProductsInProductSetRequest, opts ...gax.CallOption) *ProductIterator {
- ctx = insertMetadata(ctx, c.xGoogMetadata)
+ md := metadata.Pairs("x-goog-request-params", fmt.Sprintf("%s=%v", "name", req.GetName()))
+ ctx = insertMetadata(ctx, c.xGoogMetadata, md)
opts = append(c.CallOptions.ListProductsInProductSet[0:len(c.CallOptions.ListProductsInProductSet):len(c.CallOptions.ListProductsInProductSet)], opts...)
it := &ProductIterator{}
req = proto.Clone(req).(*visionpb.ListProductsInProductSetRequest)
@@ -665,7 +683,8 @@
// For the format of the csv file please see
// [ImportProductSetsGcsSource.csv_file_uri][google.cloud.vision.v1.ImportProductSetsGcsSource.csv_file_uri].
func (c *ProductSearchClient) ImportProductSets(ctx context.Context, req *visionpb.ImportProductSetsRequest, opts ...gax.CallOption) (*ImportProductSetsOperation, error) {
- ctx = insertMetadata(ctx, c.xGoogMetadata)
+ md := metadata.Pairs("x-goog-request-params", fmt.Sprintf("%s=%v", "parent", req.GetParent()))
+ ctx = insertMetadata(ctx, c.xGoogMetadata, md)
opts = append(c.CallOptions.ImportProductSets[0:len(c.CallOptions.ImportProductSets):len(c.CallOptions.ImportProductSets)], opts...)
var resp *longrunningpb.Operation
err := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error {
diff --git a/vision/apiv1p1beta1/doc.go b/vision/apiv1p1beta1/doc.go
index cae328f..404ea7b 100644
--- a/vision/apiv1p1beta1/doc.go
+++ b/vision/apiv1p1beta1/doc.go
@@ -101,4 +101,4 @@
return "UNKNOWN"
}
-const versionClient = "20190322"
+const versionClient = "20190401"