// Copyright 2025 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 protoc-gen-go_gapic. DO NOT EDIT. package contactcenterinsights import ( "bytes" "context" "fmt" "log/slog" "math" "net/http" "net/url" "time" contactcenterinsightspb "cloud.google.com/go/contactcenterinsights/apiv1/contactcenterinsightspb" "cloud.google.com/go/longrunning" lroauto "cloud.google.com/go/longrunning/autogen" longrunningpb "cloud.google.com/go/longrunning/autogen/longrunningpb" gax "github.com/googleapis/gax-go/v2" "google.golang.org/api/iterator" "google.golang.org/api/option" "google.golang.org/api/option/internaloption" gtransport "google.golang.org/api/transport/grpc" httptransport "google.golang.org/api/transport/http" "google.golang.org/grpc" "google.golang.org/grpc/codes" "google.golang.org/protobuf/encoding/protojson" "google.golang.org/protobuf/proto" ) var newClientHook clientHook // CallOptions contains the retry settings for each method of Client. type CallOptions struct { CreateConversation []gax.CallOption UploadConversation []gax.CallOption UpdateConversation []gax.CallOption GetConversation []gax.CallOption ListConversations []gax.CallOption DeleteConversation []gax.CallOption CreateAnalysis []gax.CallOption GetAnalysis []gax.CallOption ListAnalyses []gax.CallOption DeleteAnalysis []gax.CallOption BulkAnalyzeConversations []gax.CallOption BulkDeleteConversations []gax.CallOption IngestConversations []gax.CallOption ExportInsightsData []gax.CallOption CreateIssueModel []gax.CallOption UpdateIssueModel []gax.CallOption GetIssueModel []gax.CallOption ListIssueModels []gax.CallOption DeleteIssueModel []gax.CallOption DeployIssueModel []gax.CallOption UndeployIssueModel []gax.CallOption ExportIssueModel []gax.CallOption ImportIssueModel []gax.CallOption GetIssue []gax.CallOption ListIssues []gax.CallOption UpdateIssue []gax.CallOption DeleteIssue []gax.CallOption CalculateIssueModelStats []gax.CallOption CreatePhraseMatcher []gax.CallOption GetPhraseMatcher []gax.CallOption ListPhraseMatchers []gax.CallOption DeletePhraseMatcher []gax.CallOption UpdatePhraseMatcher []gax.CallOption CalculateStats []gax.CallOption GetSettings []gax.CallOption UpdateSettings []gax.CallOption CreateAnalysisRule []gax.CallOption GetAnalysisRule []gax.CallOption ListAnalysisRules []gax.CallOption UpdateAnalysisRule []gax.CallOption DeleteAnalysisRule []gax.CallOption GetEncryptionSpec []gax.CallOption InitializeEncryptionSpec []gax.CallOption CreateView []gax.CallOption GetView []gax.CallOption ListViews []gax.CallOption UpdateView []gax.CallOption DeleteView []gax.CallOption QueryMetrics []gax.CallOption CreateQaQuestion []gax.CallOption GetQaQuestion []gax.CallOption UpdateQaQuestion []gax.CallOption DeleteQaQuestion []gax.CallOption ListQaQuestions []gax.CallOption CreateQaScorecard []gax.CallOption GetQaScorecard []gax.CallOption UpdateQaScorecard []gax.CallOption DeleteQaScorecard []gax.CallOption ListQaScorecards []gax.CallOption CreateQaScorecardRevision []gax.CallOption GetQaScorecardRevision []gax.CallOption TuneQaScorecardRevision []gax.CallOption DeployQaScorecardRevision []gax.CallOption UndeployQaScorecardRevision []gax.CallOption DeleteQaScorecardRevision []gax.CallOption ListQaScorecardRevisions []gax.CallOption CreateFeedbackLabel []gax.CallOption ListFeedbackLabels []gax.CallOption GetFeedbackLabel []gax.CallOption UpdateFeedbackLabel []gax.CallOption DeleteFeedbackLabel []gax.CallOption ListAllFeedbackLabels []gax.CallOption BulkUploadFeedbackLabels []gax.CallOption BulkDownloadFeedbackLabels []gax.CallOption CancelOperation []gax.CallOption GetOperation []gax.CallOption ListOperations []gax.CallOption } func defaultGRPCClientOptions() []option.ClientOption { return []option.ClientOption{ internaloption.WithDefaultEndpoint("contactcenterinsights.googleapis.com:443"), internaloption.WithDefaultEndpointTemplate("contactcenterinsights.UNIVERSE_DOMAIN:443"), internaloption.WithDefaultMTLSEndpoint("contactcenterinsights.mtls.googleapis.com:443"), internaloption.WithDefaultUniverseDomain("googleapis.com"), internaloption.WithDefaultAudience("https://contactcenterinsights.googleapis.com/"), internaloption.WithDefaultScopes(DefaultAuthScopes()...), internaloption.EnableJwtWithScope(), internaloption.EnableNewAuthLibrary(), option.WithGRPCDialOption(grpc.WithDefaultCallOptions( grpc.MaxCallRecvMsgSize(math.MaxInt32))), } } func defaultCallOptions() *CallOptions { return &CallOptions{ CreateConversation: []gax.CallOption{ gax.WithTimeout(60000 * time.Millisecond), gax.WithRetry(func() gax.Retryer { return gax.OnCodes([]codes.Code{ codes.Unavailable, }, gax.Backoff{ Initial: 1000 * time.Millisecond, Max: 10000 * time.Millisecond, Multiplier: 1.30, }) }), }, UploadConversation: []gax.CallOption{ gax.WithTimeout(60000 * time.Millisecond), gax.WithRetry(func() gax.Retryer { return gax.OnCodes([]codes.Code{ codes.Unavailable, }, gax.Backoff{ Initial: 1000 * time.Millisecond, Max: 10000 * time.Millisecond, Multiplier: 1.30, }) }), }, UpdateConversation: []gax.CallOption{ gax.WithTimeout(60000 * time.Millisecond), gax.WithRetry(func() gax.Retryer { return gax.OnCodes([]codes.Code{ codes.Unavailable, }, gax.Backoff{ Initial: 1000 * time.Millisecond, Max: 10000 * time.Millisecond, Multiplier: 1.30, }) }), }, GetConversation: []gax.CallOption{ gax.WithTimeout(60000 * time.Millisecond), gax.WithRetry(func() gax.Retryer { return gax.OnCodes([]codes.Code{ codes.Unavailable, }, gax.Backoff{ Initial: 1000 * time.Millisecond, Max: 10000 * time.Millisecond, Multiplier: 1.30, }) }), }, ListConversations: []gax.CallOption{ gax.WithTimeout(60000 * time.Millisecond), gax.WithRetry(func() gax.Retryer { return gax.OnCodes([]codes.Code{ codes.Unavailable, }, gax.Backoff{ Initial: 1000 * time.Millisecond, Max: 10000 * time.Millisecond, Multiplier: 1.30, }) }), }, DeleteConversation: []gax.CallOption{ gax.WithTimeout(60000 * time.Millisecond), gax.WithRetry(func() gax.Retryer { return gax.OnCodes([]codes.Code{ codes.Unavailable, }, gax.Backoff{ Initial: 1000 * time.Millisecond, Max: 10000 * time.Millisecond, Multiplier: 1.30, }) }), }, CreateAnalysis: []gax.CallOption{ gax.WithTimeout(60000 * time.Millisecond), gax.WithRetry(func() gax.Retryer { return gax.OnCodes([]codes.Code{ codes.Unavailable, }, gax.Backoff{ Initial: 1000 * time.Millisecond, Max: 10000 * time.Millisecond, Multiplier: 1.30, }) }), }, GetAnalysis: []gax.CallOption{ gax.WithTimeout(60000 * time.Millisecond), gax.WithRetry(func() gax.Retryer { return gax.OnCodes([]codes.Code{ codes.Unavailable, }, gax.Backoff{ Initial: 1000 * time.Millisecond, Max: 10000 * time.Millisecond, Multiplier: 1.30, }) }), }, ListAnalyses: []gax.CallOption{ gax.WithTimeout(60000 * time.Millisecond), gax.WithRetry(func() gax.Retryer { return gax.OnCodes([]codes.Code{ codes.Unavailable, }, gax.Backoff{ Initial: 1000 * time.Millisecond, Max: 10000 * time.Millisecond, Multiplier: 1.30, }) }), }, DeleteAnalysis: []gax.CallOption{ gax.WithTimeout(60000 * time.Millisecond), gax.WithRetry(func() gax.Retryer { return gax.OnCodes([]codes.Code{ codes.Unavailable, }, gax.Backoff{ Initial: 1000 * time.Millisecond, Max: 10000 * time.Millisecond, Multiplier: 1.30, }) }), }, BulkAnalyzeConversations: []gax.CallOption{ gax.WithTimeout(60000 * time.Millisecond), gax.WithRetry(func() gax.Retryer { return gax.OnCodes([]codes.Code{ codes.Unavailable, }, gax.Backoff{ Initial: 1000 * time.Millisecond, Max: 10000 * time.Millisecond, Multiplier: 1.30, }) }), }, BulkDeleteConversations: []gax.CallOption{ gax.WithTimeout(60000 * time.Millisecond), gax.WithRetry(func() gax.Retryer { return gax.OnCodes([]codes.Code{ codes.Unavailable, }, gax.Backoff{ Initial: 1000 * time.Millisecond, Max: 10000 * time.Millisecond, Multiplier: 1.30, }) }), }, IngestConversations: []gax.CallOption{ gax.WithTimeout(60000 * time.Millisecond), gax.WithRetry(func() gax.Retryer { return gax.OnCodes([]codes.Code{ codes.Unavailable, }, gax.Backoff{ Initial: 1000 * time.Millisecond, Max: 10000 * time.Millisecond, Multiplier: 1.30, }) }), }, ExportInsightsData: []gax.CallOption{ gax.WithTimeout(60000 * time.Millisecond), gax.WithRetry(func() gax.Retryer { return gax.OnCodes([]codes.Code{ codes.Unavailable, }, gax.Backoff{ Initial: 1000 * time.Millisecond, Max: 10000 * time.Millisecond, Multiplier: 1.30, }) }), }, CreateIssueModel: []gax.CallOption{ gax.WithTimeout(60000 * time.Millisecond), gax.WithRetry(func() gax.Retryer { return gax.OnCodes([]codes.Code{ codes.Unavailable, }, gax.Backoff{ Initial: 1000 * time.Millisecond, Max: 10000 * time.Millisecond, Multiplier: 1.30, }) }), }, UpdateIssueModel: []gax.CallOption{ gax.WithTimeout(60000 * time.Millisecond), gax.WithRetry(func() gax.Retryer { return gax.OnCodes([]codes.Code{ codes.Unavailable, }, gax.Backoff{ Initial: 1000 * time.Millisecond, Max: 10000 * time.Millisecond, Multiplier: 1.30, }) }), }, GetIssueModel: []gax.CallOption{ gax.WithTimeout(60000 * time.Millisecond), gax.WithRetry(func() gax.Retryer { return gax.OnCodes([]codes.Code{ codes.Unavailable, }, gax.Backoff{ Initial: 1000 * time.Millisecond, Max: 10000 * time.Millisecond, Multiplier: 1.30, }) }), }, ListIssueModels: []gax.CallOption{ gax.WithTimeout(60000 * time.Millisecond), gax.WithRetry(func() gax.Retryer { return gax.OnCodes([]codes.Code{ codes.Unavailable, }, gax.Backoff{ Initial: 1000 * time.Millisecond, Max: 10000 * time.Millisecond, Multiplier: 1.30, }) }), }, DeleteIssueModel: []gax.CallOption{ gax.WithTimeout(60000 * time.Millisecond), gax.WithRetry(func() gax.Retryer { return gax.OnCodes([]codes.Code{ codes.Unavailable, }, gax.Backoff{ Initial: 1000 * time.Millisecond, Max: 10000 * time.Millisecond, Multiplier: 1.30, }) }), }, DeployIssueModel: []gax.CallOption{ gax.WithTimeout(60000 * time.Millisecond), gax.WithRetry(func() gax.Retryer { return gax.OnCodes([]codes.Code{ codes.Unavailable, }, gax.Backoff{ Initial: 1000 * time.Millisecond, Max: 10000 * time.Millisecond, Multiplier: 1.30, }) }), }, UndeployIssueModel: []gax.CallOption{ gax.WithTimeout(60000 * time.Millisecond), gax.WithRetry(func() gax.Retryer { return gax.OnCodes([]codes.Code{ codes.Unavailable, }, gax.Backoff{ Initial: 1000 * time.Millisecond, Max: 10000 * time.Millisecond, Multiplier: 1.30, }) }), }, ExportIssueModel: []gax.CallOption{ gax.WithTimeout(60000 * time.Millisecond), gax.WithRetry(func() gax.Retryer { return gax.OnCodes([]codes.Code{ codes.Unavailable, }, gax.Backoff{ Initial: 1000 * time.Millisecond, Max: 10000 * time.Millisecond, Multiplier: 1.30, }) }), }, ImportIssueModel: []gax.CallOption{ gax.WithTimeout(60000 * time.Millisecond), gax.WithRetry(func() gax.Retryer { return gax.OnCodes([]codes.Code{ codes.Unavailable, }, gax.Backoff{ Initial: 1000 * time.Millisecond, Max: 10000 * time.Millisecond, Multiplier: 1.30, }) }), }, GetIssue: []gax.CallOption{ gax.WithTimeout(60000 * time.Millisecond), gax.WithRetry(func() gax.Retryer { return gax.OnCodes([]codes.Code{ codes.Unavailable, }, gax.Backoff{ Initial: 1000 * time.Millisecond, Max: 10000 * time.Millisecond, Multiplier: 1.30, }) }), }, ListIssues: []gax.CallOption{ gax.WithTimeout(60000 * time.Millisecond), gax.WithRetry(func() gax.Retryer { return gax.OnCodes([]codes.Code{ codes.Unavailable, }, gax.Backoff{ Initial: 1000 * time.Millisecond, Max: 10000 * time.Millisecond, Multiplier: 1.30, }) }), }, UpdateIssue: []gax.CallOption{ gax.WithTimeout(60000 * time.Millisecond), gax.WithRetry(func() gax.Retryer { return gax.OnCodes([]codes.Code{ codes.Unavailable, }, gax.Backoff{ Initial: 1000 * time.Millisecond, Max: 10000 * time.Millisecond, Multiplier: 1.30, }) }), }, DeleteIssue: []gax.CallOption{ gax.WithTimeout(60000 * time.Millisecond), gax.WithRetry(func() gax.Retryer { return gax.OnCodes([]codes.Code{ codes.Unavailable, }, gax.Backoff{ Initial: 1000 * time.Millisecond, Max: 10000 * time.Millisecond, Multiplier: 1.30, }) }), }, CalculateIssueModelStats: []gax.CallOption{ gax.WithTimeout(60000 * time.Millisecond), gax.WithRetry(func() gax.Retryer { return gax.OnCodes([]codes.Code{ codes.Unavailable, }, gax.Backoff{ Initial: 1000 * time.Millisecond, Max: 10000 * time.Millisecond, Multiplier: 1.30, }) }), }, CreatePhraseMatcher: []gax.CallOption{ gax.WithTimeout(60000 * time.Millisecond), gax.WithRetry(func() gax.Retryer { return gax.OnCodes([]codes.Code{ codes.Unavailable, }, gax.Backoff{ Initial: 1000 * time.Millisecond, Max: 10000 * time.Millisecond, Multiplier: 1.30, }) }), }, GetPhraseMatcher: []gax.CallOption{ gax.WithTimeout(60000 * time.Millisecond), gax.WithRetry(func() gax.Retryer { return gax.OnCodes([]codes.Code{ codes.Unavailable, }, gax.Backoff{ Initial: 1000 * time.Millisecond, Max: 10000 * time.Millisecond, Multiplier: 1.30, }) }), }, ListPhraseMatchers: []gax.CallOption{ gax.WithTimeout(60000 * time.Millisecond), gax.WithRetry(func() gax.Retryer { return gax.OnCodes([]codes.Code{ codes.Unavailable, }, gax.Backoff{ Initial: 1000 * time.Millisecond, Max: 10000 * time.Millisecond, Multiplier: 1.30, }) }), }, DeletePhraseMatcher: []gax.CallOption{ gax.WithTimeout(60000 * time.Millisecond), gax.WithRetry(func() gax.Retryer { return gax.OnCodes([]codes.Code{ codes.Unavailable, }, gax.Backoff{ Initial: 1000 * time.Millisecond, Max: 10000 * time.Millisecond, Multiplier: 1.30, }) }), }, UpdatePhraseMatcher: []gax.CallOption{ gax.WithTimeout(60000 * time.Millisecond), gax.WithRetry(func() gax.Retryer { return gax.OnCodes([]codes.Code{ codes.Unavailable, }, gax.Backoff{ Initial: 1000 * time.Millisecond, Max: 10000 * time.Millisecond, Multiplier: 1.30, }) }), }, CalculateStats: []gax.CallOption{ gax.WithTimeout(60000 * time.Millisecond), gax.WithRetry(func() gax.Retryer { return gax.OnCodes([]codes.Code{ codes.Unavailable, }, gax.Backoff{ Initial: 1000 * time.Millisecond, Max: 10000 * time.Millisecond, Multiplier: 1.30, }) }), }, GetSettings: []gax.CallOption{ gax.WithTimeout(60000 * time.Millisecond), gax.WithRetry(func() gax.Retryer { return gax.OnCodes([]codes.Code{ codes.Unavailable, }, gax.Backoff{ Initial: 1000 * time.Millisecond, Max: 10000 * time.Millisecond, Multiplier: 1.30, }) }), }, UpdateSettings: []gax.CallOption{ gax.WithTimeout(60000 * time.Millisecond), gax.WithRetry(func() gax.Retryer { return gax.OnCodes([]codes.Code{ codes.Unavailable, }, gax.Backoff{ Initial: 1000 * time.Millisecond, Max: 10000 * time.Millisecond, Multiplier: 1.30, }) }), }, CreateAnalysisRule: []gax.CallOption{ gax.WithTimeout(60000 * time.Millisecond), gax.WithRetry(func() gax.Retryer { return gax.OnCodes([]codes.Code{ codes.Unavailable, }, gax.Backoff{ Initial: 1000 * time.Millisecond, Max: 10000 * time.Millisecond, Multiplier: 1.30, }) }), }, GetAnalysisRule: []gax.CallOption{ gax.WithTimeout(60000 * time.Millisecond), gax.WithRetry(func() gax.Retryer { return gax.OnCodes([]codes.Code{ codes.Unavailable, }, gax.Backoff{ Initial: 1000 * time.Millisecond, Max: 10000 * time.Millisecond, Multiplier: 1.30, }) }), }, ListAnalysisRules: []gax.CallOption{ gax.WithTimeout(60000 * time.Millisecond), gax.WithRetry(func() gax.Retryer { return gax.OnCodes([]codes.Code{ codes.Unavailable, }, gax.Backoff{ Initial: 1000 * time.Millisecond, Max: 10000 * time.Millisecond, Multiplier: 1.30, }) }), }, UpdateAnalysisRule: []gax.CallOption{ gax.WithTimeout(60000 * time.Millisecond), gax.WithRetry(func() gax.Retryer { return gax.OnCodes([]codes.Code{ codes.Unavailable, }, gax.Backoff{ Initial: 1000 * time.Millisecond, Max: 10000 * time.Millisecond, Multiplier: 1.30, }) }), }, DeleteAnalysisRule: []gax.CallOption{ gax.WithTimeout(60000 * time.Millisecond), gax.WithRetry(func() gax.Retryer { return gax.OnCodes([]codes.Code{ codes.Unavailable, }, gax.Backoff{ Initial: 1000 * time.Millisecond, Max: 10000 * time.Millisecond, Multiplier: 1.30, }) }), }, GetEncryptionSpec: []gax.CallOption{ gax.WithTimeout(60000 * time.Millisecond), gax.WithRetry(func() gax.Retryer { return gax.OnCodes([]codes.Code{ codes.Unavailable, }, gax.Backoff{ Initial: 1000 * time.Millisecond, Max: 10000 * time.Millisecond, Multiplier: 1.30, }) }), }, InitializeEncryptionSpec: []gax.CallOption{ gax.WithTimeout(60000 * time.Millisecond), gax.WithRetry(func() gax.Retryer { return gax.OnCodes([]codes.Code{ codes.Unavailable, }, gax.Backoff{ Initial: 1000 * time.Millisecond, Max: 10000 * time.Millisecond, Multiplier: 1.30, }) }), }, CreateView: []gax.CallOption{ gax.WithTimeout(60000 * time.Millisecond), gax.WithRetry(func() gax.Retryer { return gax.OnCodes([]codes.Code{ codes.Unavailable, }, gax.Backoff{ Initial: 1000 * time.Millisecond, Max: 10000 * time.Millisecond, Multiplier: 1.30, }) }), }, GetView: []gax.CallOption{ gax.WithTimeout(60000 * time.Millisecond), gax.WithRetry(func() gax.Retryer { return gax.OnCodes([]codes.Code{ codes.Unavailable, }, gax.Backoff{ Initial: 1000 * time.Millisecond, Max: 10000 * time.Millisecond, Multiplier: 1.30, }) }), }, ListViews: []gax.CallOption{ gax.WithTimeout(60000 * time.Millisecond), gax.WithRetry(func() gax.Retryer { return gax.OnCodes([]codes.Code{ codes.Unavailable, }, gax.Backoff{ Initial: 1000 * time.Millisecond, Max: 10000 * time.Millisecond, Multiplier: 1.30, }) }), }, UpdateView: []gax.CallOption{ gax.WithTimeout(60000 * time.Millisecond), gax.WithRetry(func() gax.Retryer { return gax.OnCodes([]codes.Code{ codes.Unavailable, }, gax.Backoff{ Initial: 1000 * time.Millisecond, Max: 10000 * time.Millisecond, Multiplier: 1.30, }) }), }, DeleteView: []gax.CallOption{ gax.WithTimeout(60000 * time.Millisecond), gax.WithRetry(func() gax.Retryer { return gax.OnCodes([]codes.Code{ codes.Unavailable, }, gax.Backoff{ Initial: 1000 * time.Millisecond, Max: 10000 * time.Millisecond, Multiplier: 1.30, }) }), }, QueryMetrics: []gax.CallOption{ gax.WithTimeout(60000 * time.Millisecond), gax.WithRetry(func() gax.Retryer { return gax.OnCodes([]codes.Code{ codes.Unavailable, }, gax.Backoff{ Initial: 1000 * time.Millisecond, Max: 10000 * time.Millisecond, Multiplier: 1.30, }) }), }, CreateQaQuestion: []gax.CallOption{ gax.WithTimeout(60000 * time.Millisecond), gax.WithRetry(func() gax.Retryer { return gax.OnCodes([]codes.Code{ codes.Unavailable, }, gax.Backoff{ Initial: 1000 * time.Millisecond, Max: 10000 * time.Millisecond, Multiplier: 1.30, }) }), }, GetQaQuestion: []gax.CallOption{ gax.WithTimeout(60000 * time.Millisecond), gax.WithRetry(func() gax.Retryer { return gax.OnCodes([]codes.Code{ codes.Unavailable, }, gax.Backoff{ Initial: 1000 * time.Millisecond, Max: 10000 * time.Millisecond, Multiplier: 1.30, }) }), }, UpdateQaQuestion: []gax.CallOption{ gax.WithTimeout(60000 * time.Millisecond), gax.WithRetry(func() gax.Retryer { return gax.OnCodes([]codes.Code{ codes.Unavailable, }, gax.Backoff{ Initial: 1000 * time.Millisecond, Max: 10000 * time.Millisecond, Multiplier: 1.30, }) }), }, DeleteQaQuestion: []gax.CallOption{ gax.WithTimeout(60000 * time.Millisecond), gax.WithRetry(func() gax.Retryer { return gax.OnCodes([]codes.Code{ codes.Unavailable, }, gax.Backoff{ Initial: 1000 * time.Millisecond, Max: 10000 * time.Millisecond, Multiplier: 1.30, }) }), }, ListQaQuestions: []gax.CallOption{ gax.WithTimeout(60000 * time.Millisecond), gax.WithRetry(func() gax.Retryer { return gax.OnCodes([]codes.Code{ codes.Unavailable, }, gax.Backoff{ Initial: 1000 * time.Millisecond, Max: 10000 * time.Millisecond, Multiplier: 1.30, }) }), }, CreateQaScorecard: []gax.CallOption{ gax.WithTimeout(60000 * time.Millisecond), gax.WithRetry(func() gax.Retryer { return gax.OnCodes([]codes.Code{ codes.Unavailable, }, gax.Backoff{ Initial: 1000 * time.Millisecond, Max: 10000 * time.Millisecond, Multiplier: 1.30, }) }), }, GetQaScorecard: []gax.CallOption{ gax.WithTimeout(60000 * time.Millisecond), gax.WithRetry(func() gax.Retryer { return gax.OnCodes([]codes.Code{ codes.Unavailable, }, gax.Backoff{ Initial: 1000 * time.Millisecond, Max: 10000 * time.Millisecond, Multiplier: 1.30, }) }), }, UpdateQaScorecard: []gax.CallOption{ gax.WithTimeout(60000 * time.Millisecond), gax.WithRetry(func() gax.Retryer { return gax.OnCodes([]codes.Code{ codes.Unavailable, }, gax.Backoff{ Initial: 1000 * time.Millisecond, Max: 10000 * time.Millisecond, Multiplier: 1.30, }) }), }, DeleteQaScorecard: []gax.CallOption{ gax.WithTimeout(60000 * time.Millisecond), gax.WithRetry(func() gax.Retryer { return gax.OnCodes([]codes.Code{ codes.Unavailable, }, gax.Backoff{ Initial: 1000 * time.Millisecond, Max: 10000 * time.Millisecond, Multiplier: 1.30, }) }), }, ListQaScorecards: []gax.CallOption{ gax.WithTimeout(60000 * time.Millisecond), gax.WithRetry(func() gax.Retryer { return gax.OnCodes([]codes.Code{ codes.Unavailable, }, gax.Backoff{ Initial: 1000 * time.Millisecond, Max: 10000 * time.Millisecond, Multiplier: 1.30, }) }), }, CreateQaScorecardRevision: []gax.CallOption{ gax.WithTimeout(60000 * time.Millisecond), gax.WithRetry(func() gax.Retryer { return gax.OnCodes([]codes.Code{ codes.Unavailable, }, gax.Backoff{ Initial: 1000 * time.Millisecond, Max: 10000 * time.Millisecond, Multiplier: 1.30, }) }), }, GetQaScorecardRevision: []gax.CallOption{ gax.WithTimeout(60000 * time.Millisecond), gax.WithRetry(func() gax.Retryer { return gax.OnCodes([]codes.Code{ codes.Unavailable, }, gax.Backoff{ Initial: 1000 * time.Millisecond, Max: 10000 * time.Millisecond, Multiplier: 1.30, }) }), }, TuneQaScorecardRevision: []gax.CallOption{ gax.WithTimeout(60000 * time.Millisecond), gax.WithRetry(func() gax.Retryer { return gax.OnCodes([]codes.Code{ codes.Unavailable, }, gax.Backoff{ Initial: 1000 * time.Millisecond, Max: 10000 * time.Millisecond, Multiplier: 1.30, }) }), }, DeployQaScorecardRevision: []gax.CallOption{ gax.WithTimeout(60000 * time.Millisecond), gax.WithRetry(func() gax.Retryer { return gax.OnCodes([]codes.Code{ codes.Unavailable, }, gax.Backoff{ Initial: 1000 * time.Millisecond, Max: 10000 * time.Millisecond, Multiplier: 1.30, }) }), }, UndeployQaScorecardRevision: []gax.CallOption{ gax.WithTimeout(60000 * time.Millisecond), gax.WithRetry(func() gax.Retryer { return gax.OnCodes([]codes.Code{ codes.Unavailable, }, gax.Backoff{ Initial: 1000 * time.Millisecond, Max: 10000 * time.Millisecond, Multiplier: 1.30, }) }), }, DeleteQaScorecardRevision: []gax.CallOption{ gax.WithTimeout(60000 * time.Millisecond), gax.WithRetry(func() gax.Retryer { return gax.OnCodes([]codes.Code{ codes.Unavailable, }, gax.Backoff{ Initial: 1000 * time.Millisecond, Max: 10000 * time.Millisecond, Multiplier: 1.30, }) }), }, ListQaScorecardRevisions: []gax.CallOption{ gax.WithTimeout(60000 * time.Millisecond), gax.WithRetry(func() gax.Retryer { return gax.OnCodes([]codes.Code{ codes.Unavailable, }, gax.Backoff{ Initial: 1000 * time.Millisecond, Max: 10000 * time.Millisecond, Multiplier: 1.30, }) }), }, CreateFeedbackLabel: []gax.CallOption{ gax.WithTimeout(60000 * time.Millisecond), gax.WithRetry(func() gax.Retryer { return gax.OnCodes([]codes.Code{ codes.Unavailable, }, gax.Backoff{ Initial: 1000 * time.Millisecond, Max: 10000 * time.Millisecond, Multiplier: 1.30, }) }), }, ListFeedbackLabels: []gax.CallOption{ gax.WithTimeout(60000 * time.Millisecond), gax.WithRetry(func() gax.Retryer { return gax.OnCodes([]codes.Code{ codes.Unavailable, }, gax.Backoff{ Initial: 1000 * time.Millisecond, Max: 10000 * time.Millisecond, Multiplier: 1.30, }) }), }, GetFeedbackLabel: []gax.CallOption{ gax.WithTimeout(60000 * time.Millisecond), gax.WithRetry(func() gax.Retryer { return gax.OnCodes([]codes.Code{ codes.Unavailable, }, gax.Backoff{ Initial: 1000 * time.Millisecond, Max: 10000 * time.Millisecond, Multiplier: 1.30, }) }), }, UpdateFeedbackLabel: []gax.CallOption{ gax.WithTimeout(60000 * time.Millisecond), gax.WithRetry(func() gax.Retryer { return gax.OnCodes([]codes.Code{ codes.Unavailable, }, gax.Backoff{ Initial: 1000 * time.Millisecond, Max: 10000 * time.Millisecond, Multiplier: 1.30, }) }), }, DeleteFeedbackLabel: []gax.CallOption{ gax.WithTimeout(60000 * time.Millisecond), gax.WithRetry(func() gax.Retryer { return gax.OnCodes([]codes.Code{ codes.Unavailable, }, gax.Backoff{ Initial: 1000 * time.Millisecond, Max: 10000 * time.Millisecond, Multiplier: 1.30, }) }), }, ListAllFeedbackLabels: []gax.CallOption{ gax.WithTimeout(60000 * time.Millisecond), gax.WithRetry(func() gax.Retryer { return gax.OnCodes([]codes.Code{ codes.Unavailable, }, gax.Backoff{ Initial: 1000 * time.Millisecond, Max: 10000 * time.Millisecond, Multiplier: 1.30, }) }), }, BulkUploadFeedbackLabels: []gax.CallOption{ gax.WithTimeout(60000 * time.Millisecond), gax.WithRetry(func() gax.Retryer { return gax.OnCodes([]codes.Code{ codes.Unavailable, }, gax.Backoff{ Initial: 1000 * time.Millisecond, Max: 10000 * time.Millisecond, Multiplier: 1.30, }) }), }, BulkDownloadFeedbackLabels: []gax.CallOption{ gax.WithTimeout(60000 * time.Millisecond), gax.WithRetry(func() gax.Retryer { return gax.OnCodes([]codes.Code{ codes.Unavailable, }, gax.Backoff{ Initial: 1000 * time.Millisecond, Max: 10000 * time.Millisecond, Multiplier: 1.30, }) }), }, CancelOperation: []gax.CallOption{ gax.WithTimeout(60000 * time.Millisecond), gax.WithRetry(func() gax.Retryer { return gax.OnCodes([]codes.Code{ codes.Unavailable, }, gax.Backoff{ Initial: 1000 * time.Millisecond, Max: 10000 * time.Millisecond, Multiplier: 1.30, }) }), }, GetOperation: []gax.CallOption{ gax.WithTimeout(60000 * time.Millisecond), gax.WithRetry(func() gax.Retryer { return gax.OnCodes([]codes.Code{ codes.Unavailable, }, gax.Backoff{ Initial: 1000 * time.Millisecond, Max: 10000 * time.Millisecond, Multiplier: 1.30, }) }), }, ListOperations: []gax.CallOption{ gax.WithTimeout(60000 * time.Millisecond), gax.WithRetry(func() gax.Retryer { return gax.OnCodes([]codes.Code{ codes.Unavailable, }, gax.Backoff{ Initial: 1000 * time.Millisecond, Max: 10000 * time.Millisecond, Multiplier: 1.30, }) }), }, } } func defaultRESTCallOptions() *CallOptions { return &CallOptions{ CreateConversation: []gax.CallOption{ gax.WithTimeout(60000 * time.Millisecond), gax.WithRetry(func() gax.Retryer { return gax.OnHTTPCodes(gax.Backoff{ Initial: 1000 * time.Millisecond, Max: 10000 * time.Millisecond, Multiplier: 1.30, }, http.StatusServiceUnavailable) }), }, UploadConversation: []gax.CallOption{ gax.WithTimeout(60000 * time.Millisecond), gax.WithRetry(func() gax.Retryer { return gax.OnHTTPCodes(gax.Backoff{ Initial: 1000 * time.Millisecond, Max: 10000 * time.Millisecond, Multiplier: 1.30, }, http.StatusServiceUnavailable) }), }, UpdateConversation: []gax.CallOption{ gax.WithTimeout(60000 * time.Millisecond), gax.WithRetry(func() gax.Retryer { return gax.OnHTTPCodes(gax.Backoff{ Initial: 1000 * time.Millisecond, Max: 10000 * time.Millisecond, Multiplier: 1.30, }, http.StatusServiceUnavailable) }), }, GetConversation: []gax.CallOption{ gax.WithTimeout(60000 * time.Millisecond), gax.WithRetry(func() gax.Retryer { return gax.OnHTTPCodes(gax.Backoff{ Initial: 1000 * time.Millisecond, Max: 10000 * time.Millisecond, Multiplier: 1.30, }, http.StatusServiceUnavailable) }), }, ListConversations: []gax.CallOption{ gax.WithTimeout(60000 * time.Millisecond), gax.WithRetry(func() gax.Retryer { return gax.OnHTTPCodes(gax.Backoff{ Initial: 1000 * time.Millisecond, Max: 10000 * time.Millisecond, Multiplier: 1.30, }, http.StatusServiceUnavailable) }), }, DeleteConversation: []gax.CallOption{ gax.WithTimeout(60000 * time.Millisecond), gax.WithRetry(func() gax.Retryer { return gax.OnHTTPCodes(gax.Backoff{ Initial: 1000 * time.Millisecond, Max: 10000 * time.Millisecond, Multiplier: 1.30, }, http.StatusServiceUnavailable) }), }, CreateAnalysis: []gax.CallOption{ gax.WithTimeout(60000 * time.Millisecond), gax.WithRetry(func() gax.Retryer { return gax.OnHTTPCodes(gax.Backoff{ Initial: 1000 * time.Millisecond, Max: 10000 * time.Millisecond, Multiplier: 1.30, }, http.StatusServiceUnavailable) }), }, GetAnalysis: []gax.CallOption{ gax.WithTimeout(60000 * time.Millisecond), gax.WithRetry(func() gax.Retryer { return gax.OnHTTPCodes(gax.Backoff{ Initial: 1000 * time.Millisecond, Max: 10000 * time.Millisecond, Multiplier: 1.30, }, http.StatusServiceUnavailable) }), }, ListAnalyses: []gax.CallOption{ gax.WithTimeout(60000 * time.Millisecond), gax.WithRetry(func() gax.Retryer { return gax.OnHTTPCodes(gax.Backoff{ Initial: 1000 * time.Millisecond, Max: 10000 * time.Millisecond, Multiplier: 1.30, }, http.StatusServiceUnavailable) }), }, DeleteAnalysis: []gax.CallOption{ gax.WithTimeout(60000 * time.Millisecond), gax.WithRetry(func() gax.Retryer { return gax.OnHTTPCodes(gax.Backoff{ Initial: 1000 * time.Millisecond, Max: 10000 * time.Millisecond, Multiplier: 1.30, }, http.StatusServiceUnavailable) }), }, BulkAnalyzeConversations: []gax.CallOption{ gax.WithTimeout(60000 * time.Millisecond), gax.WithRetry(func() gax.Retryer { return gax.OnHTTPCodes(gax.Backoff{ Initial: 1000 * time.Millisecond, Max: 10000 * time.Millisecond, Multiplier: 1.30, }, http.StatusServiceUnavailable) }), }, BulkDeleteConversations: []gax.CallOption{ gax.WithTimeout(60000 * time.Millisecond), gax.WithRetry(func() gax.Retryer { return gax.OnHTTPCodes(gax.Backoff{ Initial: 1000 * time.Millisecond, Max: 10000 * time.Millisecond, Multiplier: 1.30, }, http.StatusServiceUnavailable) }), }, IngestConversations: []gax.CallOption{ gax.WithTimeout(60000 * time.Millisecond), gax.WithRetry(func() gax.Retryer { return gax.OnHTTPCodes(gax.Backoff{ Initial: 1000 * time.Millisecond, Max: 10000 * time.Millisecond, Multiplier: 1.30, }, http.StatusServiceUnavailable) }), }, ExportInsightsData: []gax.CallOption{ gax.WithTimeout(60000 * time.Millisecond), gax.WithRetry(func() gax.Retryer { return gax.OnHTTPCodes(gax.Backoff{ Initial: 1000 * time.Millisecond, Max: 10000 * time.Millisecond, Multiplier: 1.30, }, http.StatusServiceUnavailable) }), }, CreateIssueModel: []gax.CallOption{ gax.WithTimeout(60000 * time.Millisecond), gax.WithRetry(func() gax.Retryer { return gax.OnHTTPCodes(gax.Backoff{ Initial: 1000 * time.Millisecond, Max: 10000 * time.Millisecond, Multiplier: 1.30, }, http.StatusServiceUnavailable) }), }, UpdateIssueModel: []gax.CallOption{ gax.WithTimeout(60000 * time.Millisecond), gax.WithRetry(func() gax.Retryer { return gax.OnHTTPCodes(gax.Backoff{ Initial: 1000 * time.Millisecond, Max: 10000 * time.Millisecond, Multiplier: 1.30, }, http.StatusServiceUnavailable) }), }, GetIssueModel: []gax.CallOption{ gax.WithTimeout(60000 * time.Millisecond), gax.WithRetry(func() gax.Retryer { return gax.OnHTTPCodes(gax.Backoff{ Initial: 1000 * time.Millisecond, Max: 10000 * time.Millisecond, Multiplier: 1.30, }, http.StatusServiceUnavailable) }), }, ListIssueModels: []gax.CallOption{ gax.WithTimeout(60000 * time.Millisecond), gax.WithRetry(func() gax.Retryer { return gax.OnHTTPCodes(gax.Backoff{ Initial: 1000 * time.Millisecond, Max: 10000 * time.Millisecond, Multiplier: 1.30, }, http.StatusServiceUnavailable) }), }, DeleteIssueModel: []gax.CallOption{ gax.WithTimeout(60000 * time.Millisecond), gax.WithRetry(func() gax.Retryer { return gax.OnHTTPCodes(gax.Backoff{ Initial: 1000 * time.Millisecond, Max: 10000 * time.Millisecond, Multiplier: 1.30, }, http.StatusServiceUnavailable) }), }, DeployIssueModel: []gax.CallOption{ gax.WithTimeout(60000 * time.Millisecond), gax.WithRetry(func() gax.Retryer { return gax.OnHTTPCodes(gax.Backoff{ Initial: 1000 * time.Millisecond, Max: 10000 * time.Millisecond, Multiplier: 1.30, }, http.StatusServiceUnavailable) }), }, UndeployIssueModel: []gax.CallOption{ gax.WithTimeout(60000 * time.Millisecond), gax.WithRetry(func() gax.Retryer { return gax.OnHTTPCodes(gax.Backoff{ Initial: 1000 * time.Millisecond, Max: 10000 * time.Millisecond, Multiplier: 1.30, }, http.StatusServiceUnavailable) }), }, ExportIssueModel: []gax.CallOption{ gax.WithTimeout(60000 * time.Millisecond), gax.WithRetry(func() gax.Retryer { return gax.OnHTTPCodes(gax.Backoff{ Initial: 1000 * time.Millisecond, Max: 10000 * time.Millisecond, Multiplier: 1.30, }, http.StatusServiceUnavailable) }), }, ImportIssueModel: []gax.CallOption{ gax.WithTimeout(60000 * time.Millisecond), gax.WithRetry(func() gax.Retryer { return gax.OnHTTPCodes(gax.Backoff{ Initial: 1000 * time.Millisecond, Max: 10000 * time.Millisecond, Multiplier: 1.30, }, http.StatusServiceUnavailable) }), }, GetIssue: []gax.CallOption{ gax.WithTimeout(60000 * time.Millisecond), gax.WithRetry(func() gax.Retryer { return gax.OnHTTPCodes(gax.Backoff{ Initial: 1000 * time.Millisecond, Max: 10000 * time.Millisecond, Multiplier: 1.30, }, http.StatusServiceUnavailable) }), }, ListIssues: []gax.CallOption{ gax.WithTimeout(60000 * time.Millisecond), gax.WithRetry(func() gax.Retryer { return gax.OnHTTPCodes(gax.Backoff{ Initial: 1000 * time.Millisecond, Max: 10000 * time.Millisecond, Multiplier: 1.30, }, http.StatusServiceUnavailable) }), }, UpdateIssue: []gax.CallOption{ gax.WithTimeout(60000 * time.Millisecond), gax.WithRetry(func() gax.Retryer { return gax.OnHTTPCodes(gax.Backoff{ Initial: 1000 * time.Millisecond, Max: 10000 * time.Millisecond, Multiplier: 1.30, }, http.StatusServiceUnavailable) }), }, DeleteIssue: []gax.CallOption{ gax.WithTimeout(60000 * time.Millisecond), gax.WithRetry(func() gax.Retryer { return gax.OnHTTPCodes(gax.Backoff{ Initial: 1000 * time.Millisecond, Max: 10000 * time.Millisecond, Multiplier: 1.30, }, http.StatusServiceUnavailable) }), }, CalculateIssueModelStats: []gax.CallOption{ gax.WithTimeout(60000 * time.Millisecond), gax.WithRetry(func() gax.Retryer { return gax.OnHTTPCodes(gax.Backoff{ Initial: 1000 * time.Millisecond, Max: 10000 * time.Millisecond, Multiplier: 1.30, }, http.StatusServiceUnavailable) }), }, CreatePhraseMatcher: []gax.CallOption{ gax.WithTimeout(60000 * time.Millisecond), gax.WithRetry(func() gax.Retryer { return gax.OnHTTPCodes(gax.Backoff{ Initial: 1000 * time.Millisecond, Max: 10000 * time.Millisecond, Multiplier: 1.30, }, http.StatusServiceUnavailable) }), }, GetPhraseMatcher: []gax.CallOption{ gax.WithTimeout(60000 * time.Millisecond), gax.WithRetry(func() gax.Retryer { return gax.OnHTTPCodes(gax.Backoff{ Initial: 1000 * time.Millisecond, Max: 10000 * time.Millisecond, Multiplier: 1.30, }, http.StatusServiceUnavailable) }), }, ListPhraseMatchers: []gax.CallOption{ gax.WithTimeout(60000 * time.Millisecond), gax.WithRetry(func() gax.Retryer { return gax.OnHTTPCodes(gax.Backoff{ Initial: 1000 * time.Millisecond, Max: 10000 * time.Millisecond, Multiplier: 1.30, }, http.StatusServiceUnavailable) }), }, DeletePhraseMatcher: []gax.CallOption{ gax.WithTimeout(60000 * time.Millisecond), gax.WithRetry(func() gax.Retryer { return gax.OnHTTPCodes(gax.Backoff{ Initial: 1000 * time.Millisecond, Max: 10000 * time.Millisecond, Multiplier: 1.30, }, http.StatusServiceUnavailable) }), }, UpdatePhraseMatcher: []gax.CallOption{ gax.WithTimeout(60000 * time.Millisecond), gax.WithRetry(func() gax.Retryer { return gax.OnHTTPCodes(gax.Backoff{ Initial: 1000 * time.Millisecond, Max: 10000 * time.Millisecond, Multiplier: 1.30, }, http.StatusServiceUnavailable) }), }, CalculateStats: []gax.CallOption{ gax.WithTimeout(60000 * time.Millisecond), gax.WithRetry(func() gax.Retryer { return gax.OnHTTPCodes(gax.Backoff{ Initial: 1000 * time.Millisecond, Max: 10000 * time.Millisecond, Multiplier: 1.30, }, http.StatusServiceUnavailable) }), }, GetSettings: []gax.CallOption{ gax.WithTimeout(60000 * time.Millisecond), gax.WithRetry(func() gax.Retryer { return gax.OnHTTPCodes(gax.Backoff{ Initial: 1000 * time.Millisecond, Max: 10000 * time.Millisecond, Multiplier: 1.30, }, http.StatusServiceUnavailable) }), }, UpdateSettings: []gax.CallOption{ gax.WithTimeout(60000 * time.Millisecond), gax.WithRetry(func() gax.Retryer { return gax.OnHTTPCodes(gax.Backoff{ Initial: 1000 * time.Millisecond, Max: 10000 * time.Millisecond, Multiplier: 1.30, }, http.StatusServiceUnavailable) }), }, CreateAnalysisRule: []gax.CallOption{ gax.WithTimeout(60000 * time.Millisecond), gax.WithRetry(func() gax.Retryer { return gax.OnHTTPCodes(gax.Backoff{ Initial: 1000 * time.Millisecond, Max: 10000 * time.Millisecond, Multiplier: 1.30, }, http.StatusServiceUnavailable) }), }, GetAnalysisRule: []gax.CallOption{ gax.WithTimeout(60000 * time.Millisecond), gax.WithRetry(func() gax.Retryer { return gax.OnHTTPCodes(gax.Backoff{ Initial: 1000 * time.Millisecond, Max: 10000 * time.Millisecond, Multiplier: 1.30, }, http.StatusServiceUnavailable) }), }, ListAnalysisRules: []gax.CallOption{ gax.WithTimeout(60000 * time.Millisecond), gax.WithRetry(func() gax.Retryer { return gax.OnHTTPCodes(gax.Backoff{ Initial: 1000 * time.Millisecond, Max: 10000 * time.Millisecond, Multiplier: 1.30, }, http.StatusServiceUnavailable) }), }, UpdateAnalysisRule: []gax.CallOption{ gax.WithTimeout(60000 * time.Millisecond), gax.WithRetry(func() gax.Retryer { return gax.OnHTTPCodes(gax.Backoff{ Initial: 1000 * time.Millisecond, Max: 10000 * time.Millisecond, Multiplier: 1.30, }, http.StatusServiceUnavailable) }), }, DeleteAnalysisRule: []gax.CallOption{ gax.WithTimeout(60000 * time.Millisecond), gax.WithRetry(func() gax.Retryer { return gax.OnHTTPCodes(gax.Backoff{ Initial: 1000 * time.Millisecond, Max: 10000 * time.Millisecond, Multiplier: 1.30, }, http.StatusServiceUnavailable) }), }, GetEncryptionSpec: []gax.CallOption{ gax.WithTimeout(60000 * time.Millisecond), gax.WithRetry(func() gax.Retryer { return gax.OnHTTPCodes(gax.Backoff{ Initial: 1000 * time.Millisecond, Max: 10000 * time.Millisecond, Multiplier: 1.30, }, http.StatusServiceUnavailable) }), }, InitializeEncryptionSpec: []gax.CallOption{ gax.WithTimeout(60000 * time.Millisecond), gax.WithRetry(func() gax.Retryer { return gax.OnHTTPCodes(gax.Backoff{ Initial: 1000 * time.Millisecond, Max: 10000 * time.Millisecond, Multiplier: 1.30, }, http.StatusServiceUnavailable) }), }, CreateView: []gax.CallOption{ gax.WithTimeout(60000 * time.Millisecond), gax.WithRetry(func() gax.Retryer { return gax.OnHTTPCodes(gax.Backoff{ Initial: 1000 * time.Millisecond, Max: 10000 * time.Millisecond, Multiplier: 1.30, }, http.StatusServiceUnavailable) }), }, GetView: []gax.CallOption{ gax.WithTimeout(60000 * time.Millisecond), gax.WithRetry(func() gax.Retryer { return gax.OnHTTPCodes(gax.Backoff{ Initial: 1000 * time.Millisecond, Max: 10000 * time.Millisecond, Multiplier: 1.30, }, http.StatusServiceUnavailable) }), }, ListViews: []gax.CallOption{ gax.WithTimeout(60000 * time.Millisecond), gax.WithRetry(func() gax.Retryer { return gax.OnHTTPCodes(gax.Backoff{ Initial: 1000 * time.Millisecond, Max: 10000 * time.Millisecond, Multiplier: 1.30, }, http.StatusServiceUnavailable) }), }, UpdateView: []gax.CallOption{ gax.WithTimeout(60000 * time.Millisecond), gax.WithRetry(func() gax.Retryer { return gax.OnHTTPCodes(gax.Backoff{ Initial: 1000 * time.Millisecond, Max: 10000 * time.Millisecond, Multiplier: 1.30, }, http.StatusServiceUnavailable) }), }, DeleteView: []gax.CallOption{ gax.WithTimeout(60000 * time.Millisecond), gax.WithRetry(func() gax.Retryer { return gax.OnHTTPCodes(gax.Backoff{ Initial: 1000 * time.Millisecond, Max: 10000 * time.Millisecond, Multiplier: 1.30, }, http.StatusServiceUnavailable) }), }, QueryMetrics: []gax.CallOption{ gax.WithTimeout(60000 * time.Millisecond), gax.WithRetry(func() gax.Retryer { return gax.OnHTTPCodes(gax.Backoff{ Initial: 1000 * time.Millisecond, Max: 10000 * time.Millisecond, Multiplier: 1.30, }, http.StatusServiceUnavailable) }), }, CreateQaQuestion: []gax.CallOption{ gax.WithTimeout(60000 * time.Millisecond), gax.WithRetry(func() gax.Retryer { return gax.OnHTTPCodes(gax.Backoff{ Initial: 1000 * time.Millisecond, Max: 10000 * time.Millisecond, Multiplier: 1.30, }, http.StatusServiceUnavailable) }), }, GetQaQuestion: []gax.CallOption{ gax.WithTimeout(60000 * time.Millisecond), gax.WithRetry(func() gax.Retryer { return gax.OnHTTPCodes(gax.Backoff{ Initial: 1000 * time.Millisecond, Max: 10000 * time.Millisecond, Multiplier: 1.30, }, http.StatusServiceUnavailable) }), }, UpdateQaQuestion: []gax.CallOption{ gax.WithTimeout(60000 * time.Millisecond), gax.WithRetry(func() gax.Retryer { return gax.OnHTTPCodes(gax.Backoff{ Initial: 1000 * time.Millisecond, Max: 10000 * time.Millisecond, Multiplier: 1.30, }, http.StatusServiceUnavailable) }), }, DeleteQaQuestion: []gax.CallOption{ gax.WithTimeout(60000 * time.Millisecond), gax.WithRetry(func() gax.Retryer { return gax.OnHTTPCodes(gax.Backoff{ Initial: 1000 * time.Millisecond, Max: 10000 * time.Millisecond, Multiplier: 1.30, }, http.StatusServiceUnavailable) }), }, ListQaQuestions: []gax.CallOption{ gax.WithTimeout(60000 * time.Millisecond), gax.WithRetry(func() gax.Retryer { return gax.OnHTTPCodes(gax.Backoff{ Initial: 1000 * time.Millisecond, Max: 10000 * time.Millisecond, Multiplier: 1.30, }, http.StatusServiceUnavailable) }), }, CreateQaScorecard: []gax.CallOption{ gax.WithTimeout(60000 * time.Millisecond), gax.WithRetry(func() gax.Retryer { return gax.OnHTTPCodes(gax.Backoff{ Initial: 1000 * time.Millisecond, Max: 10000 * time.Millisecond, Multiplier: 1.30, }, http.StatusServiceUnavailable) }), }, GetQaScorecard: []gax.CallOption{ gax.WithTimeout(60000 * time.Millisecond), gax.WithRetry(func() gax.Retryer { return gax.OnHTTPCodes(gax.Backoff{ Initial: 1000 * time.Millisecond, Max: 10000 * time.Millisecond, Multiplier: 1.30, }, http.StatusServiceUnavailable) }), }, UpdateQaScorecard: []gax.CallOption{ gax.WithTimeout(60000 * time.Millisecond), gax.WithRetry(func() gax.Retryer { return gax.OnHTTPCodes(gax.Backoff{ Initial: 1000 * time.Millisecond, Max: 10000 * time.Millisecond, Multiplier: 1.30, }, http.StatusServiceUnavailable) }), }, DeleteQaScorecard: []gax.CallOption{ gax.WithTimeout(60000 * time.Millisecond), gax.WithRetry(func() gax.Retryer { return gax.OnHTTPCodes(gax.Backoff{ Initial: 1000 * time.Millisecond, Max: 10000 * time.Millisecond, Multiplier: 1.30, }, http.StatusServiceUnavailable) }), }, ListQaScorecards: []gax.CallOption{ gax.WithTimeout(60000 * time.Millisecond), gax.WithRetry(func() gax.Retryer { return gax.OnHTTPCodes(gax.Backoff{ Initial: 1000 * time.Millisecond, Max: 10000 * time.Millisecond, Multiplier: 1.30, }, http.StatusServiceUnavailable) }), }, CreateQaScorecardRevision: []gax.CallOption{ gax.WithTimeout(60000 * time.Millisecond), gax.WithRetry(func() gax.Retryer { return gax.OnHTTPCodes(gax.Backoff{ Initial: 1000 * time.Millisecond, Max: 10000 * time.Millisecond, Multiplier: 1.30, }, http.StatusServiceUnavailable) }), }, GetQaScorecardRevision: []gax.CallOption{ gax.WithTimeout(60000 * time.Millisecond), gax.WithRetry(func() gax.Retryer { return gax.OnHTTPCodes(gax.Backoff{ Initial: 1000 * time.Millisecond, Max: 10000 * time.Millisecond, Multiplier: 1.30, }, http.StatusServiceUnavailable) }), }, TuneQaScorecardRevision: []gax.CallOption{ gax.WithTimeout(60000 * time.Millisecond), gax.WithRetry(func() gax.Retryer { return gax.OnHTTPCodes(gax.Backoff{ Initial: 1000 * time.Millisecond, Max: 10000 * time.Millisecond, Multiplier: 1.30, }, http.StatusServiceUnavailable) }), }, DeployQaScorecardRevision: []gax.CallOption{ gax.WithTimeout(60000 * time.Millisecond), gax.WithRetry(func() gax.Retryer { return gax.OnHTTPCodes(gax.Backoff{ Initial: 1000 * time.Millisecond, Max: 10000 * time.Millisecond, Multiplier: 1.30, }, http.StatusServiceUnavailable) }), }, UndeployQaScorecardRevision: []gax.CallOption{ gax.WithTimeout(60000 * time.Millisecond), gax.WithRetry(func() gax.Retryer { return gax.OnHTTPCodes(gax.Backoff{ Initial: 1000 * time.Millisecond, Max: 10000 * time.Millisecond, Multiplier: 1.30, }, http.StatusServiceUnavailable) }), }, DeleteQaScorecardRevision: []gax.CallOption{ gax.WithTimeout(60000 * time.Millisecond), gax.WithRetry(func() gax.Retryer { return gax.OnHTTPCodes(gax.Backoff{ Initial: 1000 * time.Millisecond, Max: 10000 * time.Millisecond, Multiplier: 1.30, }, http.StatusServiceUnavailable) }), }, ListQaScorecardRevisions: []gax.CallOption{ gax.WithTimeout(60000 * time.Millisecond), gax.WithRetry(func() gax.Retryer { return gax.OnHTTPCodes(gax.Backoff{ Initial: 1000 * time.Millisecond, Max: 10000 * time.Millisecond, Multiplier: 1.30, }, http.StatusServiceUnavailable) }), }, CreateFeedbackLabel: []gax.CallOption{ gax.WithTimeout(60000 * time.Millisecond), gax.WithRetry(func() gax.Retryer { return gax.OnHTTPCodes(gax.Backoff{ Initial: 1000 * time.Millisecond, Max: 10000 * time.Millisecond, Multiplier: 1.30, }, http.StatusServiceUnavailable) }), }, ListFeedbackLabels: []gax.CallOption{ gax.WithTimeout(60000 * time.Millisecond), gax.WithRetry(func() gax.Retryer { return gax.OnHTTPCodes(gax.Backoff{ Initial: 1000 * time.Millisecond, Max: 10000 * time.Millisecond, Multiplier: 1.30, }, http.StatusServiceUnavailable) }), }, GetFeedbackLabel: []gax.CallOption{ gax.WithTimeout(60000 * time.Millisecond), gax.WithRetry(func() gax.Retryer { return gax.OnHTTPCodes(gax.Backoff{ Initial: 1000 * time.Millisecond, Max: 10000 * time.Millisecond, Multiplier: 1.30, }, http.StatusServiceUnavailable) }), }, UpdateFeedbackLabel: []gax.CallOption{ gax.WithTimeout(60000 * time.Millisecond), gax.WithRetry(func() gax.Retryer { return gax.OnHTTPCodes(gax.Backoff{ Initial: 1000 * time.Millisecond, Max: 10000 * time.Millisecond, Multiplier: 1.30, }, http.StatusServiceUnavailable) }), }, DeleteFeedbackLabel: []gax.CallOption{ gax.WithTimeout(60000 * time.Millisecond), gax.WithRetry(func() gax.Retryer { return gax.OnHTTPCodes(gax.Backoff{ Initial: 1000 * time.Millisecond, Max: 10000 * time.Millisecond, Multiplier: 1.30, }, http.StatusServiceUnavailable) }), }, ListAllFeedbackLabels: []gax.CallOption{ gax.WithTimeout(60000 * time.Millisecond), gax.WithRetry(func() gax.Retryer { return gax.OnHTTPCodes(gax.Backoff{ Initial: 1000 * time.Millisecond, Max: 10000 * time.Millisecond, Multiplier: 1.30, }, http.StatusServiceUnavailable) }), }, BulkUploadFeedbackLabels: []gax.CallOption{ gax.WithTimeout(60000 * time.Millisecond), gax.WithRetry(func() gax.Retryer { return gax.OnHTTPCodes(gax.Backoff{ Initial: 1000 * time.Millisecond, Max: 10000 * time.Millisecond, Multiplier: 1.30, }, http.StatusServiceUnavailable) }), }, BulkDownloadFeedbackLabels: []gax.CallOption{ gax.WithTimeout(60000 * time.Millisecond), gax.WithRetry(func() gax.Retryer { return gax.OnHTTPCodes(gax.Backoff{ Initial: 1000 * time.Millisecond, Max: 10000 * time.Millisecond, Multiplier: 1.30, }, http.StatusServiceUnavailable) }), }, CancelOperation: []gax.CallOption{ gax.WithTimeout(60000 * time.Millisecond), gax.WithRetry(func() gax.Retryer { return gax.OnHTTPCodes(gax.Backoff{ Initial: 1000 * time.Millisecond, Max: 10000 * time.Millisecond, Multiplier: 1.30, }, http.StatusServiceUnavailable) }), }, GetOperation: []gax.CallOption{ gax.WithTimeout(60000 * time.Millisecond), gax.WithRetry(func() gax.Retryer { return gax.OnHTTPCodes(gax.Backoff{ Initial: 1000 * time.Millisecond, Max: 10000 * time.Millisecond, Multiplier: 1.30, }, http.StatusServiceUnavailable) }), }, ListOperations: []gax.CallOption{ gax.WithTimeout(60000 * time.Millisecond), gax.WithRetry(func() gax.Retryer { return gax.OnHTTPCodes(gax.Backoff{ Initial: 1000 * time.Millisecond, Max: 10000 * time.Millisecond, Multiplier: 1.30, }, http.StatusServiceUnavailable) }), }, } } // internalClient is an interface that defines the methods available from Contact Center AI Insights API. type internalClient interface { Close() error setGoogleClientInfo(...string) Connection() *grpc.ClientConn CreateConversation(context.Context, *contactcenterinsightspb.CreateConversationRequest, ...gax.CallOption) (*contactcenterinsightspb.Conversation, error) UploadConversation(context.Context, *contactcenterinsightspb.UploadConversationRequest, ...gax.CallOption) (*UploadConversationOperation, error) UploadConversationOperation(name string) *UploadConversationOperation UpdateConversation(context.Context, *contactcenterinsightspb.UpdateConversationRequest, ...gax.CallOption) (*contactcenterinsightspb.Conversation, error) GetConversation(context.Context, *contactcenterinsightspb.GetConversationRequest, ...gax.CallOption) (*contactcenterinsightspb.Conversation, error) ListConversations(context.Context, *contactcenterinsightspb.ListConversationsRequest, ...gax.CallOption) *ConversationIterator DeleteConversation(context.Context, *contactcenterinsightspb.DeleteConversationRequest, ...gax.CallOption) error CreateAnalysis(context.Context, *contactcenterinsightspb.CreateAnalysisRequest, ...gax.CallOption) (*CreateAnalysisOperation, error) CreateAnalysisOperation(name string) *CreateAnalysisOperation GetAnalysis(context.Context, *contactcenterinsightspb.GetAnalysisRequest, ...gax.CallOption) (*contactcenterinsightspb.Analysis, error) ListAnalyses(context.Context, *contactcenterinsightspb.ListAnalysesRequest, ...gax.CallOption) *AnalysisIterator DeleteAnalysis(context.Context, *contactcenterinsightspb.DeleteAnalysisRequest, ...gax.CallOption) error BulkAnalyzeConversations(context.Context, *contactcenterinsightspb.BulkAnalyzeConversationsRequest, ...gax.CallOption) (*BulkAnalyzeConversationsOperation, error) BulkAnalyzeConversationsOperation(name string) *BulkAnalyzeConversationsOperation BulkDeleteConversations(context.Context, *contactcenterinsightspb.BulkDeleteConversationsRequest, ...gax.CallOption) (*BulkDeleteConversationsOperation, error) BulkDeleteConversationsOperation(name string) *BulkDeleteConversationsOperation IngestConversations(context.Context, *contactcenterinsightspb.IngestConversationsRequest, ...gax.CallOption) (*IngestConversationsOperation, error) IngestConversationsOperation(name string) *IngestConversationsOperation ExportInsightsData(context.Context, *contactcenterinsightspb.ExportInsightsDataRequest, ...gax.CallOption) (*ExportInsightsDataOperation, error) ExportInsightsDataOperation(name string) *ExportInsightsDataOperation CreateIssueModel(context.Context, *contactcenterinsightspb.CreateIssueModelRequest, ...gax.CallOption) (*CreateIssueModelOperation, error) CreateIssueModelOperation(name string) *CreateIssueModelOperation UpdateIssueModel(context.Context, *contactcenterinsightspb.UpdateIssueModelRequest, ...gax.CallOption) (*contactcenterinsightspb.IssueModel, error) GetIssueModel(context.Context, *contactcenterinsightspb.GetIssueModelRequest, ...gax.CallOption) (*contactcenterinsightspb.IssueModel, error) ListIssueModels(context.Context, *contactcenterinsightspb.ListIssueModelsRequest, ...gax.CallOption) (*contactcenterinsightspb.ListIssueModelsResponse, error) DeleteIssueModel(context.Context, *contactcenterinsightspb.DeleteIssueModelRequest, ...gax.CallOption) (*DeleteIssueModelOperation, error) DeleteIssueModelOperation(name string) *DeleteIssueModelOperation DeployIssueModel(context.Context, *contactcenterinsightspb.DeployIssueModelRequest, ...gax.CallOption) (*DeployIssueModelOperation, error) DeployIssueModelOperation(name string) *DeployIssueModelOperation UndeployIssueModel(context.Context, *contactcenterinsightspb.UndeployIssueModelRequest, ...gax.CallOption) (*UndeployIssueModelOperation, error) UndeployIssueModelOperation(name string) *UndeployIssueModelOperation ExportIssueModel(context.Context, *contactcenterinsightspb.ExportIssueModelRequest, ...gax.CallOption) (*ExportIssueModelOperation, error) ExportIssueModelOperation(name string) *ExportIssueModelOperation ImportIssueModel(context.Context, *contactcenterinsightspb.ImportIssueModelRequest, ...gax.CallOption) (*ImportIssueModelOperation, error) ImportIssueModelOperation(name string) *ImportIssueModelOperation GetIssue(context.Context, *contactcenterinsightspb.GetIssueRequest, ...gax.CallOption) (*contactcenterinsightspb.Issue, error) ListIssues(context.Context, *contactcenterinsightspb.ListIssuesRequest, ...gax.CallOption) (*contactcenterinsightspb.ListIssuesResponse, error) UpdateIssue(context.Context, *contactcenterinsightspb.UpdateIssueRequest, ...gax.CallOption) (*contactcenterinsightspb.Issue, error) DeleteIssue(context.Context, *contactcenterinsightspb.DeleteIssueRequest, ...gax.CallOption) error CalculateIssueModelStats(context.Context, *contactcenterinsightspb.CalculateIssueModelStatsRequest, ...gax.CallOption) (*contactcenterinsightspb.CalculateIssueModelStatsResponse, error) CreatePhraseMatcher(context.Context, *contactcenterinsightspb.CreatePhraseMatcherRequest, ...gax.CallOption) (*contactcenterinsightspb.PhraseMatcher, error) GetPhraseMatcher(context.Context, *contactcenterinsightspb.GetPhraseMatcherRequest, ...gax.CallOption) (*contactcenterinsightspb.PhraseMatcher, error) ListPhraseMatchers(context.Context, *contactcenterinsightspb.ListPhraseMatchersRequest, ...gax.CallOption) *PhraseMatcherIterator DeletePhraseMatcher(context.Context, *contactcenterinsightspb.DeletePhraseMatcherRequest, ...gax.CallOption) error UpdatePhraseMatcher(context.Context, *contactcenterinsightspb.UpdatePhraseMatcherRequest, ...gax.CallOption) (*contactcenterinsightspb.PhraseMatcher, error) CalculateStats(context.Context, *contactcenterinsightspb.CalculateStatsRequest, ...gax.CallOption) (*contactcenterinsightspb.CalculateStatsResponse, error) GetSettings(context.Context, *contactcenterinsightspb.GetSettingsRequest, ...gax.CallOption) (*contactcenterinsightspb.Settings, error) UpdateSettings(context.Context, *contactcenterinsightspb.UpdateSettingsRequest, ...gax.CallOption) (*contactcenterinsightspb.Settings, error) CreateAnalysisRule(context.Context, *contactcenterinsightspb.CreateAnalysisRuleRequest, ...gax.CallOption) (*contactcenterinsightspb.AnalysisRule, error) GetAnalysisRule(context.Context, *contactcenterinsightspb.GetAnalysisRuleRequest, ...gax.CallOption) (*contactcenterinsightspb.AnalysisRule, error) ListAnalysisRules(context.Context, *contactcenterinsightspb.ListAnalysisRulesRequest, ...gax.CallOption) *AnalysisRuleIterator UpdateAnalysisRule(context.Context, *contactcenterinsightspb.UpdateAnalysisRuleRequest, ...gax.CallOption) (*contactcenterinsightspb.AnalysisRule, error) DeleteAnalysisRule(context.Context, *contactcenterinsightspb.DeleteAnalysisRuleRequest, ...gax.CallOption) error GetEncryptionSpec(context.Context, *contactcenterinsightspb.GetEncryptionSpecRequest, ...gax.CallOption) (*contactcenterinsightspb.EncryptionSpec, error) InitializeEncryptionSpec(context.Context, *contactcenterinsightspb.InitializeEncryptionSpecRequest, ...gax.CallOption) (*InitializeEncryptionSpecOperation, error) InitializeEncryptionSpecOperation(name string) *InitializeEncryptionSpecOperation CreateView(context.Context, *contactcenterinsightspb.CreateViewRequest, ...gax.CallOption) (*contactcenterinsightspb.View, error) GetView(context.Context, *contactcenterinsightspb.GetViewRequest, ...gax.CallOption) (*contactcenterinsightspb.View, error) ListViews(context.Context, *contactcenterinsightspb.ListViewsRequest, ...gax.CallOption) *ViewIterator UpdateView(context.Context, *contactcenterinsightspb.UpdateViewRequest, ...gax.CallOption) (*contactcenterinsightspb.View, error) DeleteView(context.Context, *contactcenterinsightspb.DeleteViewRequest, ...gax.CallOption) error QueryMetrics(context.Context, *contactcenterinsightspb.QueryMetricsRequest, ...gax.CallOption) (*QueryMetricsOperation, error) QueryMetricsOperation(name string) *QueryMetricsOperation CreateQaQuestion(context.Context, *contactcenterinsightspb.CreateQaQuestionRequest, ...gax.CallOption) (*contactcenterinsightspb.QaQuestion, error) GetQaQuestion(context.Context, *contactcenterinsightspb.GetQaQuestionRequest, ...gax.CallOption) (*contactcenterinsightspb.QaQuestion, error) UpdateQaQuestion(context.Context, *contactcenterinsightspb.UpdateQaQuestionRequest, ...gax.CallOption) (*contactcenterinsightspb.QaQuestion, error) DeleteQaQuestion(context.Context, *contactcenterinsightspb.DeleteQaQuestionRequest, ...gax.CallOption) error ListQaQuestions(context.Context, *contactcenterinsightspb.ListQaQuestionsRequest, ...gax.CallOption) *QaQuestionIterator CreateQaScorecard(context.Context, *contactcenterinsightspb.CreateQaScorecardRequest, ...gax.CallOption) (*contactcenterinsightspb.QaScorecard, error) GetQaScorecard(context.Context, *contactcenterinsightspb.GetQaScorecardRequest, ...gax.CallOption) (*contactcenterinsightspb.QaScorecard, error) UpdateQaScorecard(context.Context, *contactcenterinsightspb.UpdateQaScorecardRequest, ...gax.CallOption) (*contactcenterinsightspb.QaScorecard, error) DeleteQaScorecard(context.Context, *contactcenterinsightspb.DeleteQaScorecardRequest, ...gax.CallOption) error ListQaScorecards(context.Context, *contactcenterinsightspb.ListQaScorecardsRequest, ...gax.CallOption) *QaScorecardIterator CreateQaScorecardRevision(context.Context, *contactcenterinsightspb.CreateQaScorecardRevisionRequest, ...gax.CallOption) (*contactcenterinsightspb.QaScorecardRevision, error) GetQaScorecardRevision(context.Context, *contactcenterinsightspb.GetQaScorecardRevisionRequest, ...gax.CallOption) (*contactcenterinsightspb.QaScorecardRevision, error) TuneQaScorecardRevision(context.Context, *contactcenterinsightspb.TuneQaScorecardRevisionRequest, ...gax.CallOption) (*TuneQaScorecardRevisionOperation, error) TuneQaScorecardRevisionOperation(name string) *TuneQaScorecardRevisionOperation DeployQaScorecardRevision(context.Context, *contactcenterinsightspb.DeployQaScorecardRevisionRequest, ...gax.CallOption) (*contactcenterinsightspb.QaScorecardRevision, error) UndeployQaScorecardRevision(context.Context, *contactcenterinsightspb.UndeployQaScorecardRevisionRequest, ...gax.CallOption) (*contactcenterinsightspb.QaScorecardRevision, error) DeleteQaScorecardRevision(context.Context, *contactcenterinsightspb.DeleteQaScorecardRevisionRequest, ...gax.CallOption) error ListQaScorecardRevisions(context.Context, *contactcenterinsightspb.ListQaScorecardRevisionsRequest, ...gax.CallOption) *QaScorecardRevisionIterator CreateFeedbackLabel(context.Context, *contactcenterinsightspb.CreateFeedbackLabelRequest, ...gax.CallOption) (*contactcenterinsightspb.FeedbackLabel, error) ListFeedbackLabels(context.Context, *contactcenterinsightspb.ListFeedbackLabelsRequest, ...gax.CallOption) *FeedbackLabelIterator GetFeedbackLabel(context.Context, *contactcenterinsightspb.GetFeedbackLabelRequest, ...gax.CallOption) (*contactcenterinsightspb.FeedbackLabel, error) UpdateFeedbackLabel(context.Context, *contactcenterinsightspb.UpdateFeedbackLabelRequest, ...gax.CallOption) (*contactcenterinsightspb.FeedbackLabel, error) DeleteFeedbackLabel(context.Context, *contactcenterinsightspb.DeleteFeedbackLabelRequest, ...gax.CallOption) error ListAllFeedbackLabels(context.Context, *contactcenterinsightspb.ListAllFeedbackLabelsRequest, ...gax.CallOption) *FeedbackLabelIterator BulkUploadFeedbackLabels(context.Context, *contactcenterinsightspb.BulkUploadFeedbackLabelsRequest, ...gax.CallOption) (*BulkUploadFeedbackLabelsOperation, error) BulkUploadFeedbackLabelsOperation(name string) *BulkUploadFeedbackLabelsOperation BulkDownloadFeedbackLabels(context.Context, *contactcenterinsightspb.BulkDownloadFeedbackLabelsRequest, ...gax.CallOption) (*BulkDownloadFeedbackLabelsOperation, error) BulkDownloadFeedbackLabelsOperation(name string) *BulkDownloadFeedbackLabelsOperation CancelOperation(context.Context, *longrunningpb.CancelOperationRequest, ...gax.CallOption) error GetOperation(context.Context, *longrunningpb.GetOperationRequest, ...gax.CallOption) (*longrunningpb.Operation, error) ListOperations(context.Context, *longrunningpb.ListOperationsRequest, ...gax.CallOption) *OperationIterator } // Client is a client for interacting with Contact Center AI Insights API. // Methods, except Close, may be called concurrently. However, fields must not be modified concurrently with method calls. // // An API that lets users analyze and explore their business conversation data. type Client struct { // The internal transport-dependent client. internalClient internalClient // The call options for this service. CallOptions *CallOptions // LROClient is used internally to handle long-running operations. // It is exposed so that its CallOptions can be modified if required. // Users should not Close this client. LROClient *lroauto.OperationsClient } // Wrapper methods routed to the internal client. // Close closes the connection to the API service. The user should invoke this when // the client is no longer required. func (c *Client) Close() error { return c.internalClient.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 *Client) setGoogleClientInfo(keyval ...string) { c.internalClient.setGoogleClientInfo(keyval...) } // Connection returns a connection to the API service. // // Deprecated: Connections are now pooled so this method does not always // return the same resource. func (c *Client) Connection() *grpc.ClientConn { return c.internalClient.Connection() } // CreateConversation creates a conversation. // Note that this method does not support audio transcription or redaction. // Use conversations.upload instead. func (c *Client) CreateConversation(ctx context.Context, req *contactcenterinsightspb.CreateConversationRequest, opts ...gax.CallOption) (*contactcenterinsightspb.Conversation, error) { return c.internalClient.CreateConversation(ctx, req, opts...) } // UploadConversation create a long-running conversation upload operation. This method differs // from CreateConversation by allowing audio transcription and optional DLP // redaction. func (c *Client) UploadConversation(ctx context.Context, req *contactcenterinsightspb.UploadConversationRequest, opts ...gax.CallOption) (*UploadConversationOperation, error) { return c.internalClient.UploadConversation(ctx, req, opts...) } // UploadConversationOperation returns a new UploadConversationOperation from a given name. // The name must be that of a previously created UploadConversationOperation, possibly from a different process. func (c *Client) UploadConversationOperation(name string) *UploadConversationOperation { return c.internalClient.UploadConversationOperation(name) } // UpdateConversation updates a conversation. func (c *Client) UpdateConversation(ctx context.Context, req *contactcenterinsightspb.UpdateConversationRequest, opts ...gax.CallOption) (*contactcenterinsightspb.Conversation, error) { return c.internalClient.UpdateConversation(ctx, req, opts...) } // GetConversation gets a conversation. func (c *Client) GetConversation(ctx context.Context, req *contactcenterinsightspb.GetConversationRequest, opts ...gax.CallOption) (*contactcenterinsightspb.Conversation, error) { return c.internalClient.GetConversation(ctx, req, opts...) } // ListConversations lists conversations. func (c *Client) ListConversations(ctx context.Context, req *contactcenterinsightspb.ListConversationsRequest, opts ...gax.CallOption) *ConversationIterator { return c.internalClient.ListConversations(ctx, req, opts...) } // DeleteConversation deletes a conversation. func (c *Client) DeleteConversation(ctx context.Context, req *contactcenterinsightspb.DeleteConversationRequest, opts ...gax.CallOption) error { return c.internalClient.DeleteConversation(ctx, req, opts...) } // CreateAnalysis creates an analysis. The long running operation is done when the analysis // has completed. func (c *Client) CreateAnalysis(ctx context.Context, req *contactcenterinsightspb.CreateAnalysisRequest, opts ...gax.CallOption) (*CreateAnalysisOperation, error) { return c.internalClient.CreateAnalysis(ctx, req, opts...) } // CreateAnalysisOperation returns a new CreateAnalysisOperation from a given name. // The name must be that of a previously created CreateAnalysisOperation, possibly from a different process. func (c *Client) CreateAnalysisOperation(name string) *CreateAnalysisOperation { return c.internalClient.CreateAnalysisOperation(name) } // GetAnalysis gets an analysis. func (c *Client) GetAnalysis(ctx context.Context, req *contactcenterinsightspb.GetAnalysisRequest, opts ...gax.CallOption) (*contactcenterinsightspb.Analysis, error) { return c.internalClient.GetAnalysis(ctx, req, opts...) } // ListAnalyses lists analyses. func (c *Client) ListAnalyses(ctx context.Context, req *contactcenterinsightspb.ListAnalysesRequest, opts ...gax.CallOption) *AnalysisIterator { return c.internalClient.ListAnalyses(ctx, req, opts...) } // DeleteAnalysis deletes an analysis. func (c *Client) DeleteAnalysis(ctx context.Context, req *contactcenterinsightspb.DeleteAnalysisRequest, opts ...gax.CallOption) error { return c.internalClient.DeleteAnalysis(ctx, req, opts...) } // BulkAnalyzeConversations analyzes multiple conversations in a single request. func (c *Client) BulkAnalyzeConversations(ctx context.Context, req *contactcenterinsightspb.BulkAnalyzeConversationsRequest, opts ...gax.CallOption) (*BulkAnalyzeConversationsOperation, error) { return c.internalClient.BulkAnalyzeConversations(ctx, req, opts...) } // BulkAnalyzeConversationsOperation returns a new BulkAnalyzeConversationsOperation from a given name. // The name must be that of a previously created BulkAnalyzeConversationsOperation, possibly from a different process. func (c *Client) BulkAnalyzeConversationsOperation(name string) *BulkAnalyzeConversationsOperation { return c.internalClient.BulkAnalyzeConversationsOperation(name) } // BulkDeleteConversations deletes multiple conversations in a single request. func (c *Client) BulkDeleteConversations(ctx context.Context, req *contactcenterinsightspb.BulkDeleteConversationsRequest, opts ...gax.CallOption) (*BulkDeleteConversationsOperation, error) { return c.internalClient.BulkDeleteConversations(ctx, req, opts...) } // BulkDeleteConversationsOperation returns a new BulkDeleteConversationsOperation from a given name. // The name must be that of a previously created BulkDeleteConversationsOperation, possibly from a different process. func (c *Client) BulkDeleteConversationsOperation(name string) *BulkDeleteConversationsOperation { return c.internalClient.BulkDeleteConversationsOperation(name) } // IngestConversations imports conversations and processes them according to the user’s // configuration. func (c *Client) IngestConversations(ctx context.Context, req *contactcenterinsightspb.IngestConversationsRequest, opts ...gax.CallOption) (*IngestConversationsOperation, error) { return c.internalClient.IngestConversations(ctx, req, opts...) } // IngestConversationsOperation returns a new IngestConversationsOperation from a given name. // The name must be that of a previously created IngestConversationsOperation, possibly from a different process. func (c *Client) IngestConversationsOperation(name string) *IngestConversationsOperation { return c.internalClient.IngestConversationsOperation(name) } // ExportInsightsData export insights data to a destination defined in the request body. func (c *Client) ExportInsightsData(ctx context.Context, req *contactcenterinsightspb.ExportInsightsDataRequest, opts ...gax.CallOption) (*ExportInsightsDataOperation, error) { return c.internalClient.ExportInsightsData(ctx, req, opts...) } // ExportInsightsDataOperation returns a new ExportInsightsDataOperation from a given name. // The name must be that of a previously created ExportInsightsDataOperation, possibly from a different process. func (c *Client) ExportInsightsDataOperation(name string) *ExportInsightsDataOperation { return c.internalClient.ExportInsightsDataOperation(name) } // CreateIssueModel creates an issue model. func (c *Client) CreateIssueModel(ctx context.Context, req *contactcenterinsightspb.CreateIssueModelRequest, opts ...gax.CallOption) (*CreateIssueModelOperation, error) { return c.internalClient.CreateIssueModel(ctx, req, opts...) } // CreateIssueModelOperation returns a new CreateIssueModelOperation from a given name. // The name must be that of a previously created CreateIssueModelOperation, possibly from a different process. func (c *Client) CreateIssueModelOperation(name string) *CreateIssueModelOperation { return c.internalClient.CreateIssueModelOperation(name) } // UpdateIssueModel updates an issue model. func (c *Client) UpdateIssueModel(ctx context.Context, req *contactcenterinsightspb.UpdateIssueModelRequest, opts ...gax.CallOption) (*contactcenterinsightspb.IssueModel, error) { return c.internalClient.UpdateIssueModel(ctx, req, opts...) } // GetIssueModel gets an issue model. func (c *Client) GetIssueModel(ctx context.Context, req *contactcenterinsightspb.GetIssueModelRequest, opts ...gax.CallOption) (*contactcenterinsightspb.IssueModel, error) { return c.internalClient.GetIssueModel(ctx, req, opts...) } // ListIssueModels lists issue models. func (c *Client) ListIssueModels(ctx context.Context, req *contactcenterinsightspb.ListIssueModelsRequest, opts ...gax.CallOption) (*contactcenterinsightspb.ListIssueModelsResponse, error) { return c.internalClient.ListIssueModels(ctx, req, opts...) } // DeleteIssueModel deletes an issue model. func (c *Client) DeleteIssueModel(ctx context.Context, req *contactcenterinsightspb.DeleteIssueModelRequest, opts ...gax.CallOption) (*DeleteIssueModelOperation, error) { return c.internalClient.DeleteIssueModel(ctx, req, opts...) } // DeleteIssueModelOperation returns a new DeleteIssueModelOperation from a given name. // The name must be that of a previously created DeleteIssueModelOperation, possibly from a different process. func (c *Client) DeleteIssueModelOperation(name string) *DeleteIssueModelOperation { return c.internalClient.DeleteIssueModelOperation(name) } // DeployIssueModel deploys an issue model. Returns an error if a model is already deployed. // An issue model can only be used in analysis after it has been deployed. func (c *Client) DeployIssueModel(ctx context.Context, req *contactcenterinsightspb.DeployIssueModelRequest, opts ...gax.CallOption) (*DeployIssueModelOperation, error) { return c.internalClient.DeployIssueModel(ctx, req, opts...) } // DeployIssueModelOperation returns a new DeployIssueModelOperation from a given name. // The name must be that of a previously created DeployIssueModelOperation, possibly from a different process. func (c *Client) DeployIssueModelOperation(name string) *DeployIssueModelOperation { return c.internalClient.DeployIssueModelOperation(name) } // UndeployIssueModel undeploys an issue model. // An issue model can not be used in analysis after it has been undeployed. func (c *Client) UndeployIssueModel(ctx context.Context, req *contactcenterinsightspb.UndeployIssueModelRequest, opts ...gax.CallOption) (*UndeployIssueModelOperation, error) { return c.internalClient.UndeployIssueModel(ctx, req, opts...) } // UndeployIssueModelOperation returns a new UndeployIssueModelOperation from a given name. // The name must be that of a previously created UndeployIssueModelOperation, possibly from a different process. func (c *Client) UndeployIssueModelOperation(name string) *UndeployIssueModelOperation { return c.internalClient.UndeployIssueModelOperation(name) } // ExportIssueModel exports an issue model to the provided destination. func (c *Client) ExportIssueModel(ctx context.Context, req *contactcenterinsightspb.ExportIssueModelRequest, opts ...gax.CallOption) (*ExportIssueModelOperation, error) { return c.internalClient.ExportIssueModel(ctx, req, opts...) } // ExportIssueModelOperation returns a new ExportIssueModelOperation from a given name. // The name must be that of a previously created ExportIssueModelOperation, possibly from a different process. func (c *Client) ExportIssueModelOperation(name string) *ExportIssueModelOperation { return c.internalClient.ExportIssueModelOperation(name) } // ImportIssueModel imports an issue model from a Cloud Storage bucket. func (c *Client) ImportIssueModel(ctx context.Context, req *contactcenterinsightspb.ImportIssueModelRequest, opts ...gax.CallOption) (*ImportIssueModelOperation, error) { return c.internalClient.ImportIssueModel(ctx, req, opts...) } // ImportIssueModelOperation returns a new ImportIssueModelOperation from a given name. // The name must be that of a previously created ImportIssueModelOperation, possibly from a different process. func (c *Client) ImportIssueModelOperation(name string) *ImportIssueModelOperation { return c.internalClient.ImportIssueModelOperation(name) } // GetIssue gets an issue. func (c *Client) GetIssue(ctx context.Context, req *contactcenterinsightspb.GetIssueRequest, opts ...gax.CallOption) (*contactcenterinsightspb.Issue, error) { return c.internalClient.GetIssue(ctx, req, opts...) } // ListIssues lists issues. func (c *Client) ListIssues(ctx context.Context, req *contactcenterinsightspb.ListIssuesRequest, opts ...gax.CallOption) (*contactcenterinsightspb.ListIssuesResponse, error) { return c.internalClient.ListIssues(ctx, req, opts...) } // UpdateIssue updates an issue. func (c *Client) UpdateIssue(ctx context.Context, req *contactcenterinsightspb.UpdateIssueRequest, opts ...gax.CallOption) (*contactcenterinsightspb.Issue, error) { return c.internalClient.UpdateIssue(ctx, req, opts...) } // DeleteIssue deletes an issue. func (c *Client) DeleteIssue(ctx context.Context, req *contactcenterinsightspb.DeleteIssueRequest, opts ...gax.CallOption) error { return c.internalClient.DeleteIssue(ctx, req, opts...) } // CalculateIssueModelStats gets an issue model’s statistics. func (c *Client) CalculateIssueModelStats(ctx context.Context, req *contactcenterinsightspb.CalculateIssueModelStatsRequest, opts ...gax.CallOption) (*contactcenterinsightspb.CalculateIssueModelStatsResponse, error) { return c.internalClient.CalculateIssueModelStats(ctx, req, opts...) } // CreatePhraseMatcher creates a phrase matcher. func (c *Client) CreatePhraseMatcher(ctx context.Context, req *contactcenterinsightspb.CreatePhraseMatcherRequest, opts ...gax.CallOption) (*contactcenterinsightspb.PhraseMatcher, error) { return c.internalClient.CreatePhraseMatcher(ctx, req, opts...) } // GetPhraseMatcher gets a phrase matcher. func (c *Client) GetPhraseMatcher(ctx context.Context, req *contactcenterinsightspb.GetPhraseMatcherRequest, opts ...gax.CallOption) (*contactcenterinsightspb.PhraseMatcher, error) { return c.internalClient.GetPhraseMatcher(ctx, req, opts...) } // ListPhraseMatchers lists phrase matchers. func (c *Client) ListPhraseMatchers(ctx context.Context, req *contactcenterinsightspb.ListPhraseMatchersRequest, opts ...gax.CallOption) *PhraseMatcherIterator { return c.internalClient.ListPhraseMatchers(ctx, req, opts...) } // DeletePhraseMatcher deletes a phrase matcher. func (c *Client) DeletePhraseMatcher(ctx context.Context, req *contactcenterinsightspb.DeletePhraseMatcherRequest, opts ...gax.CallOption) error { return c.internalClient.DeletePhraseMatcher(ctx, req, opts...) } // UpdatePhraseMatcher updates a phrase matcher. func (c *Client) UpdatePhraseMatcher(ctx context.Context, req *contactcenterinsightspb.UpdatePhraseMatcherRequest, opts ...gax.CallOption) (*contactcenterinsightspb.PhraseMatcher, error) { return c.internalClient.UpdatePhraseMatcher(ctx, req, opts...) } // CalculateStats gets conversation statistics. func (c *Client) CalculateStats(ctx context.Context, req *contactcenterinsightspb.CalculateStatsRequest, opts ...gax.CallOption) (*contactcenterinsightspb.CalculateStatsResponse, error) { return c.internalClient.CalculateStats(ctx, req, opts...) } // GetSettings gets project-level settings. func (c *Client) GetSettings(ctx context.Context, req *contactcenterinsightspb.GetSettingsRequest, opts ...gax.CallOption) (*contactcenterinsightspb.Settings, error) { return c.internalClient.GetSettings(ctx, req, opts...) } // UpdateSettings updates project-level settings. func (c *Client) UpdateSettings(ctx context.Context, req *contactcenterinsightspb.UpdateSettingsRequest, opts ...gax.CallOption) (*contactcenterinsightspb.Settings, error) { return c.internalClient.UpdateSettings(ctx, req, opts...) } // CreateAnalysisRule creates a analysis rule. func (c *Client) CreateAnalysisRule(ctx context.Context, req *contactcenterinsightspb.CreateAnalysisRuleRequest, opts ...gax.CallOption) (*contactcenterinsightspb.AnalysisRule, error) { return c.internalClient.CreateAnalysisRule(ctx, req, opts...) } // GetAnalysisRule get a analysis rule. func (c *Client) GetAnalysisRule(ctx context.Context, req *contactcenterinsightspb.GetAnalysisRuleRequest, opts ...gax.CallOption) (*contactcenterinsightspb.AnalysisRule, error) { return c.internalClient.GetAnalysisRule(ctx, req, opts...) } // ListAnalysisRules lists analysis rules. func (c *Client) ListAnalysisRules(ctx context.Context, req *contactcenterinsightspb.ListAnalysisRulesRequest, opts ...gax.CallOption) *AnalysisRuleIterator { return c.internalClient.ListAnalysisRules(ctx, req, opts...) } // UpdateAnalysisRule updates a analysis rule. func (c *Client) UpdateAnalysisRule(ctx context.Context, req *contactcenterinsightspb.UpdateAnalysisRuleRequest, opts ...gax.CallOption) (*contactcenterinsightspb.AnalysisRule, error) { return c.internalClient.UpdateAnalysisRule(ctx, req, opts...) } // DeleteAnalysisRule deletes a analysis rule. func (c *Client) DeleteAnalysisRule(ctx context.Context, req *contactcenterinsightspb.DeleteAnalysisRuleRequest, opts ...gax.CallOption) error { return c.internalClient.DeleteAnalysisRule(ctx, req, opts...) } // GetEncryptionSpec gets location-level encryption key specification. func (c *Client) GetEncryptionSpec(ctx context.Context, req *contactcenterinsightspb.GetEncryptionSpecRequest, opts ...gax.CallOption) (*contactcenterinsightspb.EncryptionSpec, error) { return c.internalClient.GetEncryptionSpec(ctx, req, opts...) } // InitializeEncryptionSpec initializes a location-level encryption key specification. An error will // result if the location has resources already created before the // initialization. After the encryption specification is initialized at a // location, it is immutable and all newly created resources under the // location will be encrypted with the existing specification. func (c *Client) InitializeEncryptionSpec(ctx context.Context, req *contactcenterinsightspb.InitializeEncryptionSpecRequest, opts ...gax.CallOption) (*InitializeEncryptionSpecOperation, error) { return c.internalClient.InitializeEncryptionSpec(ctx, req, opts...) } // InitializeEncryptionSpecOperation returns a new InitializeEncryptionSpecOperation from a given name. // The name must be that of a previously created InitializeEncryptionSpecOperation, possibly from a different process. func (c *Client) InitializeEncryptionSpecOperation(name string) *InitializeEncryptionSpecOperation { return c.internalClient.InitializeEncryptionSpecOperation(name) } // CreateView creates a view. func (c *Client) CreateView(ctx context.Context, req *contactcenterinsightspb.CreateViewRequest, opts ...gax.CallOption) (*contactcenterinsightspb.View, error) { return c.internalClient.CreateView(ctx, req, opts...) } // GetView gets a view. func (c *Client) GetView(ctx context.Context, req *contactcenterinsightspb.GetViewRequest, opts ...gax.CallOption) (*contactcenterinsightspb.View, error) { return c.internalClient.GetView(ctx, req, opts...) } // ListViews lists views. func (c *Client) ListViews(ctx context.Context, req *contactcenterinsightspb.ListViewsRequest, opts ...gax.CallOption) *ViewIterator { return c.internalClient.ListViews(ctx, req, opts...) } // UpdateView updates a view. func (c *Client) UpdateView(ctx context.Context, req *contactcenterinsightspb.UpdateViewRequest, opts ...gax.CallOption) (*contactcenterinsightspb.View, error) { return c.internalClient.UpdateView(ctx, req, opts...) } // DeleteView deletes a view. func (c *Client) DeleteView(ctx context.Context, req *contactcenterinsightspb.DeleteViewRequest, opts ...gax.CallOption) error { return c.internalClient.DeleteView(ctx, req, opts...) } // QueryMetrics query metrics. func (c *Client) QueryMetrics(ctx context.Context, req *contactcenterinsightspb.QueryMetricsRequest, opts ...gax.CallOption) (*QueryMetricsOperation, error) { return c.internalClient.QueryMetrics(ctx, req, opts...) } // QueryMetricsOperation returns a new QueryMetricsOperation from a given name. // The name must be that of a previously created QueryMetricsOperation, possibly from a different process. func (c *Client) QueryMetricsOperation(name string) *QueryMetricsOperation { return c.internalClient.QueryMetricsOperation(name) } // CreateQaQuestion create a QaQuestion. func (c *Client) CreateQaQuestion(ctx context.Context, req *contactcenterinsightspb.CreateQaQuestionRequest, opts ...gax.CallOption) (*contactcenterinsightspb.QaQuestion, error) { return c.internalClient.CreateQaQuestion(ctx, req, opts...) } // GetQaQuestion gets a QaQuestion. func (c *Client) GetQaQuestion(ctx context.Context, req *contactcenterinsightspb.GetQaQuestionRequest, opts ...gax.CallOption) (*contactcenterinsightspb.QaQuestion, error) { return c.internalClient.GetQaQuestion(ctx, req, opts...) } // UpdateQaQuestion updates a QaQuestion. func (c *Client) UpdateQaQuestion(ctx context.Context, req *contactcenterinsightspb.UpdateQaQuestionRequest, opts ...gax.CallOption) (*contactcenterinsightspb.QaQuestion, error) { return c.internalClient.UpdateQaQuestion(ctx, req, opts...) } // DeleteQaQuestion deletes a QaQuestion. func (c *Client) DeleteQaQuestion(ctx context.Context, req *contactcenterinsightspb.DeleteQaQuestionRequest, opts ...gax.CallOption) error { return c.internalClient.DeleteQaQuestion(ctx, req, opts...) } // ListQaQuestions lists QaQuestions. func (c *Client) ListQaQuestions(ctx context.Context, req *contactcenterinsightspb.ListQaQuestionsRequest, opts ...gax.CallOption) *QaQuestionIterator { return c.internalClient.ListQaQuestions(ctx, req, opts...) } // CreateQaScorecard create a QaScorecard. func (c *Client) CreateQaScorecard(ctx context.Context, req *contactcenterinsightspb.CreateQaScorecardRequest, opts ...gax.CallOption) (*contactcenterinsightspb.QaScorecard, error) { return c.internalClient.CreateQaScorecard(ctx, req, opts...) } // GetQaScorecard gets a QaScorecard. func (c *Client) GetQaScorecard(ctx context.Context, req *contactcenterinsightspb.GetQaScorecardRequest, opts ...gax.CallOption) (*contactcenterinsightspb.QaScorecard, error) { return c.internalClient.GetQaScorecard(ctx, req, opts...) } // UpdateQaScorecard updates a QaScorecard. func (c *Client) UpdateQaScorecard(ctx context.Context, req *contactcenterinsightspb.UpdateQaScorecardRequest, opts ...gax.CallOption) (*contactcenterinsightspb.QaScorecard, error) { return c.internalClient.UpdateQaScorecard(ctx, req, opts...) } // DeleteQaScorecard deletes a QaScorecard. func (c *Client) DeleteQaScorecard(ctx context.Context, req *contactcenterinsightspb.DeleteQaScorecardRequest, opts ...gax.CallOption) error { return c.internalClient.DeleteQaScorecard(ctx, req, opts...) } // ListQaScorecards lists QaScorecards. func (c *Client) ListQaScorecards(ctx context.Context, req *contactcenterinsightspb.ListQaScorecardsRequest, opts ...gax.CallOption) *QaScorecardIterator { return c.internalClient.ListQaScorecards(ctx, req, opts...) } // CreateQaScorecardRevision creates a QaScorecardRevision. func (c *Client) CreateQaScorecardRevision(ctx context.Context, req *contactcenterinsightspb.CreateQaScorecardRevisionRequest, opts ...gax.CallOption) (*contactcenterinsightspb.QaScorecardRevision, error) { return c.internalClient.CreateQaScorecardRevision(ctx, req, opts...) } // GetQaScorecardRevision gets a QaScorecardRevision. func (c *Client) GetQaScorecardRevision(ctx context.Context, req *contactcenterinsightspb.GetQaScorecardRevisionRequest, opts ...gax.CallOption) (*contactcenterinsightspb.QaScorecardRevision, error) { return c.internalClient.GetQaScorecardRevision(ctx, req, opts...) } // TuneQaScorecardRevision fine tune one or more QaModels. func (c *Client) TuneQaScorecardRevision(ctx context.Context, req *contactcenterinsightspb.TuneQaScorecardRevisionRequest, opts ...gax.CallOption) (*TuneQaScorecardRevisionOperation, error) { return c.internalClient.TuneQaScorecardRevision(ctx, req, opts...) } // TuneQaScorecardRevisionOperation returns a new TuneQaScorecardRevisionOperation from a given name. // The name must be that of a previously created TuneQaScorecardRevisionOperation, possibly from a different process. func (c *Client) TuneQaScorecardRevisionOperation(name string) *TuneQaScorecardRevisionOperation { return c.internalClient.TuneQaScorecardRevisionOperation(name) } // DeployQaScorecardRevision deploy a QaScorecardRevision. func (c *Client) DeployQaScorecardRevision(ctx context.Context, req *contactcenterinsightspb.DeployQaScorecardRevisionRequest, opts ...gax.CallOption) (*contactcenterinsightspb.QaScorecardRevision, error) { return c.internalClient.DeployQaScorecardRevision(ctx, req, opts...) } // UndeployQaScorecardRevision undeploy a QaScorecardRevision. func (c *Client) UndeployQaScorecardRevision(ctx context.Context, req *contactcenterinsightspb.UndeployQaScorecardRevisionRequest, opts ...gax.CallOption) (*contactcenterinsightspb.QaScorecardRevision, error) { return c.internalClient.UndeployQaScorecardRevision(ctx, req, opts...) } // DeleteQaScorecardRevision deletes a QaScorecardRevision. func (c *Client) DeleteQaScorecardRevision(ctx context.Context, req *contactcenterinsightspb.DeleteQaScorecardRevisionRequest, opts ...gax.CallOption) error { return c.internalClient.DeleteQaScorecardRevision(ctx, req, opts...) } // ListQaScorecardRevisions lists all revisions under the parent QaScorecard. func (c *Client) ListQaScorecardRevisions(ctx context.Context, req *contactcenterinsightspb.ListQaScorecardRevisionsRequest, opts ...gax.CallOption) *QaScorecardRevisionIterator { return c.internalClient.ListQaScorecardRevisions(ctx, req, opts...) } // CreateFeedbackLabel create feedback label. func (c *Client) CreateFeedbackLabel(ctx context.Context, req *contactcenterinsightspb.CreateFeedbackLabelRequest, opts ...gax.CallOption) (*contactcenterinsightspb.FeedbackLabel, error) { return c.internalClient.CreateFeedbackLabel(ctx, req, opts...) } // ListFeedbackLabels list feedback labels. func (c *Client) ListFeedbackLabels(ctx context.Context, req *contactcenterinsightspb.ListFeedbackLabelsRequest, opts ...gax.CallOption) *FeedbackLabelIterator { return c.internalClient.ListFeedbackLabels(ctx, req, opts...) } // GetFeedbackLabel get feedback label. func (c *Client) GetFeedbackLabel(ctx context.Context, req *contactcenterinsightspb.GetFeedbackLabelRequest, opts ...gax.CallOption) (*contactcenterinsightspb.FeedbackLabel, error) { return c.internalClient.GetFeedbackLabel(ctx, req, opts...) } // UpdateFeedbackLabel update feedback label. func (c *Client) UpdateFeedbackLabel(ctx context.Context, req *contactcenterinsightspb.UpdateFeedbackLabelRequest, opts ...gax.CallOption) (*contactcenterinsightspb.FeedbackLabel, error) { return c.internalClient.UpdateFeedbackLabel(ctx, req, opts...) } // DeleteFeedbackLabel delete feedback label. func (c *Client) DeleteFeedbackLabel(ctx context.Context, req *contactcenterinsightspb.DeleteFeedbackLabelRequest, opts ...gax.CallOption) error { return c.internalClient.DeleteFeedbackLabel(ctx, req, opts...) } // ListAllFeedbackLabels list all feedback labels by project number. func (c *Client) ListAllFeedbackLabels(ctx context.Context, req *contactcenterinsightspb.ListAllFeedbackLabelsRequest, opts ...gax.CallOption) *FeedbackLabelIterator { return c.internalClient.ListAllFeedbackLabels(ctx, req, opts...) } // BulkUploadFeedbackLabels upload feedback labels in bulk. func (c *Client) BulkUploadFeedbackLabels(ctx context.Context, req *contactcenterinsightspb.BulkUploadFeedbackLabelsRequest, opts ...gax.CallOption) (*BulkUploadFeedbackLabelsOperation, error) { return c.internalClient.BulkUploadFeedbackLabels(ctx, req, opts...) } // BulkUploadFeedbackLabelsOperation returns a new BulkUploadFeedbackLabelsOperation from a given name. // The name must be that of a previously created BulkUploadFeedbackLabelsOperation, possibly from a different process. func (c *Client) BulkUploadFeedbackLabelsOperation(name string) *BulkUploadFeedbackLabelsOperation { return c.internalClient.BulkUploadFeedbackLabelsOperation(name) } // BulkDownloadFeedbackLabels download feedback labels in bulk. func (c *Client) BulkDownloadFeedbackLabels(ctx context.Context, req *contactcenterinsightspb.BulkDownloadFeedbackLabelsRequest, opts ...gax.CallOption) (*BulkDownloadFeedbackLabelsOperation, error) { return c.internalClient.BulkDownloadFeedbackLabels(ctx, req, opts...) } // BulkDownloadFeedbackLabelsOperation returns a new BulkDownloadFeedbackLabelsOperation from a given name. // The name must be that of a previously created BulkDownloadFeedbackLabelsOperation, possibly from a different process. func (c *Client) BulkDownloadFeedbackLabelsOperation(name string) *BulkDownloadFeedbackLabelsOperation { return c.internalClient.BulkDownloadFeedbackLabelsOperation(name) } // CancelOperation is a utility method from google.longrunning.Operations. func (c *Client) CancelOperation(ctx context.Context, req *longrunningpb.CancelOperationRequest, opts ...gax.CallOption) error { return c.internalClient.CancelOperation(ctx, req, opts...) } // GetOperation is a utility method from google.longrunning.Operations. func (c *Client) GetOperation(ctx context.Context, req *longrunningpb.GetOperationRequest, opts ...gax.CallOption) (*longrunningpb.Operation, error) { return c.internalClient.GetOperation(ctx, req, opts...) } // ListOperations is a utility method from google.longrunning.Operations. func (c *Client) ListOperations(ctx context.Context, req *longrunningpb.ListOperationsRequest, opts ...gax.CallOption) *OperationIterator { return c.internalClient.ListOperations(ctx, req, opts...) } // gRPCClient is a client for interacting with Contact Center AI Insights API over gRPC transport. // // Methods, except Close, may be called concurrently. However, fields must not be modified concurrently with method calls. type gRPCClient struct { // Connection pool of gRPC connections to the service. connPool gtransport.ConnPool // Points back to the CallOptions field of the containing Client CallOptions **CallOptions // The gRPC API client. client contactcenterinsightspb.ContactCenterInsightsClient // LROClient is used internally to handle long-running operations. // It is exposed so that its CallOptions can be modified if required. // Users should not Close this client. LROClient **lroauto.OperationsClient operationsClient longrunningpb.OperationsClient // The x-goog-* metadata to be sent with each request. xGoogHeaders []string logger *slog.Logger } // NewClient creates a new contact center insights client based on gRPC. // The returned client must be Closed when it is done being used to clean up its underlying connections. // // An API that lets users analyze and explore their business conversation data. func NewClient(ctx context.Context, opts ...option.ClientOption) (*Client, error) { clientOpts := defaultGRPCClientOptions() if newClientHook != nil { hookOpts, err := newClientHook(ctx, clientHookParams{}) if err != nil { return nil, err } clientOpts = append(clientOpts, hookOpts...) } connPool, err := gtransport.DialPool(ctx, append(clientOpts, opts...)...) if err != nil { return nil, err } client := Client{CallOptions: defaultCallOptions()} c := &gRPCClient{ connPool: connPool, client: contactcenterinsightspb.NewContactCenterInsightsClient(connPool), CallOptions: &client.CallOptions, logger: internaloption.GetLogger(opts), operationsClient: longrunningpb.NewOperationsClient(connPool), } c.setGoogleClientInfo() client.internalClient = c client.LROClient, err = lroauto.NewOperationsClient(ctx, gtransport.WithConnPool(connPool)) if err != nil { // This error "should not happen", since we are just reusing old connection pool // and never actually need to dial. // If this does happen, we could leak connp. However, we cannot close conn: // If the user invoked the constructor with option.WithGRPCConn, // we would close a connection that's still in use. // TODO: investigate error conditions. return nil, err } c.LROClient = &client.LROClient return &client, nil } // Connection returns a connection to the API service. // // Deprecated: Connections are now pooled so this method does not always // return the same resource. func (c *gRPCClient) Connection() *grpc.ClientConn { return c.connPool.Conn() } // 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 *gRPCClient) setGoogleClientInfo(keyval ...string) { kv := append([]string{"gl-go", gax.GoVersion}, keyval...) kv = append(kv, "gapic", getVersionClient(), "gax", gax.Version, "grpc", grpc.Version, "pb", protoVersion) c.xGoogHeaders = []string{ "x-goog-api-client", gax.XGoogHeader(kv...), } } // Close closes the connection to the API service. The user should invoke this when // the client is no longer required. func (c *gRPCClient) Close() error { return c.connPool.Close() } // Methods, except Close, may be called concurrently. However, fields must not be modified concurrently with method calls. type restClient struct { // The http endpoint to connect to. endpoint string // The http client. httpClient *http.Client // LROClient is used internally to handle long-running operations. // It is exposed so that its CallOptions can be modified if required. // Users should not Close this client. LROClient **lroauto.OperationsClient // The x-goog-* headers to be sent with each request. xGoogHeaders []string // Points back to the CallOptions field of the containing Client CallOptions **CallOptions logger *slog.Logger } // NewRESTClient creates a new contact center insights rest client. // // An API that lets users analyze and explore their business conversation data. func NewRESTClient(ctx context.Context, opts ...option.ClientOption) (*Client, error) { clientOpts := append(defaultRESTClientOptions(), opts...) httpClient, endpoint, err := httptransport.NewClient(ctx, clientOpts...) if err != nil { return nil, err } callOpts := defaultRESTCallOptions() c := &restClient{ endpoint: endpoint, httpClient: httpClient, CallOptions: &callOpts, logger: internaloption.GetLogger(opts), } c.setGoogleClientInfo() lroOpts := []option.ClientOption{ option.WithHTTPClient(httpClient), option.WithEndpoint(endpoint), } opClient, err := lroauto.NewOperationsRESTClient(ctx, lroOpts...) if err != nil { return nil, err } c.LROClient = &opClient return &Client{internalClient: c, CallOptions: callOpts}, nil } func defaultRESTClientOptions() []option.ClientOption { return []option.ClientOption{ internaloption.WithDefaultEndpoint("https://contactcenterinsights.googleapis.com"), internaloption.WithDefaultEndpointTemplate("https://contactcenterinsights.UNIVERSE_DOMAIN"), internaloption.WithDefaultMTLSEndpoint("https://contactcenterinsights.mtls.googleapis.com"), internaloption.WithDefaultUniverseDomain("googleapis.com"), internaloption.WithDefaultAudience("https://contactcenterinsights.googleapis.com/"), internaloption.WithDefaultScopes(DefaultAuthScopes()...), internaloption.EnableNewAuthLibrary(), } } // 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 *restClient) setGoogleClientInfo(keyval ...string) { kv := append([]string{"gl-go", gax.GoVersion}, keyval...) kv = append(kv, "gapic", getVersionClient(), "gax", gax.Version, "rest", "UNKNOWN", "pb", protoVersion) c.xGoogHeaders = []string{ "x-goog-api-client", gax.XGoogHeader(kv...), } } // Close closes the connection to the API service. The user should invoke this when // the client is no longer required. func (c *restClient) Close() error { // Replace httpClient with nil to force cleanup. c.httpClient = nil return nil } // Connection returns a connection to the API service. // // Deprecated: This method always returns nil. func (c *restClient) Connection() *grpc.ClientConn { return nil } func (c *gRPCClient) CreateConversation(ctx context.Context, req *contactcenterinsightspb.CreateConversationRequest, opts ...gax.CallOption) (*contactcenterinsightspb.Conversation, error) { hds := []string{"x-goog-request-params", fmt.Sprintf("%s=%v", "parent", url.QueryEscape(req.GetParent()))} hds = append(c.xGoogHeaders, hds...) ctx = gax.InsertMetadataIntoOutgoingContext(ctx, hds...) opts = append((*c.CallOptions).CreateConversation[0:len((*c.CallOptions).CreateConversation):len((*c.CallOptions).CreateConversation)], opts...) var resp *contactcenterinsightspb.Conversation err := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error { var err error resp, err = executeRPC(ctx, c.client.CreateConversation, req, settings.GRPC, c.logger, "CreateConversation") return err }, opts...) if err != nil { return nil, err } return resp, nil } func (c *gRPCClient) UploadConversation(ctx context.Context, req *contactcenterinsightspb.UploadConversationRequest, opts ...gax.CallOption) (*UploadConversationOperation, error) { hds := []string{"x-goog-request-params", fmt.Sprintf("%s=%v", "parent", url.QueryEscape(req.GetParent()))} hds = append(c.xGoogHeaders, hds...) ctx = gax.InsertMetadataIntoOutgoingContext(ctx, hds...) opts = append((*c.CallOptions).UploadConversation[0:len((*c.CallOptions).UploadConversation):len((*c.CallOptions).UploadConversation)], opts...) var resp *longrunningpb.Operation err := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error { var err error resp, err = executeRPC(ctx, c.client.UploadConversation, req, settings.GRPC, c.logger, "UploadConversation") return err }, opts...) if err != nil { return nil, err } return &UploadConversationOperation{ lro: longrunning.InternalNewOperation(*c.LROClient, resp), }, nil } func (c *gRPCClient) UpdateConversation(ctx context.Context, req *contactcenterinsightspb.UpdateConversationRequest, opts ...gax.CallOption) (*contactcenterinsightspb.Conversation, error) { hds := []string{"x-goog-request-params", fmt.Sprintf("%s=%v", "conversation.name", url.QueryEscape(req.GetConversation().GetName()))} hds = append(c.xGoogHeaders, hds...) ctx = gax.InsertMetadataIntoOutgoingContext(ctx, hds...) opts = append((*c.CallOptions).UpdateConversation[0:len((*c.CallOptions).UpdateConversation):len((*c.CallOptions).UpdateConversation)], opts...) var resp *contactcenterinsightspb.Conversation err := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error { var err error resp, err = executeRPC(ctx, c.client.UpdateConversation, req, settings.GRPC, c.logger, "UpdateConversation") return err }, opts...) if err != nil { return nil, err } return resp, nil } func (c *gRPCClient) GetConversation(ctx context.Context, req *contactcenterinsightspb.GetConversationRequest, opts ...gax.CallOption) (*contactcenterinsightspb.Conversation, error) { hds := []string{"x-goog-request-params", fmt.Sprintf("%s=%v", "name", url.QueryEscape(req.GetName()))} hds = append(c.xGoogHeaders, hds...) ctx = gax.InsertMetadataIntoOutgoingContext(ctx, hds...) opts = append((*c.CallOptions).GetConversation[0:len((*c.CallOptions).GetConversation):len((*c.CallOptions).GetConversation)], opts...) var resp *contactcenterinsightspb.Conversation err := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error { var err error resp, err = executeRPC(ctx, c.client.GetConversation, req, settings.GRPC, c.logger, "GetConversation") return err }, opts...) if err != nil { return nil, err } return resp, nil } func (c *gRPCClient) ListConversations(ctx context.Context, req *contactcenterinsightspb.ListConversationsRequest, opts ...gax.CallOption) *ConversationIterator { hds := []string{"x-goog-request-params", fmt.Sprintf("%s=%v", "parent", url.QueryEscape(req.GetParent()))} hds = append(c.xGoogHeaders, hds...) ctx = gax.InsertMetadataIntoOutgoingContext(ctx, hds...) opts = append((*c.CallOptions).ListConversations[0:len((*c.CallOptions).ListConversations):len((*c.CallOptions).ListConversations)], opts...) it := &ConversationIterator{} req = proto.Clone(req).(*contactcenterinsightspb.ListConversationsRequest) it.InternalFetch = func(pageSize int, pageToken string) ([]*contactcenterinsightspb.Conversation, string, error) { resp := &contactcenterinsightspb.ListConversationsResponse{} if pageToken != "" { req.PageToken = pageToken } if pageSize > math.MaxInt32 { req.PageSize = math.MaxInt32 } else if pageSize != 0 { req.PageSize = int32(pageSize) } err := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error { var err error resp, err = executeRPC(ctx, c.client.ListConversations, req, settings.GRPC, c.logger, "ListConversations") return err }, opts...) if err != nil { return nil, "", err } it.Response = resp return resp.GetConversations(), resp.GetNextPageToken(), 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.GetPageSize()) it.pageInfo.Token = req.GetPageToken() return it } func (c *gRPCClient) DeleteConversation(ctx context.Context, req *contactcenterinsightspb.DeleteConversationRequest, opts ...gax.CallOption) error { hds := []string{"x-goog-request-params", fmt.Sprintf("%s=%v", "name", url.QueryEscape(req.GetName()))} hds = append(c.xGoogHeaders, hds...) ctx = gax.InsertMetadataIntoOutgoingContext(ctx, hds...) opts = append((*c.CallOptions).DeleteConversation[0:len((*c.CallOptions).DeleteConversation):len((*c.CallOptions).DeleteConversation)], opts...) err := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error { var err error _, err = executeRPC(ctx, c.client.DeleteConversation, req, settings.GRPC, c.logger, "DeleteConversation") return err }, opts...) return err } func (c *gRPCClient) CreateAnalysis(ctx context.Context, req *contactcenterinsightspb.CreateAnalysisRequest, opts ...gax.CallOption) (*CreateAnalysisOperation, error) { hds := []string{"x-goog-request-params", fmt.Sprintf("%s=%v", "parent", url.QueryEscape(req.GetParent()))} hds = append(c.xGoogHeaders, hds...) ctx = gax.InsertMetadataIntoOutgoingContext(ctx, hds...) opts = append((*c.CallOptions).CreateAnalysis[0:len((*c.CallOptions).CreateAnalysis):len((*c.CallOptions).CreateAnalysis)], opts...) var resp *longrunningpb.Operation err := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error { var err error resp, err = executeRPC(ctx, c.client.CreateAnalysis, req, settings.GRPC, c.logger, "CreateAnalysis") return err }, opts...) if err != nil { return nil, err } return &CreateAnalysisOperation{ lro: longrunning.InternalNewOperation(*c.LROClient, resp), }, nil } func (c *gRPCClient) GetAnalysis(ctx context.Context, req *contactcenterinsightspb.GetAnalysisRequest, opts ...gax.CallOption) (*contactcenterinsightspb.Analysis, error) { hds := []string{"x-goog-request-params", fmt.Sprintf("%s=%v", "name", url.QueryEscape(req.GetName()))} hds = append(c.xGoogHeaders, hds...) ctx = gax.InsertMetadataIntoOutgoingContext(ctx, hds...) opts = append((*c.CallOptions).GetAnalysis[0:len((*c.CallOptions).GetAnalysis):len((*c.CallOptions).GetAnalysis)], opts...) var resp *contactcenterinsightspb.Analysis err := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error { var err error resp, err = executeRPC(ctx, c.client.GetAnalysis, req, settings.GRPC, c.logger, "GetAnalysis") return err }, opts...) if err != nil { return nil, err } return resp, nil } func (c *gRPCClient) ListAnalyses(ctx context.Context, req *contactcenterinsightspb.ListAnalysesRequest, opts ...gax.CallOption) *AnalysisIterator { hds := []string{"x-goog-request-params", fmt.Sprintf("%s=%v", "parent", url.QueryEscape(req.GetParent()))} hds = append(c.xGoogHeaders, hds...) ctx = gax.InsertMetadataIntoOutgoingContext(ctx, hds...) opts = append((*c.CallOptions).ListAnalyses[0:len((*c.CallOptions).ListAnalyses):len((*c.CallOptions).ListAnalyses)], opts...) it := &AnalysisIterator{} req = proto.Clone(req).(*contactcenterinsightspb.ListAnalysesRequest) it.InternalFetch = func(pageSize int, pageToken string) ([]*contactcenterinsightspb.Analysis, string, error) { resp := &contactcenterinsightspb.ListAnalysesResponse{} if pageToken != "" { req.PageToken = pageToken } if pageSize > math.MaxInt32 { req.PageSize = math.MaxInt32 } else if pageSize != 0 { req.PageSize = int32(pageSize) } err := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error { var err error resp, err = executeRPC(ctx, c.client.ListAnalyses, req, settings.GRPC, c.logger, "ListAnalyses") return err }, opts...) if err != nil { return nil, "", err } it.Response = resp return resp.GetAnalyses(), resp.GetNextPageToken(), 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.GetPageSize()) it.pageInfo.Token = req.GetPageToken() return it } func (c *gRPCClient) DeleteAnalysis(ctx context.Context, req *contactcenterinsightspb.DeleteAnalysisRequest, opts ...gax.CallOption) error { hds := []string{"x-goog-request-params", fmt.Sprintf("%s=%v", "name", url.QueryEscape(req.GetName()))} hds = append(c.xGoogHeaders, hds...) ctx = gax.InsertMetadataIntoOutgoingContext(ctx, hds...) opts = append((*c.CallOptions).DeleteAnalysis[0:len((*c.CallOptions).DeleteAnalysis):len((*c.CallOptions).DeleteAnalysis)], opts...) err := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error { var err error _, err = executeRPC(ctx, c.client.DeleteAnalysis, req, settings.GRPC, c.logger, "DeleteAnalysis") return err }, opts...) return err } func (c *gRPCClient) BulkAnalyzeConversations(ctx context.Context, req *contactcenterinsightspb.BulkAnalyzeConversationsRequest, opts ...gax.CallOption) (*BulkAnalyzeConversationsOperation, error) { hds := []string{"x-goog-request-params", fmt.Sprintf("%s=%v", "parent", url.QueryEscape(req.GetParent()))} hds = append(c.xGoogHeaders, hds...) ctx = gax.InsertMetadataIntoOutgoingContext(ctx, hds...) opts = append((*c.CallOptions).BulkAnalyzeConversations[0:len((*c.CallOptions).BulkAnalyzeConversations):len((*c.CallOptions).BulkAnalyzeConversations)], opts...) var resp *longrunningpb.Operation err := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error { var err error resp, err = executeRPC(ctx, c.client.BulkAnalyzeConversations, req, settings.GRPC, c.logger, "BulkAnalyzeConversations") return err }, opts...) if err != nil { return nil, err } return &BulkAnalyzeConversationsOperation{ lro: longrunning.InternalNewOperation(*c.LROClient, resp), }, nil } func (c *gRPCClient) BulkDeleteConversations(ctx context.Context, req *contactcenterinsightspb.BulkDeleteConversationsRequest, opts ...gax.CallOption) (*BulkDeleteConversationsOperation, error) { hds := []string{"x-goog-request-params", fmt.Sprintf("%s=%v", "parent", url.QueryEscape(req.GetParent()))} hds = append(c.xGoogHeaders, hds...) ctx = gax.InsertMetadataIntoOutgoingContext(ctx, hds...) opts = append((*c.CallOptions).BulkDeleteConversations[0:len((*c.CallOptions).BulkDeleteConversations):len((*c.CallOptions).BulkDeleteConversations)], opts...) var resp *longrunningpb.Operation err := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error { var err error resp, err = executeRPC(ctx, c.client.BulkDeleteConversations, req, settings.GRPC, c.logger, "BulkDeleteConversations") return err }, opts...) if err != nil { return nil, err } return &BulkDeleteConversationsOperation{ lro: longrunning.InternalNewOperation(*c.LROClient, resp), }, nil } func (c *gRPCClient) IngestConversations(ctx context.Context, req *contactcenterinsightspb.IngestConversationsRequest, opts ...gax.CallOption) (*IngestConversationsOperation, error) { hds := []string{"x-goog-request-params", fmt.Sprintf("%s=%v", "parent", url.QueryEscape(req.GetParent()))} hds = append(c.xGoogHeaders, hds...) ctx = gax.InsertMetadataIntoOutgoingContext(ctx, hds...) opts = append((*c.CallOptions).IngestConversations[0:len((*c.CallOptions).IngestConversations):len((*c.CallOptions).IngestConversations)], opts...) var resp *longrunningpb.Operation err := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error { var err error resp, err = executeRPC(ctx, c.client.IngestConversations, req, settings.GRPC, c.logger, "IngestConversations") return err }, opts...) if err != nil { return nil, err } return &IngestConversationsOperation{ lro: longrunning.InternalNewOperation(*c.LROClient, resp), }, nil } func (c *gRPCClient) ExportInsightsData(ctx context.Context, req *contactcenterinsightspb.ExportInsightsDataRequest, opts ...gax.CallOption) (*ExportInsightsDataOperation, error) { hds := []string{"x-goog-request-params", fmt.Sprintf("%s=%v", "parent", url.QueryEscape(req.GetParent()))} hds = append(c.xGoogHeaders, hds...) ctx = gax.InsertMetadataIntoOutgoingContext(ctx, hds...) opts = append((*c.CallOptions).ExportInsightsData[0:len((*c.CallOptions).ExportInsightsData):len((*c.CallOptions).ExportInsightsData)], opts...) var resp *longrunningpb.Operation err := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error { var err error resp, err = executeRPC(ctx, c.client.ExportInsightsData, req, settings.GRPC, c.logger, "ExportInsightsData") return err }, opts...) if err != nil { return nil, err } return &ExportInsightsDataOperation{ lro: longrunning.InternalNewOperation(*c.LROClient, resp), }, nil } func (c *gRPCClient) CreateIssueModel(ctx context.Context, req *contactcenterinsightspb.CreateIssueModelRequest, opts ...gax.CallOption) (*CreateIssueModelOperation, error) { hds := []string{"x-goog-request-params", fmt.Sprintf("%s=%v", "parent", url.QueryEscape(req.GetParent()))} hds = append(c.xGoogHeaders, hds...) ctx = gax.InsertMetadataIntoOutgoingContext(ctx, hds...) opts = append((*c.CallOptions).CreateIssueModel[0:len((*c.CallOptions).CreateIssueModel):len((*c.CallOptions).CreateIssueModel)], opts...) var resp *longrunningpb.Operation err := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error { var err error resp, err = executeRPC(ctx, c.client.CreateIssueModel, req, settings.GRPC, c.logger, "CreateIssueModel") return err }, opts...) if err != nil { return nil, err } return &CreateIssueModelOperation{ lro: longrunning.InternalNewOperation(*c.LROClient, resp), }, nil } func (c *gRPCClient) UpdateIssueModel(ctx context.Context, req *contactcenterinsightspb.UpdateIssueModelRequest, opts ...gax.CallOption) (*contactcenterinsightspb.IssueModel, error) { hds := []string{"x-goog-request-params", fmt.Sprintf("%s=%v", "issue_model.name", url.QueryEscape(req.GetIssueModel().GetName()))} hds = append(c.xGoogHeaders, hds...) ctx = gax.InsertMetadataIntoOutgoingContext(ctx, hds...) opts = append((*c.CallOptions).UpdateIssueModel[0:len((*c.CallOptions).UpdateIssueModel):len((*c.CallOptions).UpdateIssueModel)], opts...) var resp *contactcenterinsightspb.IssueModel err := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error { var err error resp, err = executeRPC(ctx, c.client.UpdateIssueModel, req, settings.GRPC, c.logger, "UpdateIssueModel") return err }, opts...) if err != nil { return nil, err } return resp, nil } func (c *gRPCClient) GetIssueModel(ctx context.Context, req *contactcenterinsightspb.GetIssueModelRequest, opts ...gax.CallOption) (*contactcenterinsightspb.IssueModel, error) { hds := []string{"x-goog-request-params", fmt.Sprintf("%s=%v", "name", url.QueryEscape(req.GetName()))} hds = append(c.xGoogHeaders, hds...) ctx = gax.InsertMetadataIntoOutgoingContext(ctx, hds...) opts = append((*c.CallOptions).GetIssueModel[0:len((*c.CallOptions).GetIssueModel):len((*c.CallOptions).GetIssueModel)], opts...) var resp *contactcenterinsightspb.IssueModel err := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error { var err error resp, err = executeRPC(ctx, c.client.GetIssueModel, req, settings.GRPC, c.logger, "GetIssueModel") return err }, opts...) if err != nil { return nil, err } return resp, nil } func (c *gRPCClient) ListIssueModels(ctx context.Context, req *contactcenterinsightspb.ListIssueModelsRequest, opts ...gax.CallOption) (*contactcenterinsightspb.ListIssueModelsResponse, error) { hds := []string{"x-goog-request-params", fmt.Sprintf("%s=%v", "parent", url.QueryEscape(req.GetParent()))} hds = append(c.xGoogHeaders, hds...) ctx = gax.InsertMetadataIntoOutgoingContext(ctx, hds...) opts = append((*c.CallOptions).ListIssueModels[0:len((*c.CallOptions).ListIssueModels):len((*c.CallOptions).ListIssueModels)], opts...) var resp *contactcenterinsightspb.ListIssueModelsResponse err := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error { var err error resp, err = executeRPC(ctx, c.client.ListIssueModels, req, settings.GRPC, c.logger, "ListIssueModels") return err }, opts...) if err != nil { return nil, err } return resp, nil } func (c *gRPCClient) DeleteIssueModel(ctx context.Context, req *contactcenterinsightspb.DeleteIssueModelRequest, opts ...gax.CallOption) (*DeleteIssueModelOperation, error) { hds := []string{"x-goog-request-params", fmt.Sprintf("%s=%v", "name", url.QueryEscape(req.GetName()))} hds = append(c.xGoogHeaders, hds...) ctx = gax.InsertMetadataIntoOutgoingContext(ctx, hds...) opts = append((*c.CallOptions).DeleteIssueModel[0:len((*c.CallOptions).DeleteIssueModel):len((*c.CallOptions).DeleteIssueModel)], opts...) var resp *longrunningpb.Operation err := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error { var err error resp, err = executeRPC(ctx, c.client.DeleteIssueModel, req, settings.GRPC, c.logger, "DeleteIssueModel") return err }, opts...) if err != nil { return nil, err } return &DeleteIssueModelOperation{ lro: longrunning.InternalNewOperation(*c.LROClient, resp), }, nil } func (c *gRPCClient) DeployIssueModel(ctx context.Context, req *contactcenterinsightspb.DeployIssueModelRequest, opts ...gax.CallOption) (*DeployIssueModelOperation, error) { hds := []string{"x-goog-request-params", fmt.Sprintf("%s=%v", "name", url.QueryEscape(req.GetName()))} hds = append(c.xGoogHeaders, hds...) ctx = gax.InsertMetadataIntoOutgoingContext(ctx, hds...) opts = append((*c.CallOptions).DeployIssueModel[0:len((*c.CallOptions).DeployIssueModel):len((*c.CallOptions).DeployIssueModel)], opts...) var resp *longrunningpb.Operation err := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error { var err error resp, err = executeRPC(ctx, c.client.DeployIssueModel, req, settings.GRPC, c.logger, "DeployIssueModel") return err }, opts...) if err != nil { return nil, err } return &DeployIssueModelOperation{ lro: longrunning.InternalNewOperation(*c.LROClient, resp), }, nil } func (c *gRPCClient) UndeployIssueModel(ctx context.Context, req *contactcenterinsightspb.UndeployIssueModelRequest, opts ...gax.CallOption) (*UndeployIssueModelOperation, error) { hds := []string{"x-goog-request-params", fmt.Sprintf("%s=%v", "name", url.QueryEscape(req.GetName()))} hds = append(c.xGoogHeaders, hds...) ctx = gax.InsertMetadataIntoOutgoingContext(ctx, hds...) opts = append((*c.CallOptions).UndeployIssueModel[0:len((*c.CallOptions).UndeployIssueModel):len((*c.CallOptions).UndeployIssueModel)], opts...) var resp *longrunningpb.Operation err := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error { var err error resp, err = executeRPC(ctx, c.client.UndeployIssueModel, req, settings.GRPC, c.logger, "UndeployIssueModel") return err }, opts...) if err != nil { return nil, err } return &UndeployIssueModelOperation{ lro: longrunning.InternalNewOperation(*c.LROClient, resp), }, nil } func (c *gRPCClient) ExportIssueModel(ctx context.Context, req *contactcenterinsightspb.ExportIssueModelRequest, opts ...gax.CallOption) (*ExportIssueModelOperation, error) { hds := []string{"x-goog-request-params", fmt.Sprintf("%s=%v", "name", url.QueryEscape(req.GetName()))} hds = append(c.xGoogHeaders, hds...) ctx = gax.InsertMetadataIntoOutgoingContext(ctx, hds...) opts = append((*c.CallOptions).ExportIssueModel[0:len((*c.CallOptions).ExportIssueModel):len((*c.CallOptions).ExportIssueModel)], opts...) var resp *longrunningpb.Operation err := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error { var err error resp, err = executeRPC(ctx, c.client.ExportIssueModel, req, settings.GRPC, c.logger, "ExportIssueModel") return err }, opts...) if err != nil { return nil, err } return &ExportIssueModelOperation{ lro: longrunning.InternalNewOperation(*c.LROClient, resp), }, nil } func (c *gRPCClient) ImportIssueModel(ctx context.Context, req *contactcenterinsightspb.ImportIssueModelRequest, opts ...gax.CallOption) (*ImportIssueModelOperation, error) { hds := []string{"x-goog-request-params", fmt.Sprintf("%s=%v", "parent", url.QueryEscape(req.GetParent()))} hds = append(c.xGoogHeaders, hds...) ctx = gax.InsertMetadataIntoOutgoingContext(ctx, hds...) opts = append((*c.CallOptions).ImportIssueModel[0:len((*c.CallOptions).ImportIssueModel):len((*c.CallOptions).ImportIssueModel)], opts...) var resp *longrunningpb.Operation err := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error { var err error resp, err = executeRPC(ctx, c.client.ImportIssueModel, req, settings.GRPC, c.logger, "ImportIssueModel") return err }, opts...) if err != nil { return nil, err } return &ImportIssueModelOperation{ lro: longrunning.InternalNewOperation(*c.LROClient, resp), }, nil } func (c *gRPCClient) GetIssue(ctx context.Context, req *contactcenterinsightspb.GetIssueRequest, opts ...gax.CallOption) (*contactcenterinsightspb.Issue, error) { hds := []string{"x-goog-request-params", fmt.Sprintf("%s=%v", "name", url.QueryEscape(req.GetName()))} hds = append(c.xGoogHeaders, hds...) ctx = gax.InsertMetadataIntoOutgoingContext(ctx, hds...) opts = append((*c.CallOptions).GetIssue[0:len((*c.CallOptions).GetIssue):len((*c.CallOptions).GetIssue)], opts...) var resp *contactcenterinsightspb.Issue err := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error { var err error resp, err = executeRPC(ctx, c.client.GetIssue, req, settings.GRPC, c.logger, "GetIssue") return err }, opts...) if err != nil { return nil, err } return resp, nil } func (c *gRPCClient) ListIssues(ctx context.Context, req *contactcenterinsightspb.ListIssuesRequest, opts ...gax.CallOption) (*contactcenterinsightspb.ListIssuesResponse, error) { hds := []string{"x-goog-request-params", fmt.Sprintf("%s=%v", "parent", url.QueryEscape(req.GetParent()))} hds = append(c.xGoogHeaders, hds...) ctx = gax.InsertMetadataIntoOutgoingContext(ctx, hds...) opts = append((*c.CallOptions).ListIssues[0:len((*c.CallOptions).ListIssues):len((*c.CallOptions).ListIssues)], opts...) var resp *contactcenterinsightspb.ListIssuesResponse err := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error { var err error resp, err = executeRPC(ctx, c.client.ListIssues, req, settings.GRPC, c.logger, "ListIssues") return err }, opts...) if err != nil { return nil, err } return resp, nil } func (c *gRPCClient) UpdateIssue(ctx context.Context, req *contactcenterinsightspb.UpdateIssueRequest, opts ...gax.CallOption) (*contactcenterinsightspb.Issue, error) { hds := []string{"x-goog-request-params", fmt.Sprintf("%s=%v", "issue.name", url.QueryEscape(req.GetIssue().GetName()))} hds = append(c.xGoogHeaders, hds...) ctx = gax.InsertMetadataIntoOutgoingContext(ctx, hds...) opts = append((*c.CallOptions).UpdateIssue[0:len((*c.CallOptions).UpdateIssue):len((*c.CallOptions).UpdateIssue)], opts...) var resp *contactcenterinsightspb.Issue err := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error { var err error resp, err = executeRPC(ctx, c.client.UpdateIssue, req, settings.GRPC, c.logger, "UpdateIssue") return err }, opts...) if err != nil { return nil, err } return resp, nil } func (c *gRPCClient) DeleteIssue(ctx context.Context, req *contactcenterinsightspb.DeleteIssueRequest, opts ...gax.CallOption) error { hds := []string{"x-goog-request-params", fmt.Sprintf("%s=%v", "name", url.QueryEscape(req.GetName()))} hds = append(c.xGoogHeaders, hds...) ctx = gax.InsertMetadataIntoOutgoingContext(ctx, hds...) opts = append((*c.CallOptions).DeleteIssue[0:len((*c.CallOptions).DeleteIssue):len((*c.CallOptions).DeleteIssue)], opts...) err := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error { var err error _, err = executeRPC(ctx, c.client.DeleteIssue, req, settings.GRPC, c.logger, "DeleteIssue") return err }, opts...) return err } func (c *gRPCClient) CalculateIssueModelStats(ctx context.Context, req *contactcenterinsightspb.CalculateIssueModelStatsRequest, opts ...gax.CallOption) (*contactcenterinsightspb.CalculateIssueModelStatsResponse, error) { hds := []string{"x-goog-request-params", fmt.Sprintf("%s=%v", "issue_model", url.QueryEscape(req.GetIssueModel()))} hds = append(c.xGoogHeaders, hds...) ctx = gax.InsertMetadataIntoOutgoingContext(ctx, hds...) opts = append((*c.CallOptions).CalculateIssueModelStats[0:len((*c.CallOptions).CalculateIssueModelStats):len((*c.CallOptions).CalculateIssueModelStats)], opts...) var resp *contactcenterinsightspb.CalculateIssueModelStatsResponse err := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error { var err error resp, err = executeRPC(ctx, c.client.CalculateIssueModelStats, req, settings.GRPC, c.logger, "CalculateIssueModelStats") return err }, opts...) if err != nil { return nil, err } return resp, nil } func (c *gRPCClient) CreatePhraseMatcher(ctx context.Context, req *contactcenterinsightspb.CreatePhraseMatcherRequest, opts ...gax.CallOption) (*contactcenterinsightspb.PhraseMatcher, error) { hds := []string{"x-goog-request-params", fmt.Sprintf("%s=%v", "parent", url.QueryEscape(req.GetParent()))} hds = append(c.xGoogHeaders, hds...) ctx = gax.InsertMetadataIntoOutgoingContext(ctx, hds...) opts = append((*c.CallOptions).CreatePhraseMatcher[0:len((*c.CallOptions).CreatePhraseMatcher):len((*c.CallOptions).CreatePhraseMatcher)], opts...) var resp *contactcenterinsightspb.PhraseMatcher err := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error { var err error resp, err = executeRPC(ctx, c.client.CreatePhraseMatcher, req, settings.GRPC, c.logger, "CreatePhraseMatcher") return err }, opts...) if err != nil { return nil, err } return resp, nil } func (c *gRPCClient) GetPhraseMatcher(ctx context.Context, req *contactcenterinsightspb.GetPhraseMatcherRequest, opts ...gax.CallOption) (*contactcenterinsightspb.PhraseMatcher, error) { hds := []string{"x-goog-request-params", fmt.Sprintf("%s=%v", "name", url.QueryEscape(req.GetName()))} hds = append(c.xGoogHeaders, hds...) ctx = gax.InsertMetadataIntoOutgoingContext(ctx, hds...) opts = append((*c.CallOptions).GetPhraseMatcher[0:len((*c.CallOptions).GetPhraseMatcher):len((*c.CallOptions).GetPhraseMatcher)], opts...) var resp *contactcenterinsightspb.PhraseMatcher err := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error { var err error resp, err = executeRPC(ctx, c.client.GetPhraseMatcher, req, settings.GRPC, c.logger, "GetPhraseMatcher") return err }, opts...) if err != nil { return nil, err } return resp, nil } func (c *gRPCClient) ListPhraseMatchers(ctx context.Context, req *contactcenterinsightspb.ListPhraseMatchersRequest, opts ...gax.CallOption) *PhraseMatcherIterator { hds := []string{"x-goog-request-params", fmt.Sprintf("%s=%v", "parent", url.QueryEscape(req.GetParent()))} hds = append(c.xGoogHeaders, hds...) ctx = gax.InsertMetadataIntoOutgoingContext(ctx, hds...) opts = append((*c.CallOptions).ListPhraseMatchers[0:len((*c.CallOptions).ListPhraseMatchers):len((*c.CallOptions).ListPhraseMatchers)], opts...) it := &PhraseMatcherIterator{} req = proto.Clone(req).(*contactcenterinsightspb.ListPhraseMatchersRequest) it.InternalFetch = func(pageSize int, pageToken string) ([]*contactcenterinsightspb.PhraseMatcher, string, error) { resp := &contactcenterinsightspb.ListPhraseMatchersResponse{} if pageToken != "" { req.PageToken = pageToken } if pageSize > math.MaxInt32 { req.PageSize = math.MaxInt32 } else if pageSize != 0 { req.PageSize = int32(pageSize) } err := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error { var err error resp, err = executeRPC(ctx, c.client.ListPhraseMatchers, req, settings.GRPC, c.logger, "ListPhraseMatchers") return err }, opts...) if err != nil { return nil, "", err } it.Response = resp return resp.GetPhraseMatchers(), resp.GetNextPageToken(), 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.GetPageSize()) it.pageInfo.Token = req.GetPageToken() return it } func (c *gRPCClient) DeletePhraseMatcher(ctx context.Context, req *contactcenterinsightspb.DeletePhraseMatcherRequest, opts ...gax.CallOption) error { hds := []string{"x-goog-request-params", fmt.Sprintf("%s=%v", "name", url.QueryEscape(req.GetName()))} hds = append(c.xGoogHeaders, hds...) ctx = gax.InsertMetadataIntoOutgoingContext(ctx, hds...) opts = append((*c.CallOptions).DeletePhraseMatcher[0:len((*c.CallOptions).DeletePhraseMatcher):len((*c.CallOptions).DeletePhraseMatcher)], opts...) err := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error { var err error _, err = executeRPC(ctx, c.client.DeletePhraseMatcher, req, settings.GRPC, c.logger, "DeletePhraseMatcher") return err }, opts...) return err } func (c *gRPCClient) UpdatePhraseMatcher(ctx context.Context, req *contactcenterinsightspb.UpdatePhraseMatcherRequest, opts ...gax.CallOption) (*contactcenterinsightspb.PhraseMatcher, error) { hds := []string{"x-goog-request-params", fmt.Sprintf("%s=%v", "phrase_matcher.name", url.QueryEscape(req.GetPhraseMatcher().GetName()))} hds = append(c.xGoogHeaders, hds...) ctx = gax.InsertMetadataIntoOutgoingContext(ctx, hds...) opts = append((*c.CallOptions).UpdatePhraseMatcher[0:len((*c.CallOptions).UpdatePhraseMatcher):len((*c.CallOptions).UpdatePhraseMatcher)], opts...) var resp *contactcenterinsightspb.PhraseMatcher err := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error { var err error resp, err = executeRPC(ctx, c.client.UpdatePhraseMatcher, req, settings.GRPC, c.logger, "UpdatePhraseMatcher") return err }, opts...) if err != nil { return nil, err } return resp, nil } func (c *gRPCClient) CalculateStats(ctx context.Context, req *contactcenterinsightspb.CalculateStatsRequest, opts ...gax.CallOption) (*contactcenterinsightspb.CalculateStatsResponse, error) { hds := []string{"x-goog-request-params", fmt.Sprintf("%s=%v", "location", url.QueryEscape(req.GetLocation()))} hds = append(c.xGoogHeaders, hds...) ctx = gax.InsertMetadataIntoOutgoingContext(ctx, hds...) opts = append((*c.CallOptions).CalculateStats[0:len((*c.CallOptions).CalculateStats):len((*c.CallOptions).CalculateStats)], opts...) var resp *contactcenterinsightspb.CalculateStatsResponse err := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error { var err error resp, err = executeRPC(ctx, c.client.CalculateStats, req, settings.GRPC, c.logger, "CalculateStats") return err }, opts...) if err != nil { return nil, err } return resp, nil } func (c *gRPCClient) GetSettings(ctx context.Context, req *contactcenterinsightspb.GetSettingsRequest, opts ...gax.CallOption) (*contactcenterinsightspb.Settings, error) { hds := []string{"x-goog-request-params", fmt.Sprintf("%s=%v", "name", url.QueryEscape(req.GetName()))} hds = append(c.xGoogHeaders, hds...) ctx = gax.InsertMetadataIntoOutgoingContext(ctx, hds...) opts = append((*c.CallOptions).GetSettings[0:len((*c.CallOptions).GetSettings):len((*c.CallOptions).GetSettings)], opts...) var resp *contactcenterinsightspb.Settings err := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error { var err error resp, err = executeRPC(ctx, c.client.GetSettings, req, settings.GRPC, c.logger, "GetSettings") return err }, opts...) if err != nil { return nil, err } return resp, nil } func (c *gRPCClient) UpdateSettings(ctx context.Context, req *contactcenterinsightspb.UpdateSettingsRequest, opts ...gax.CallOption) (*contactcenterinsightspb.Settings, error) { hds := []string{"x-goog-request-params", fmt.Sprintf("%s=%v", "settings.name", url.QueryEscape(req.GetSettings().GetName()))} hds = append(c.xGoogHeaders, hds...) ctx = gax.InsertMetadataIntoOutgoingContext(ctx, hds...) opts = append((*c.CallOptions).UpdateSettings[0:len((*c.CallOptions).UpdateSettings):len((*c.CallOptions).UpdateSettings)], opts...) var resp *contactcenterinsightspb.Settings err := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error { var err error resp, err = executeRPC(ctx, c.client.UpdateSettings, req, settings.GRPC, c.logger, "UpdateSettings") return err }, opts...) if err != nil { return nil, err } return resp, nil } func (c *gRPCClient) CreateAnalysisRule(ctx context.Context, req *contactcenterinsightspb.CreateAnalysisRuleRequest, opts ...gax.CallOption) (*contactcenterinsightspb.AnalysisRule, error) { hds := []string{"x-goog-request-params", fmt.Sprintf("%s=%v", "parent", url.QueryEscape(req.GetParent()))} hds = append(c.xGoogHeaders, hds...) ctx = gax.InsertMetadataIntoOutgoingContext(ctx, hds...) opts = append((*c.CallOptions).CreateAnalysisRule[0:len((*c.CallOptions).CreateAnalysisRule):len((*c.CallOptions).CreateAnalysisRule)], opts...) var resp *contactcenterinsightspb.AnalysisRule err := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error { var err error resp, err = executeRPC(ctx, c.client.CreateAnalysisRule, req, settings.GRPC, c.logger, "CreateAnalysisRule") return err }, opts...) if err != nil { return nil, err } return resp, nil } func (c *gRPCClient) GetAnalysisRule(ctx context.Context, req *contactcenterinsightspb.GetAnalysisRuleRequest, opts ...gax.CallOption) (*contactcenterinsightspb.AnalysisRule, error) { hds := []string{"x-goog-request-params", fmt.Sprintf("%s=%v", "name", url.QueryEscape(req.GetName()))} hds = append(c.xGoogHeaders, hds...) ctx = gax.InsertMetadataIntoOutgoingContext(ctx, hds...) opts = append((*c.CallOptions).GetAnalysisRule[0:len((*c.CallOptions).GetAnalysisRule):len((*c.CallOptions).GetAnalysisRule)], opts...) var resp *contactcenterinsightspb.AnalysisRule err := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error { var err error resp, err = executeRPC(ctx, c.client.GetAnalysisRule, req, settings.GRPC, c.logger, "GetAnalysisRule") return err }, opts...) if err != nil { return nil, err } return resp, nil } func (c *gRPCClient) ListAnalysisRules(ctx context.Context, req *contactcenterinsightspb.ListAnalysisRulesRequest, opts ...gax.CallOption) *AnalysisRuleIterator { hds := []string{"x-goog-request-params", fmt.Sprintf("%s=%v", "parent", url.QueryEscape(req.GetParent()))} hds = append(c.xGoogHeaders, hds...) ctx = gax.InsertMetadataIntoOutgoingContext(ctx, hds...) opts = append((*c.CallOptions).ListAnalysisRules[0:len((*c.CallOptions).ListAnalysisRules):len((*c.CallOptions).ListAnalysisRules)], opts...) it := &AnalysisRuleIterator{} req = proto.Clone(req).(*contactcenterinsightspb.ListAnalysisRulesRequest) it.InternalFetch = func(pageSize int, pageToken string) ([]*contactcenterinsightspb.AnalysisRule, string, error) { resp := &contactcenterinsightspb.ListAnalysisRulesResponse{} if pageToken != "" { req.PageToken = pageToken } if pageSize > math.MaxInt32 { req.PageSize = math.MaxInt32 } else if pageSize != 0 { req.PageSize = int32(pageSize) } err := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error { var err error resp, err = executeRPC(ctx, c.client.ListAnalysisRules, req, settings.GRPC, c.logger, "ListAnalysisRules") return err }, opts...) if err != nil { return nil, "", err } it.Response = resp return resp.GetAnalysisRules(), resp.GetNextPageToken(), 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.GetPageSize()) it.pageInfo.Token = req.GetPageToken() return it } func (c *gRPCClient) UpdateAnalysisRule(ctx context.Context, req *contactcenterinsightspb.UpdateAnalysisRuleRequest, opts ...gax.CallOption) (*contactcenterinsightspb.AnalysisRule, error) { hds := []string{"x-goog-request-params", fmt.Sprintf("%s=%v", "analysis_rule.name", url.QueryEscape(req.GetAnalysisRule().GetName()))} hds = append(c.xGoogHeaders, hds...) ctx = gax.InsertMetadataIntoOutgoingContext(ctx, hds...) opts = append((*c.CallOptions).UpdateAnalysisRule[0:len((*c.CallOptions).UpdateAnalysisRule):len((*c.CallOptions).UpdateAnalysisRule)], opts...) var resp *contactcenterinsightspb.AnalysisRule err := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error { var err error resp, err = executeRPC(ctx, c.client.UpdateAnalysisRule, req, settings.GRPC, c.logger, "UpdateAnalysisRule") return err }, opts...) if err != nil { return nil, err } return resp, nil } func (c *gRPCClient) DeleteAnalysisRule(ctx context.Context, req *contactcenterinsightspb.DeleteAnalysisRuleRequest, opts ...gax.CallOption) error { hds := []string{"x-goog-request-params", fmt.Sprintf("%s=%v", "name", url.QueryEscape(req.GetName()))} hds = append(c.xGoogHeaders, hds...) ctx = gax.InsertMetadataIntoOutgoingContext(ctx, hds...) opts = append((*c.CallOptions).DeleteAnalysisRule[0:len((*c.CallOptions).DeleteAnalysisRule):len((*c.CallOptions).DeleteAnalysisRule)], opts...) err := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error { var err error _, err = executeRPC(ctx, c.client.DeleteAnalysisRule, req, settings.GRPC, c.logger, "DeleteAnalysisRule") return err }, opts...) return err } func (c *gRPCClient) GetEncryptionSpec(ctx context.Context, req *contactcenterinsightspb.GetEncryptionSpecRequest, opts ...gax.CallOption) (*contactcenterinsightspb.EncryptionSpec, error) { hds := []string{"x-goog-request-params", fmt.Sprintf("%s=%v", "name", url.QueryEscape(req.GetName()))} hds = append(c.xGoogHeaders, hds...) ctx = gax.InsertMetadataIntoOutgoingContext(ctx, hds...) opts = append((*c.CallOptions).GetEncryptionSpec[0:len((*c.CallOptions).GetEncryptionSpec):len((*c.CallOptions).GetEncryptionSpec)], opts...) var resp *contactcenterinsightspb.EncryptionSpec err := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error { var err error resp, err = executeRPC(ctx, c.client.GetEncryptionSpec, req, settings.GRPC, c.logger, "GetEncryptionSpec") return err }, opts...) if err != nil { return nil, err } return resp, nil } func (c *gRPCClient) InitializeEncryptionSpec(ctx context.Context, req *contactcenterinsightspb.InitializeEncryptionSpecRequest, opts ...gax.CallOption) (*InitializeEncryptionSpecOperation, error) { hds := []string{"x-goog-request-params", fmt.Sprintf("%s=%v", "encryption_spec.name", url.QueryEscape(req.GetEncryptionSpec().GetName()))} hds = append(c.xGoogHeaders, hds...) ctx = gax.InsertMetadataIntoOutgoingContext(ctx, hds...) opts = append((*c.CallOptions).InitializeEncryptionSpec[0:len((*c.CallOptions).InitializeEncryptionSpec):len((*c.CallOptions).InitializeEncryptionSpec)], opts...) var resp *longrunningpb.Operation err := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error { var err error resp, err = executeRPC(ctx, c.client.InitializeEncryptionSpec, req, settings.GRPC, c.logger, "InitializeEncryptionSpec") return err }, opts...) if err != nil { return nil, err } return &InitializeEncryptionSpecOperation{ lro: longrunning.InternalNewOperation(*c.LROClient, resp), }, nil } func (c *gRPCClient) CreateView(ctx context.Context, req *contactcenterinsightspb.CreateViewRequest, opts ...gax.CallOption) (*contactcenterinsightspb.View, error) { hds := []string{"x-goog-request-params", fmt.Sprintf("%s=%v", "parent", url.QueryEscape(req.GetParent()))} hds = append(c.xGoogHeaders, hds...) ctx = gax.InsertMetadataIntoOutgoingContext(ctx, hds...) opts = append((*c.CallOptions).CreateView[0:len((*c.CallOptions).CreateView):len((*c.CallOptions).CreateView)], opts...) var resp *contactcenterinsightspb.View err := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error { var err error resp, err = executeRPC(ctx, c.client.CreateView, req, settings.GRPC, c.logger, "CreateView") return err }, opts...) if err != nil { return nil, err } return resp, nil } func (c *gRPCClient) GetView(ctx context.Context, req *contactcenterinsightspb.GetViewRequest, opts ...gax.CallOption) (*contactcenterinsightspb.View, error) { hds := []string{"x-goog-request-params", fmt.Sprintf("%s=%v", "name", url.QueryEscape(req.GetName()))} hds = append(c.xGoogHeaders, hds...) ctx = gax.InsertMetadataIntoOutgoingContext(ctx, hds...) opts = append((*c.CallOptions).GetView[0:len((*c.CallOptions).GetView):len((*c.CallOptions).GetView)], opts...) var resp *contactcenterinsightspb.View err := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error { var err error resp, err = executeRPC(ctx, c.client.GetView, req, settings.GRPC, c.logger, "GetView") return err }, opts...) if err != nil { return nil, err } return resp, nil } func (c *gRPCClient) ListViews(ctx context.Context, req *contactcenterinsightspb.ListViewsRequest, opts ...gax.CallOption) *ViewIterator { hds := []string{"x-goog-request-params", fmt.Sprintf("%s=%v", "parent", url.QueryEscape(req.GetParent()))} hds = append(c.xGoogHeaders, hds...) ctx = gax.InsertMetadataIntoOutgoingContext(ctx, hds...) opts = append((*c.CallOptions).ListViews[0:len((*c.CallOptions).ListViews):len((*c.CallOptions).ListViews)], opts...) it := &ViewIterator{} req = proto.Clone(req).(*contactcenterinsightspb.ListViewsRequest) it.InternalFetch = func(pageSize int, pageToken string) ([]*contactcenterinsightspb.View, string, error) { resp := &contactcenterinsightspb.ListViewsResponse{} if pageToken != "" { req.PageToken = pageToken } if pageSize > math.MaxInt32 { req.PageSize = math.MaxInt32 } else if pageSize != 0 { req.PageSize = int32(pageSize) } err := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error { var err error resp, err = executeRPC(ctx, c.client.ListViews, req, settings.GRPC, c.logger, "ListViews") return err }, opts...) if err != nil { return nil, "", err } it.Response = resp return resp.GetViews(), resp.GetNextPageToken(), 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.GetPageSize()) it.pageInfo.Token = req.GetPageToken() return it } func (c *gRPCClient) UpdateView(ctx context.Context, req *contactcenterinsightspb.UpdateViewRequest, opts ...gax.CallOption) (*contactcenterinsightspb.View, error) { hds := []string{"x-goog-request-params", fmt.Sprintf("%s=%v", "view.name", url.QueryEscape(req.GetView().GetName()))} hds = append(c.xGoogHeaders, hds...) ctx = gax.InsertMetadataIntoOutgoingContext(ctx, hds...) opts = append((*c.CallOptions).UpdateView[0:len((*c.CallOptions).UpdateView):len((*c.CallOptions).UpdateView)], opts...) var resp *contactcenterinsightspb.View err := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error { var err error resp, err = executeRPC(ctx, c.client.UpdateView, req, settings.GRPC, c.logger, "UpdateView") return err }, opts...) if err != nil { return nil, err } return resp, nil } func (c *gRPCClient) DeleteView(ctx context.Context, req *contactcenterinsightspb.DeleteViewRequest, opts ...gax.CallOption) error { hds := []string{"x-goog-request-params", fmt.Sprintf("%s=%v", "name", url.QueryEscape(req.GetName()))} hds = append(c.xGoogHeaders, hds...) ctx = gax.InsertMetadataIntoOutgoingContext(ctx, hds...) opts = append((*c.CallOptions).DeleteView[0:len((*c.CallOptions).DeleteView):len((*c.CallOptions).DeleteView)], opts...) err := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error { var err error _, err = executeRPC(ctx, c.client.DeleteView, req, settings.GRPC, c.logger, "DeleteView") return err }, opts...) return err } func (c *gRPCClient) QueryMetrics(ctx context.Context, req *contactcenterinsightspb.QueryMetricsRequest, opts ...gax.CallOption) (*QueryMetricsOperation, error) { hds := []string{"x-goog-request-params", fmt.Sprintf("%s=%v", "location", url.QueryEscape(req.GetLocation()))} hds = append(c.xGoogHeaders, hds...) ctx = gax.InsertMetadataIntoOutgoingContext(ctx, hds...) opts = append((*c.CallOptions).QueryMetrics[0:len((*c.CallOptions).QueryMetrics):len((*c.CallOptions).QueryMetrics)], opts...) var resp *longrunningpb.Operation err := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error { var err error resp, err = executeRPC(ctx, c.client.QueryMetrics, req, settings.GRPC, c.logger, "QueryMetrics") return err }, opts...) if err != nil { return nil, err } return &QueryMetricsOperation{ lro: longrunning.InternalNewOperation(*c.LROClient, resp), }, nil } func (c *gRPCClient) CreateQaQuestion(ctx context.Context, req *contactcenterinsightspb.CreateQaQuestionRequest, opts ...gax.CallOption) (*contactcenterinsightspb.QaQuestion, error) { hds := []string{"x-goog-request-params", fmt.Sprintf("%s=%v", "parent", url.QueryEscape(req.GetParent()))} hds = append(c.xGoogHeaders, hds...) ctx = gax.InsertMetadataIntoOutgoingContext(ctx, hds...) opts = append((*c.CallOptions).CreateQaQuestion[0:len((*c.CallOptions).CreateQaQuestion):len((*c.CallOptions).CreateQaQuestion)], opts...) var resp *contactcenterinsightspb.QaQuestion err := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error { var err error resp, err = executeRPC(ctx, c.client.CreateQaQuestion, req, settings.GRPC, c.logger, "CreateQaQuestion") return err }, opts...) if err != nil { return nil, err } return resp, nil } func (c *gRPCClient) GetQaQuestion(ctx context.Context, req *contactcenterinsightspb.GetQaQuestionRequest, opts ...gax.CallOption) (*contactcenterinsightspb.QaQuestion, error) { hds := []string{"x-goog-request-params", fmt.Sprintf("%s=%v", "name", url.QueryEscape(req.GetName()))} hds = append(c.xGoogHeaders, hds...) ctx = gax.InsertMetadataIntoOutgoingContext(ctx, hds...) opts = append((*c.CallOptions).GetQaQuestion[0:len((*c.CallOptions).GetQaQuestion):len((*c.CallOptions).GetQaQuestion)], opts...) var resp *contactcenterinsightspb.QaQuestion err := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error { var err error resp, err = executeRPC(ctx, c.client.GetQaQuestion, req, settings.GRPC, c.logger, "GetQaQuestion") return err }, opts...) if err != nil { return nil, err } return resp, nil } func (c *gRPCClient) UpdateQaQuestion(ctx context.Context, req *contactcenterinsightspb.UpdateQaQuestionRequest, opts ...gax.CallOption) (*contactcenterinsightspb.QaQuestion, error) { hds := []string{"x-goog-request-params", fmt.Sprintf("%s=%v", "qa_question.name", url.QueryEscape(req.GetQaQuestion().GetName()))} hds = append(c.xGoogHeaders, hds...) ctx = gax.InsertMetadataIntoOutgoingContext(ctx, hds...) opts = append((*c.CallOptions).UpdateQaQuestion[0:len((*c.CallOptions).UpdateQaQuestion):len((*c.CallOptions).UpdateQaQuestion)], opts...) var resp *contactcenterinsightspb.QaQuestion err := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error { var err error resp, err = executeRPC(ctx, c.client.UpdateQaQuestion, req, settings.GRPC, c.logger, "UpdateQaQuestion") return err }, opts...) if err != nil { return nil, err } return resp, nil } func (c *gRPCClient) DeleteQaQuestion(ctx context.Context, req *contactcenterinsightspb.DeleteQaQuestionRequest, opts ...gax.CallOption) error { hds := []string{"x-goog-request-params", fmt.Sprintf("%s=%v", "name", url.QueryEscape(req.GetName()))} hds = append(c.xGoogHeaders, hds...) ctx = gax.InsertMetadataIntoOutgoingContext(ctx, hds...) opts = append((*c.CallOptions).DeleteQaQuestion[0:len((*c.CallOptions).DeleteQaQuestion):len((*c.CallOptions).DeleteQaQuestion)], opts...) err := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error { var err error _, err = executeRPC(ctx, c.client.DeleteQaQuestion, req, settings.GRPC, c.logger, "DeleteQaQuestion") return err }, opts...) return err } func (c *gRPCClient) ListQaQuestions(ctx context.Context, req *contactcenterinsightspb.ListQaQuestionsRequest, opts ...gax.CallOption) *QaQuestionIterator { hds := []string{"x-goog-request-params", fmt.Sprintf("%s=%v", "parent", url.QueryEscape(req.GetParent()))} hds = append(c.xGoogHeaders, hds...) ctx = gax.InsertMetadataIntoOutgoingContext(ctx, hds...) opts = append((*c.CallOptions).ListQaQuestions[0:len((*c.CallOptions).ListQaQuestions):len((*c.CallOptions).ListQaQuestions)], opts...) it := &QaQuestionIterator{} req = proto.Clone(req).(*contactcenterinsightspb.ListQaQuestionsRequest) it.InternalFetch = func(pageSize int, pageToken string) ([]*contactcenterinsightspb.QaQuestion, string, error) { resp := &contactcenterinsightspb.ListQaQuestionsResponse{} if pageToken != "" { req.PageToken = pageToken } if pageSize > math.MaxInt32 { req.PageSize = math.MaxInt32 } else if pageSize != 0 { req.PageSize = int32(pageSize) } err := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error { var err error resp, err = executeRPC(ctx, c.client.ListQaQuestions, req, settings.GRPC, c.logger, "ListQaQuestions") return err }, opts...) if err != nil { return nil, "", err } it.Response = resp return resp.GetQaQuestions(), resp.GetNextPageToken(), 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.GetPageSize()) it.pageInfo.Token = req.GetPageToken() return it } func (c *gRPCClient) CreateQaScorecard(ctx context.Context, req *contactcenterinsightspb.CreateQaScorecardRequest, opts ...gax.CallOption) (*contactcenterinsightspb.QaScorecard, error) { hds := []string{"x-goog-request-params", fmt.Sprintf("%s=%v", "parent", url.QueryEscape(req.GetParent()))} hds = append(c.xGoogHeaders, hds...) ctx = gax.InsertMetadataIntoOutgoingContext(ctx, hds...) opts = append((*c.CallOptions).CreateQaScorecard[0:len((*c.CallOptions).CreateQaScorecard):len((*c.CallOptions).CreateQaScorecard)], opts...) var resp *contactcenterinsightspb.QaScorecard err := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error { var err error resp, err = executeRPC(ctx, c.client.CreateQaScorecard, req, settings.GRPC, c.logger, "CreateQaScorecard") return err }, opts...) if err != nil { return nil, err } return resp, nil } func (c *gRPCClient) GetQaScorecard(ctx context.Context, req *contactcenterinsightspb.GetQaScorecardRequest, opts ...gax.CallOption) (*contactcenterinsightspb.QaScorecard, error) { hds := []string{"x-goog-request-params", fmt.Sprintf("%s=%v", "name", url.QueryEscape(req.GetName()))} hds = append(c.xGoogHeaders, hds...) ctx = gax.InsertMetadataIntoOutgoingContext(ctx, hds...) opts = append((*c.CallOptions).GetQaScorecard[0:len((*c.CallOptions).GetQaScorecard):len((*c.CallOptions).GetQaScorecard)], opts...) var resp *contactcenterinsightspb.QaScorecard err := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error { var err error resp, err = executeRPC(ctx, c.client.GetQaScorecard, req, settings.GRPC, c.logger, "GetQaScorecard") return err }, opts...) if err != nil { return nil, err } return resp, nil } func (c *gRPCClient) UpdateQaScorecard(ctx context.Context, req *contactcenterinsightspb.UpdateQaScorecardRequest, opts ...gax.CallOption) (*contactcenterinsightspb.QaScorecard, error) { hds := []string{"x-goog-request-params", fmt.Sprintf("%s=%v", "qa_scorecard.name", url.QueryEscape(req.GetQaScorecard().GetName()))} hds = append(c.xGoogHeaders, hds...) ctx = gax.InsertMetadataIntoOutgoingContext(ctx, hds...) opts = append((*c.CallOptions).UpdateQaScorecard[0:len((*c.CallOptions).UpdateQaScorecard):len((*c.CallOptions).UpdateQaScorecard)], opts...) var resp *contactcenterinsightspb.QaScorecard err := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error { var err error resp, err = executeRPC(ctx, c.client.UpdateQaScorecard, req, settings.GRPC, c.logger, "UpdateQaScorecard") return err }, opts...) if err != nil { return nil, err } return resp, nil } func (c *gRPCClient) DeleteQaScorecard(ctx context.Context, req *contactcenterinsightspb.DeleteQaScorecardRequest, opts ...gax.CallOption) error { hds := []string{"x-goog-request-params", fmt.Sprintf("%s=%v", "name", url.QueryEscape(req.GetName()))} hds = append(c.xGoogHeaders, hds...) ctx = gax.InsertMetadataIntoOutgoingContext(ctx, hds...) opts = append((*c.CallOptions).DeleteQaScorecard[0:len((*c.CallOptions).DeleteQaScorecard):len((*c.CallOptions).DeleteQaScorecard)], opts...) err := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error { var err error _, err = executeRPC(ctx, c.client.DeleteQaScorecard, req, settings.GRPC, c.logger, "DeleteQaScorecard") return err }, opts...) return err } func (c *gRPCClient) ListQaScorecards(ctx context.Context, req *contactcenterinsightspb.ListQaScorecardsRequest, opts ...gax.CallOption) *QaScorecardIterator { hds := []string{"x-goog-request-params", fmt.Sprintf("%s=%v", "parent", url.QueryEscape(req.GetParent()))} hds = append(c.xGoogHeaders, hds...) ctx = gax.InsertMetadataIntoOutgoingContext(ctx, hds...) opts = append((*c.CallOptions).ListQaScorecards[0:len((*c.CallOptions).ListQaScorecards):len((*c.CallOptions).ListQaScorecards)], opts...) it := &QaScorecardIterator{} req = proto.Clone(req).(*contactcenterinsightspb.ListQaScorecardsRequest) it.InternalFetch = func(pageSize int, pageToken string) ([]*contactcenterinsightspb.QaScorecard, string, error) { resp := &contactcenterinsightspb.ListQaScorecardsResponse{} if pageToken != "" { req.PageToken = pageToken } if pageSize > math.MaxInt32 { req.PageSize = math.MaxInt32 } else if pageSize != 0 { req.PageSize = int32(pageSize) } err := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error { var err error resp, err = executeRPC(ctx, c.client.ListQaScorecards, req, settings.GRPC, c.logger, "ListQaScorecards") return err }, opts...) if err != nil { return nil, "", err } it.Response = resp return resp.GetQaScorecards(), resp.GetNextPageToken(), 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.GetPageSize()) it.pageInfo.Token = req.GetPageToken() return it } func (c *gRPCClient) CreateQaScorecardRevision(ctx context.Context, req *contactcenterinsightspb.CreateQaScorecardRevisionRequest, opts ...gax.CallOption) (*contactcenterinsightspb.QaScorecardRevision, error) { hds := []string{"x-goog-request-params", fmt.Sprintf("%s=%v", "parent", url.QueryEscape(req.GetParent()))} hds = append(c.xGoogHeaders, hds...) ctx = gax.InsertMetadataIntoOutgoingContext(ctx, hds...) opts = append((*c.CallOptions).CreateQaScorecardRevision[0:len((*c.CallOptions).CreateQaScorecardRevision):len((*c.CallOptions).CreateQaScorecardRevision)], opts...) var resp *contactcenterinsightspb.QaScorecardRevision err := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error { var err error resp, err = executeRPC(ctx, c.client.CreateQaScorecardRevision, req, settings.GRPC, c.logger, "CreateQaScorecardRevision") return err }, opts...) if err != nil { return nil, err } return resp, nil } func (c *gRPCClient) GetQaScorecardRevision(ctx context.Context, req *contactcenterinsightspb.GetQaScorecardRevisionRequest, opts ...gax.CallOption) (*contactcenterinsightspb.QaScorecardRevision, error) { hds := []string{"x-goog-request-params", fmt.Sprintf("%s=%v", "name", url.QueryEscape(req.GetName()))} hds = append(c.xGoogHeaders, hds...) ctx = gax.InsertMetadataIntoOutgoingContext(ctx, hds...) opts = append((*c.CallOptions).GetQaScorecardRevision[0:len((*c.CallOptions).GetQaScorecardRevision):len((*c.CallOptions).GetQaScorecardRevision)], opts...) var resp *contactcenterinsightspb.QaScorecardRevision err := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error { var err error resp, err = executeRPC(ctx, c.client.GetQaScorecardRevision, req, settings.GRPC, c.logger, "GetQaScorecardRevision") return err }, opts...) if err != nil { return nil, err } return resp, nil } func (c *gRPCClient) TuneQaScorecardRevision(ctx context.Context, req *contactcenterinsightspb.TuneQaScorecardRevisionRequest, opts ...gax.CallOption) (*TuneQaScorecardRevisionOperation, error) { hds := []string{"x-goog-request-params", fmt.Sprintf("%s=%v", "parent", url.QueryEscape(req.GetParent()))} hds = append(c.xGoogHeaders, hds...) ctx = gax.InsertMetadataIntoOutgoingContext(ctx, hds...) opts = append((*c.CallOptions).TuneQaScorecardRevision[0:len((*c.CallOptions).TuneQaScorecardRevision):len((*c.CallOptions).TuneQaScorecardRevision)], opts...) var resp *longrunningpb.Operation err := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error { var err error resp, err = executeRPC(ctx, c.client.TuneQaScorecardRevision, req, settings.GRPC, c.logger, "TuneQaScorecardRevision") return err }, opts...) if err != nil { return nil, err } return &TuneQaScorecardRevisionOperation{ lro: longrunning.InternalNewOperation(*c.LROClient, resp), }, nil } func (c *gRPCClient) DeployQaScorecardRevision(ctx context.Context, req *contactcenterinsightspb.DeployQaScorecardRevisionRequest, opts ...gax.CallOption) (*contactcenterinsightspb.QaScorecardRevision, error) { hds := []string{"x-goog-request-params", fmt.Sprintf("%s=%v", "name", url.QueryEscape(req.GetName()))} hds = append(c.xGoogHeaders, hds...) ctx = gax.InsertMetadataIntoOutgoingContext(ctx, hds...) opts = append((*c.CallOptions).DeployQaScorecardRevision[0:len((*c.CallOptions).DeployQaScorecardRevision):len((*c.CallOptions).DeployQaScorecardRevision)], opts...) var resp *contactcenterinsightspb.QaScorecardRevision err := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error { var err error resp, err = executeRPC(ctx, c.client.DeployQaScorecardRevision, req, settings.GRPC, c.logger, "DeployQaScorecardRevision") return err }, opts...) if err != nil { return nil, err } return resp, nil } func (c *gRPCClient) UndeployQaScorecardRevision(ctx context.Context, req *contactcenterinsightspb.UndeployQaScorecardRevisionRequest, opts ...gax.CallOption) (*contactcenterinsightspb.QaScorecardRevision, error) { hds := []string{"x-goog-request-params", fmt.Sprintf("%s=%v", "name", url.QueryEscape(req.GetName()))} hds = append(c.xGoogHeaders, hds...) ctx = gax.InsertMetadataIntoOutgoingContext(ctx, hds...) opts = append((*c.CallOptions).UndeployQaScorecardRevision[0:len((*c.CallOptions).UndeployQaScorecardRevision):len((*c.CallOptions).UndeployQaScorecardRevision)], opts...) var resp *contactcenterinsightspb.QaScorecardRevision err := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error { var err error resp, err = executeRPC(ctx, c.client.UndeployQaScorecardRevision, req, settings.GRPC, c.logger, "UndeployQaScorecardRevision") return err }, opts...) if err != nil { return nil, err } return resp, nil } func (c *gRPCClient) DeleteQaScorecardRevision(ctx context.Context, req *contactcenterinsightspb.DeleteQaScorecardRevisionRequest, opts ...gax.CallOption) error { hds := []string{"x-goog-request-params", fmt.Sprintf("%s=%v", "name", url.QueryEscape(req.GetName()))} hds = append(c.xGoogHeaders, hds...) ctx = gax.InsertMetadataIntoOutgoingContext(ctx, hds...) opts = append((*c.CallOptions).DeleteQaScorecardRevision[0:len((*c.CallOptions).DeleteQaScorecardRevision):len((*c.CallOptions).DeleteQaScorecardRevision)], opts...) err := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error { var err error _, err = executeRPC(ctx, c.client.DeleteQaScorecardRevision, req, settings.GRPC, c.logger, "DeleteQaScorecardRevision") return err }, opts...) return err } func (c *gRPCClient) ListQaScorecardRevisions(ctx context.Context, req *contactcenterinsightspb.ListQaScorecardRevisionsRequest, opts ...gax.CallOption) *QaScorecardRevisionIterator { hds := []string{"x-goog-request-params", fmt.Sprintf("%s=%v", "parent", url.QueryEscape(req.GetParent()))} hds = append(c.xGoogHeaders, hds...) ctx = gax.InsertMetadataIntoOutgoingContext(ctx, hds...) opts = append((*c.CallOptions).ListQaScorecardRevisions[0:len((*c.CallOptions).ListQaScorecardRevisions):len((*c.CallOptions).ListQaScorecardRevisions)], opts...) it := &QaScorecardRevisionIterator{} req = proto.Clone(req).(*contactcenterinsightspb.ListQaScorecardRevisionsRequest) it.InternalFetch = func(pageSize int, pageToken string) ([]*contactcenterinsightspb.QaScorecardRevision, string, error) { resp := &contactcenterinsightspb.ListQaScorecardRevisionsResponse{} if pageToken != "" { req.PageToken = pageToken } if pageSize > math.MaxInt32 { req.PageSize = math.MaxInt32 } else if pageSize != 0 { req.PageSize = int32(pageSize) } err := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error { var err error resp, err = executeRPC(ctx, c.client.ListQaScorecardRevisions, req, settings.GRPC, c.logger, "ListQaScorecardRevisions") return err }, opts...) if err != nil { return nil, "", err } it.Response = resp return resp.GetQaScorecardRevisions(), resp.GetNextPageToken(), 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.GetPageSize()) it.pageInfo.Token = req.GetPageToken() return it } func (c *gRPCClient) CreateFeedbackLabel(ctx context.Context, req *contactcenterinsightspb.CreateFeedbackLabelRequest, opts ...gax.CallOption) (*contactcenterinsightspb.FeedbackLabel, error) { hds := []string{"x-goog-request-params", fmt.Sprintf("%s=%v", "parent", url.QueryEscape(req.GetParent()))} hds = append(c.xGoogHeaders, hds...) ctx = gax.InsertMetadataIntoOutgoingContext(ctx, hds...) opts = append((*c.CallOptions).CreateFeedbackLabel[0:len((*c.CallOptions).CreateFeedbackLabel):len((*c.CallOptions).CreateFeedbackLabel)], opts...) var resp *contactcenterinsightspb.FeedbackLabel err := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error { var err error resp, err = executeRPC(ctx, c.client.CreateFeedbackLabel, req, settings.GRPC, c.logger, "CreateFeedbackLabel") return err }, opts...) if err != nil { return nil, err } return resp, nil } func (c *gRPCClient) ListFeedbackLabels(ctx context.Context, req *contactcenterinsightspb.ListFeedbackLabelsRequest, opts ...gax.CallOption) *FeedbackLabelIterator { hds := []string{"x-goog-request-params", fmt.Sprintf("%s=%v", "parent", url.QueryEscape(req.GetParent()))} hds = append(c.xGoogHeaders, hds...) ctx = gax.InsertMetadataIntoOutgoingContext(ctx, hds...) opts = append((*c.CallOptions).ListFeedbackLabels[0:len((*c.CallOptions).ListFeedbackLabels):len((*c.CallOptions).ListFeedbackLabels)], opts...) it := &FeedbackLabelIterator{} req = proto.Clone(req).(*contactcenterinsightspb.ListFeedbackLabelsRequest) it.InternalFetch = func(pageSize int, pageToken string) ([]*contactcenterinsightspb.FeedbackLabel, string, error) { resp := &contactcenterinsightspb.ListFeedbackLabelsResponse{} if pageToken != "" { req.PageToken = pageToken } if pageSize > math.MaxInt32 { req.PageSize = math.MaxInt32 } else if pageSize != 0 { req.PageSize = int32(pageSize) } err := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error { var err error resp, err = executeRPC(ctx, c.client.ListFeedbackLabels, req, settings.GRPC, c.logger, "ListFeedbackLabels") return err }, opts...) if err != nil { return nil, "", err } it.Response = resp return resp.GetFeedbackLabels(), resp.GetNextPageToken(), 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.GetPageSize()) it.pageInfo.Token = req.GetPageToken() return it } func (c *gRPCClient) GetFeedbackLabel(ctx context.Context, req *contactcenterinsightspb.GetFeedbackLabelRequest, opts ...gax.CallOption) (*contactcenterinsightspb.FeedbackLabel, error) { hds := []string{"x-goog-request-params", fmt.Sprintf("%s=%v", "name", url.QueryEscape(req.GetName()))} hds = append(c.xGoogHeaders, hds...) ctx = gax.InsertMetadataIntoOutgoingContext(ctx, hds...) opts = append((*c.CallOptions).GetFeedbackLabel[0:len((*c.CallOptions).GetFeedbackLabel):len((*c.CallOptions).GetFeedbackLabel)], opts...) var resp *contactcenterinsightspb.FeedbackLabel err := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error { var err error resp, err = executeRPC(ctx, c.client.GetFeedbackLabel, req, settings.GRPC, c.logger, "GetFeedbackLabel") return err }, opts...) if err != nil { return nil, err } return resp, nil } func (c *gRPCClient) UpdateFeedbackLabel(ctx context.Context, req *contactcenterinsightspb.UpdateFeedbackLabelRequest, opts ...gax.CallOption) (*contactcenterinsightspb.FeedbackLabel, error) { hds := []string{"x-goog-request-params", fmt.Sprintf("%s=%v", "feedback_label.name", url.QueryEscape(req.GetFeedbackLabel().GetName()))} hds = append(c.xGoogHeaders, hds...) ctx = gax.InsertMetadataIntoOutgoingContext(ctx, hds...) opts = append((*c.CallOptions).UpdateFeedbackLabel[0:len((*c.CallOptions).UpdateFeedbackLabel):len((*c.CallOptions).UpdateFeedbackLabel)], opts...) var resp *contactcenterinsightspb.FeedbackLabel err := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error { var err error resp, err = executeRPC(ctx, c.client.UpdateFeedbackLabel, req, settings.GRPC, c.logger, "UpdateFeedbackLabel") return err }, opts...) if err != nil { return nil, err } return resp, nil } func (c *gRPCClient) DeleteFeedbackLabel(ctx context.Context, req *contactcenterinsightspb.DeleteFeedbackLabelRequest, opts ...gax.CallOption) error { hds := []string{"x-goog-request-params", fmt.Sprintf("%s=%v", "name", url.QueryEscape(req.GetName()))} hds = append(c.xGoogHeaders, hds...) ctx = gax.InsertMetadataIntoOutgoingContext(ctx, hds...) opts = append((*c.CallOptions).DeleteFeedbackLabel[0:len((*c.CallOptions).DeleteFeedbackLabel):len((*c.CallOptions).DeleteFeedbackLabel)], opts...) err := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error { var err error _, err = executeRPC(ctx, c.client.DeleteFeedbackLabel, req, settings.GRPC, c.logger, "DeleteFeedbackLabel") return err }, opts...) return err } func (c *gRPCClient) ListAllFeedbackLabels(ctx context.Context, req *contactcenterinsightspb.ListAllFeedbackLabelsRequest, opts ...gax.CallOption) *FeedbackLabelIterator { hds := []string{"x-goog-request-params", fmt.Sprintf("%s=%v", "parent", url.QueryEscape(req.GetParent()))} hds = append(c.xGoogHeaders, hds...) ctx = gax.InsertMetadataIntoOutgoingContext(ctx, hds...) opts = append((*c.CallOptions).ListAllFeedbackLabels[0:len((*c.CallOptions).ListAllFeedbackLabels):len((*c.CallOptions).ListAllFeedbackLabels)], opts...) it := &FeedbackLabelIterator{} req = proto.Clone(req).(*contactcenterinsightspb.ListAllFeedbackLabelsRequest) it.InternalFetch = func(pageSize int, pageToken string) ([]*contactcenterinsightspb.FeedbackLabel, string, error) { resp := &contactcenterinsightspb.ListAllFeedbackLabelsResponse{} if pageToken != "" { req.PageToken = pageToken } if pageSize > math.MaxInt32 { req.PageSize = math.MaxInt32 } else if pageSize != 0 { req.PageSize = int32(pageSize) } err := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error { var err error resp, err = executeRPC(ctx, c.client.ListAllFeedbackLabels, req, settings.GRPC, c.logger, "ListAllFeedbackLabels") return err }, opts...) if err != nil { return nil, "", err } it.Response = resp return resp.GetFeedbackLabels(), resp.GetNextPageToken(), 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.GetPageSize()) it.pageInfo.Token = req.GetPageToken() return it } func (c *gRPCClient) BulkUploadFeedbackLabels(ctx context.Context, req *contactcenterinsightspb.BulkUploadFeedbackLabelsRequest, opts ...gax.CallOption) (*BulkUploadFeedbackLabelsOperation, error) { hds := []string{"x-goog-request-params", fmt.Sprintf("%s=%v", "parent", url.QueryEscape(req.GetParent()))} hds = append(c.xGoogHeaders, hds...) ctx = gax.InsertMetadataIntoOutgoingContext(ctx, hds...) opts = append((*c.CallOptions).BulkUploadFeedbackLabels[0:len((*c.CallOptions).BulkUploadFeedbackLabels):len((*c.CallOptions).BulkUploadFeedbackLabels)], opts...) var resp *longrunningpb.Operation err := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error { var err error resp, err = executeRPC(ctx, c.client.BulkUploadFeedbackLabels, req, settings.GRPC, c.logger, "BulkUploadFeedbackLabels") return err }, opts...) if err != nil { return nil, err } return &BulkUploadFeedbackLabelsOperation{ lro: longrunning.InternalNewOperation(*c.LROClient, resp), }, nil } func (c *gRPCClient) BulkDownloadFeedbackLabels(ctx context.Context, req *contactcenterinsightspb.BulkDownloadFeedbackLabelsRequest, opts ...gax.CallOption) (*BulkDownloadFeedbackLabelsOperation, error) { hds := []string{"x-goog-request-params", fmt.Sprintf("%s=%v", "parent", url.QueryEscape(req.GetParent()))} hds = append(c.xGoogHeaders, hds...) ctx = gax.InsertMetadataIntoOutgoingContext(ctx, hds...) opts = append((*c.CallOptions).BulkDownloadFeedbackLabels[0:len((*c.CallOptions).BulkDownloadFeedbackLabels):len((*c.CallOptions).BulkDownloadFeedbackLabels)], opts...) var resp *longrunningpb.Operation err := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error { var err error resp, err = executeRPC(ctx, c.client.BulkDownloadFeedbackLabels, req, settings.GRPC, c.logger, "BulkDownloadFeedbackLabels") return err }, opts...) if err != nil { return nil, err } return &BulkDownloadFeedbackLabelsOperation{ lro: longrunning.InternalNewOperation(*c.LROClient, resp), }, nil } func (c *gRPCClient) CancelOperation(ctx context.Context, req *longrunningpb.CancelOperationRequest, opts ...gax.CallOption) error { hds := []string{"x-goog-request-params", fmt.Sprintf("%s=%v", "name", url.QueryEscape(req.GetName()))} hds = append(c.xGoogHeaders, hds...) ctx = gax.InsertMetadataIntoOutgoingContext(ctx, hds...) 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 _, err = executeRPC(ctx, c.operationsClient.CancelOperation, req, settings.GRPC, c.logger, "CancelOperation") return err }, opts...) return err } func (c *gRPCClient) GetOperation(ctx context.Context, req *longrunningpb.GetOperationRequest, opts ...gax.CallOption) (*longrunningpb.Operation, error) { hds := []string{"x-goog-request-params", fmt.Sprintf("%s=%v", "name", url.QueryEscape(req.GetName()))} hds = append(c.xGoogHeaders, hds...) ctx = gax.InsertMetadataIntoOutgoingContext(ctx, hds...) 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 { var err error resp, err = executeRPC(ctx, c.operationsClient.GetOperation, req, settings.GRPC, c.logger, "GetOperation") return err }, opts...) if err != nil { return nil, err } return resp, nil } func (c *gRPCClient) ListOperations(ctx context.Context, req *longrunningpb.ListOperationsRequest, opts ...gax.CallOption) *OperationIterator { hds := []string{"x-goog-request-params", fmt.Sprintf("%s=%v", "name", url.QueryEscape(req.GetName()))} hds = append(c.xGoogHeaders, hds...) ctx = gax.InsertMetadataIntoOutgoingContext(ctx, hds...) opts = append((*c.CallOptions).ListOperations[0:len((*c.CallOptions).ListOperations):len((*c.CallOptions).ListOperations)], opts...) it := &OperationIterator{} req = proto.Clone(req).(*longrunningpb.ListOperationsRequest) it.InternalFetch = func(pageSize int, pageToken string) ([]*longrunningpb.Operation, string, error) { resp := &longrunningpb.ListOperationsResponse{} if pageToken != "" { req.PageToken = pageToken } if pageSize > math.MaxInt32 { req.PageSize = math.MaxInt32 } else if pageSize != 0 { req.PageSize = int32(pageSize) } err := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error { var err error resp, err = executeRPC(ctx, c.operationsClient.ListOperations, req, settings.GRPC, c.logger, "ListOperations") return err }, opts...) if err != nil { return nil, "", err } it.Response = resp return resp.GetOperations(), resp.GetNextPageToken(), 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.GetPageSize()) it.pageInfo.Token = req.GetPageToken() return it } // CreateConversation creates a conversation. // Note that this method does not support audio transcription or redaction. // Use conversations.upload instead. func (c *restClient) CreateConversation(ctx context.Context, req *contactcenterinsightspb.CreateConversationRequest, opts ...gax.CallOption) (*contactcenterinsightspb.Conversation, error) { m := protojson.MarshalOptions{AllowPartial: true, UseEnumNumbers: true} body := req.GetConversation() jsonReq, err := m.Marshal(body) if err != nil { return nil, err } baseUrl, err := url.Parse(c.endpoint) if err != nil { return nil, err } baseUrl.Path += fmt.Sprintf("/v1/%v/conversations", req.GetParent()) params := url.Values{} params.Add("$alt", "json;enum-encoding=int") if req.GetConversationId() != "" { params.Add("conversationId", fmt.Sprintf("%v", req.GetConversationId())) } baseUrl.RawQuery = params.Encode() // Build HTTP headers from client and context metadata. hds := []string{"x-goog-request-params", fmt.Sprintf("%s=%v", "parent", url.QueryEscape(req.GetParent()))} hds = append(c.xGoogHeaders, hds...) hds = append(hds, "Content-Type", "application/json") headers := gax.BuildHeaders(ctx, hds...) opts = append((*c.CallOptions).CreateConversation[0:len((*c.CallOptions).CreateConversation):len((*c.CallOptions).CreateConversation)], opts...) unm := protojson.UnmarshalOptions{AllowPartial: true, DiscardUnknown: true} resp := &contactcenterinsightspb.Conversation{} e := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error { if settings.Path != "" { baseUrl.Path = settings.Path } httpReq, err := http.NewRequest("POST", baseUrl.String(), bytes.NewReader(jsonReq)) if err != nil { return err } httpReq = httpReq.WithContext(ctx) httpReq.Header = headers buf, err := executeHTTPRequest(ctx, c.httpClient, httpReq, c.logger, jsonReq, "CreateConversation") if err != nil { return err } if err := unm.Unmarshal(buf, resp); err != nil { return err } return nil }, opts...) if e != nil { return nil, e } return resp, nil } // UploadConversation create a long-running conversation upload operation. This method differs // from CreateConversation by allowing audio transcription and optional DLP // redaction. func (c *restClient) UploadConversation(ctx context.Context, req *contactcenterinsightspb.UploadConversationRequest, opts ...gax.CallOption) (*UploadConversationOperation, error) { m := protojson.MarshalOptions{AllowPartial: true, UseEnumNumbers: true} jsonReq, err := m.Marshal(req) if err != nil { return nil, err } baseUrl, err := url.Parse(c.endpoint) if err != nil { return nil, err } baseUrl.Path += fmt.Sprintf("/v1/%v/conversations:upload", req.GetParent()) params := url.Values{} params.Add("$alt", "json;enum-encoding=int") baseUrl.RawQuery = params.Encode() // Build HTTP headers from client and context metadata. hds := []string{"x-goog-request-params", fmt.Sprintf("%s=%v", "parent", url.QueryEscape(req.GetParent()))} hds = append(c.xGoogHeaders, hds...) hds = append(hds, "Content-Type", "application/json") headers := gax.BuildHeaders(ctx, hds...) unm := protojson.UnmarshalOptions{AllowPartial: true, DiscardUnknown: true} resp := &longrunningpb.Operation{} e := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error { if settings.Path != "" { baseUrl.Path = settings.Path } httpReq, err := http.NewRequest("POST", baseUrl.String(), bytes.NewReader(jsonReq)) if err != nil { return err } httpReq = httpReq.WithContext(ctx) httpReq.Header = headers buf, err := executeHTTPRequest(ctx, c.httpClient, httpReq, c.logger, jsonReq, "UploadConversation") if err != nil { return err } if err := unm.Unmarshal(buf, resp); err != nil { return err } return nil }, opts...) if e != nil { return nil, e } override := fmt.Sprintf("/v1/%s", resp.GetName()) return &UploadConversationOperation{ lro: longrunning.InternalNewOperation(*c.LROClient, resp), pollPath: override, }, nil } // UpdateConversation updates a conversation. func (c *restClient) UpdateConversation(ctx context.Context, req *contactcenterinsightspb.UpdateConversationRequest, opts ...gax.CallOption) (*contactcenterinsightspb.Conversation, error) { m := protojson.MarshalOptions{AllowPartial: true, UseEnumNumbers: true} body := req.GetConversation() jsonReq, err := m.Marshal(body) if err != nil { return nil, err } baseUrl, err := url.Parse(c.endpoint) if err != nil { return nil, err } baseUrl.Path += fmt.Sprintf("/v1/%v", req.GetConversation().GetName()) params := url.Values{} params.Add("$alt", "json;enum-encoding=int") if req.GetUpdateMask() != nil { field, err := protojson.Marshal(req.GetUpdateMask()) if err != nil { return nil, err } params.Add("updateMask", string(field[1:len(field)-1])) } baseUrl.RawQuery = params.Encode() // Build HTTP headers from client and context metadata. hds := []string{"x-goog-request-params", fmt.Sprintf("%s=%v", "conversation.name", url.QueryEscape(req.GetConversation().GetName()))} hds = append(c.xGoogHeaders, hds...) hds = append(hds, "Content-Type", "application/json") headers := gax.BuildHeaders(ctx, hds...) opts = append((*c.CallOptions).UpdateConversation[0:len((*c.CallOptions).UpdateConversation):len((*c.CallOptions).UpdateConversation)], opts...) unm := protojson.UnmarshalOptions{AllowPartial: true, DiscardUnknown: true} resp := &contactcenterinsightspb.Conversation{} e := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error { if settings.Path != "" { baseUrl.Path = settings.Path } httpReq, err := http.NewRequest("PATCH", baseUrl.String(), bytes.NewReader(jsonReq)) if err != nil { return err } httpReq = httpReq.WithContext(ctx) httpReq.Header = headers buf, err := executeHTTPRequest(ctx, c.httpClient, httpReq, c.logger, jsonReq, "UpdateConversation") if err != nil { return err } if err := unm.Unmarshal(buf, resp); err != nil { return err } return nil }, opts...) if e != nil { return nil, e } return resp, nil } // GetConversation gets a conversation. func (c *restClient) GetConversation(ctx context.Context, req *contactcenterinsightspb.GetConversationRequest, opts ...gax.CallOption) (*contactcenterinsightspb.Conversation, error) { baseUrl, err := url.Parse(c.endpoint) if err != nil { return nil, err } baseUrl.Path += fmt.Sprintf("/v1/%v", req.GetName()) params := url.Values{} params.Add("$alt", "json;enum-encoding=int") if req.GetView() != 0 { params.Add("view", fmt.Sprintf("%v", req.GetView())) } baseUrl.RawQuery = params.Encode() // Build HTTP headers from client and context metadata. hds := []string{"x-goog-request-params", fmt.Sprintf("%s=%v", "name", url.QueryEscape(req.GetName()))} hds = append(c.xGoogHeaders, hds...) hds = append(hds, "Content-Type", "application/json") headers := gax.BuildHeaders(ctx, hds...) opts = append((*c.CallOptions).GetConversation[0:len((*c.CallOptions).GetConversation):len((*c.CallOptions).GetConversation)], opts...) unm := protojson.UnmarshalOptions{AllowPartial: true, DiscardUnknown: true} resp := &contactcenterinsightspb.Conversation{} e := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error { if settings.Path != "" { baseUrl.Path = settings.Path } httpReq, err := http.NewRequest("GET", baseUrl.String(), nil) if err != nil { return err } httpReq = httpReq.WithContext(ctx) httpReq.Header = headers buf, err := executeHTTPRequest(ctx, c.httpClient, httpReq, c.logger, nil, "GetConversation") if err != nil { return err } if err := unm.Unmarshal(buf, resp); err != nil { return err } return nil }, opts...) if e != nil { return nil, e } return resp, nil } // ListConversations lists conversations. func (c *restClient) ListConversations(ctx context.Context, req *contactcenterinsightspb.ListConversationsRequest, opts ...gax.CallOption) *ConversationIterator { it := &ConversationIterator{} req = proto.Clone(req).(*contactcenterinsightspb.ListConversationsRequest) unm := protojson.UnmarshalOptions{AllowPartial: true, DiscardUnknown: true} it.InternalFetch = func(pageSize int, pageToken string) ([]*contactcenterinsightspb.Conversation, string, error) { resp := &contactcenterinsightspb.ListConversationsResponse{} if pageToken != "" { req.PageToken = pageToken } if pageSize > math.MaxInt32 { req.PageSize = math.MaxInt32 } else if pageSize != 0 { req.PageSize = int32(pageSize) } baseUrl, err := url.Parse(c.endpoint) if err != nil { return nil, "", err } baseUrl.Path += fmt.Sprintf("/v1/%v/conversations", req.GetParent()) params := url.Values{} params.Add("$alt", "json;enum-encoding=int") if req.GetFilter() != "" { params.Add("filter", fmt.Sprintf("%v", req.GetFilter())) } if req.GetOrderBy() != "" { params.Add("orderBy", fmt.Sprintf("%v", req.GetOrderBy())) } if req.GetPageSize() != 0 { params.Add("pageSize", fmt.Sprintf("%v", req.GetPageSize())) } if req.GetPageToken() != "" { params.Add("pageToken", fmt.Sprintf("%v", req.GetPageToken())) } if req.GetView() != 0 { params.Add("view", fmt.Sprintf("%v", req.GetView())) } baseUrl.RawQuery = params.Encode() // Build HTTP headers from client and context metadata. hds := append(c.xGoogHeaders, "Content-Type", "application/json") headers := gax.BuildHeaders(ctx, hds...) e := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error { if settings.Path != "" { baseUrl.Path = settings.Path } httpReq, err := http.NewRequest("GET", baseUrl.String(), nil) if err != nil { return err } httpReq.Header = headers buf, err := executeHTTPRequest(ctx, c.httpClient, httpReq, c.logger, nil, "ListConversations") if err != nil { return err } if err := unm.Unmarshal(buf, resp); err != nil { return err } return nil }, opts...) if e != nil { return nil, "", e } it.Response = resp return resp.GetConversations(), resp.GetNextPageToken(), 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.GetPageSize()) it.pageInfo.Token = req.GetPageToken() return it } // DeleteConversation deletes a conversation. func (c *restClient) DeleteConversation(ctx context.Context, req *contactcenterinsightspb.DeleteConversationRequest, opts ...gax.CallOption) error { baseUrl, err := url.Parse(c.endpoint) if err != nil { return err } baseUrl.Path += fmt.Sprintf("/v1/%v", req.GetName()) params := url.Values{} params.Add("$alt", "json;enum-encoding=int") if req.GetForce() { params.Add("force", fmt.Sprintf("%v", req.GetForce())) } baseUrl.RawQuery = params.Encode() // Build HTTP headers from client and context metadata. hds := []string{"x-goog-request-params", fmt.Sprintf("%s=%v", "name", url.QueryEscape(req.GetName()))} hds = append(c.xGoogHeaders, hds...) hds = append(hds, "Content-Type", "application/json") headers := gax.BuildHeaders(ctx, hds...) return gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error { if settings.Path != "" { baseUrl.Path = settings.Path } httpReq, err := http.NewRequest("DELETE", baseUrl.String(), nil) if err != nil { return err } httpReq = httpReq.WithContext(ctx) httpReq.Header = headers _, err = executeHTTPRequest(ctx, c.httpClient, httpReq, c.logger, nil, "DeleteConversation") return err }, opts...) } // CreateAnalysis creates an analysis. The long running operation is done when the analysis // has completed. func (c *restClient) CreateAnalysis(ctx context.Context, req *contactcenterinsightspb.CreateAnalysisRequest, opts ...gax.CallOption) (*CreateAnalysisOperation, error) { m := protojson.MarshalOptions{AllowPartial: true, UseEnumNumbers: true} body := req.GetAnalysis() jsonReq, err := m.Marshal(body) if err != nil { return nil, err } baseUrl, err := url.Parse(c.endpoint) if err != nil { return nil, err } baseUrl.Path += fmt.Sprintf("/v1/%v/analyses", req.GetParent()) params := url.Values{} params.Add("$alt", "json;enum-encoding=int") baseUrl.RawQuery = params.Encode() // Build HTTP headers from client and context metadata. hds := []string{"x-goog-request-params", fmt.Sprintf("%s=%v", "parent", url.QueryEscape(req.GetParent()))} hds = append(c.xGoogHeaders, hds...) hds = append(hds, "Content-Type", "application/json") headers := gax.BuildHeaders(ctx, hds...) unm := protojson.UnmarshalOptions{AllowPartial: true, DiscardUnknown: true} resp := &longrunningpb.Operation{} e := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error { if settings.Path != "" { baseUrl.Path = settings.Path } httpReq, err := http.NewRequest("POST", baseUrl.String(), bytes.NewReader(jsonReq)) if err != nil { return err } httpReq = httpReq.WithContext(ctx) httpReq.Header = headers buf, err := executeHTTPRequest(ctx, c.httpClient, httpReq, c.logger, jsonReq, "CreateAnalysis") if err != nil { return err } if err := unm.Unmarshal(buf, resp); err != nil { return err } return nil }, opts...) if e != nil { return nil, e } override := fmt.Sprintf("/v1/%s", resp.GetName()) return &CreateAnalysisOperation{ lro: longrunning.InternalNewOperation(*c.LROClient, resp), pollPath: override, }, nil } // GetAnalysis gets an analysis. func (c *restClient) GetAnalysis(ctx context.Context, req *contactcenterinsightspb.GetAnalysisRequest, opts ...gax.CallOption) (*contactcenterinsightspb.Analysis, error) { baseUrl, err := url.Parse(c.endpoint) if err != nil { return nil, err } baseUrl.Path += fmt.Sprintf("/v1/%v", req.GetName()) params := url.Values{} params.Add("$alt", "json;enum-encoding=int") baseUrl.RawQuery = params.Encode() // Build HTTP headers from client and context metadata. hds := []string{"x-goog-request-params", fmt.Sprintf("%s=%v", "name", url.QueryEscape(req.GetName()))} hds = append(c.xGoogHeaders, hds...) hds = append(hds, "Content-Type", "application/json") headers := gax.BuildHeaders(ctx, hds...) opts = append((*c.CallOptions).GetAnalysis[0:len((*c.CallOptions).GetAnalysis):len((*c.CallOptions).GetAnalysis)], opts...) unm := protojson.UnmarshalOptions{AllowPartial: true, DiscardUnknown: true} resp := &contactcenterinsightspb.Analysis{} e := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error { if settings.Path != "" { baseUrl.Path = settings.Path } httpReq, err := http.NewRequest("GET", baseUrl.String(), nil) if err != nil { return err } httpReq = httpReq.WithContext(ctx) httpReq.Header = headers buf, err := executeHTTPRequest(ctx, c.httpClient, httpReq, c.logger, nil, "GetAnalysis") if err != nil { return err } if err := unm.Unmarshal(buf, resp); err != nil { return err } return nil }, opts...) if e != nil { return nil, e } return resp, nil } // ListAnalyses lists analyses. func (c *restClient) ListAnalyses(ctx context.Context, req *contactcenterinsightspb.ListAnalysesRequest, opts ...gax.CallOption) *AnalysisIterator { it := &AnalysisIterator{} req = proto.Clone(req).(*contactcenterinsightspb.ListAnalysesRequest) unm := protojson.UnmarshalOptions{AllowPartial: true, DiscardUnknown: true} it.InternalFetch = func(pageSize int, pageToken string) ([]*contactcenterinsightspb.Analysis, string, error) { resp := &contactcenterinsightspb.ListAnalysesResponse{} if pageToken != "" { req.PageToken = pageToken } if pageSize > math.MaxInt32 { req.PageSize = math.MaxInt32 } else if pageSize != 0 { req.PageSize = int32(pageSize) } baseUrl, err := url.Parse(c.endpoint) if err != nil { return nil, "", err } baseUrl.Path += fmt.Sprintf("/v1/%v/analyses", req.GetParent()) params := url.Values{} params.Add("$alt", "json;enum-encoding=int") if req.GetFilter() != "" { params.Add("filter", fmt.Sprintf("%v", req.GetFilter())) } if req.GetPageSize() != 0 { params.Add("pageSize", fmt.Sprintf("%v", req.GetPageSize())) } if req.GetPageToken() != "" { params.Add("pageToken", fmt.Sprintf("%v", req.GetPageToken())) } baseUrl.RawQuery = params.Encode() // Build HTTP headers from client and context metadata. hds := append(c.xGoogHeaders, "Content-Type", "application/json") headers := gax.BuildHeaders(ctx, hds...) e := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error { if settings.Path != "" { baseUrl.Path = settings.Path } httpReq, err := http.NewRequest("GET", baseUrl.String(), nil) if err != nil { return err } httpReq.Header = headers buf, err := executeHTTPRequest(ctx, c.httpClient, httpReq, c.logger, nil, "ListAnalyses") if err != nil { return err } if err := unm.Unmarshal(buf, resp); err != nil { return err } return nil }, opts...) if e != nil { return nil, "", e } it.Response = resp return resp.GetAnalyses(), resp.GetNextPageToken(), 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.GetPageSize()) it.pageInfo.Token = req.GetPageToken() return it } // DeleteAnalysis deletes an analysis. func (c *restClient) DeleteAnalysis(ctx context.Context, req *contactcenterinsightspb.DeleteAnalysisRequest, opts ...gax.CallOption) error { baseUrl, err := url.Parse(c.endpoint) if err != nil { return err } baseUrl.Path += fmt.Sprintf("/v1/%v", req.GetName()) params := url.Values{} params.Add("$alt", "json;enum-encoding=int") baseUrl.RawQuery = params.Encode() // Build HTTP headers from client and context metadata. hds := []string{"x-goog-request-params", fmt.Sprintf("%s=%v", "name", url.QueryEscape(req.GetName()))} hds = append(c.xGoogHeaders, hds...) hds = append(hds, "Content-Type", "application/json") headers := gax.BuildHeaders(ctx, hds...) return gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error { if settings.Path != "" { baseUrl.Path = settings.Path } httpReq, err := http.NewRequest("DELETE", baseUrl.String(), nil) if err != nil { return err } httpReq = httpReq.WithContext(ctx) httpReq.Header = headers _, err = executeHTTPRequest(ctx, c.httpClient, httpReq, c.logger, nil, "DeleteAnalysis") return err }, opts...) } // BulkAnalyzeConversations analyzes multiple conversations in a single request. func (c *restClient) BulkAnalyzeConversations(ctx context.Context, req *contactcenterinsightspb.BulkAnalyzeConversationsRequest, opts ...gax.CallOption) (*BulkAnalyzeConversationsOperation, error) { m := protojson.MarshalOptions{AllowPartial: true, UseEnumNumbers: true} jsonReq, err := m.Marshal(req) if err != nil { return nil, err } baseUrl, err := url.Parse(c.endpoint) if err != nil { return nil, err } baseUrl.Path += fmt.Sprintf("/v1/%v/conversations:bulkAnalyze", req.GetParent()) params := url.Values{} params.Add("$alt", "json;enum-encoding=int") baseUrl.RawQuery = params.Encode() // Build HTTP headers from client and context metadata. hds := []string{"x-goog-request-params", fmt.Sprintf("%s=%v", "parent", url.QueryEscape(req.GetParent()))} hds = append(c.xGoogHeaders, hds...) hds = append(hds, "Content-Type", "application/json") headers := gax.BuildHeaders(ctx, hds...) unm := protojson.UnmarshalOptions{AllowPartial: true, DiscardUnknown: true} resp := &longrunningpb.Operation{} e := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error { if settings.Path != "" { baseUrl.Path = settings.Path } httpReq, err := http.NewRequest("POST", baseUrl.String(), bytes.NewReader(jsonReq)) if err != nil { return err } httpReq = httpReq.WithContext(ctx) httpReq.Header = headers buf, err := executeHTTPRequest(ctx, c.httpClient, httpReq, c.logger, jsonReq, "BulkAnalyzeConversations") if err != nil { return err } if err := unm.Unmarshal(buf, resp); err != nil { return err } return nil }, opts...) if e != nil { return nil, e } override := fmt.Sprintf("/v1/%s", resp.GetName()) return &BulkAnalyzeConversationsOperation{ lro: longrunning.InternalNewOperation(*c.LROClient, resp), pollPath: override, }, nil } // BulkDeleteConversations deletes multiple conversations in a single request. func (c *restClient) BulkDeleteConversations(ctx context.Context, req *contactcenterinsightspb.BulkDeleteConversationsRequest, opts ...gax.CallOption) (*BulkDeleteConversationsOperation, error) { m := protojson.MarshalOptions{AllowPartial: true, UseEnumNumbers: true} jsonReq, err := m.Marshal(req) if err != nil { return nil, err } baseUrl, err := url.Parse(c.endpoint) if err != nil { return nil, err } baseUrl.Path += fmt.Sprintf("/v1/%v/conversations:bulkDelete", req.GetParent()) params := url.Values{} params.Add("$alt", "json;enum-encoding=int") baseUrl.RawQuery = params.Encode() // Build HTTP headers from client and context metadata. hds := []string{"x-goog-request-params", fmt.Sprintf("%s=%v", "parent", url.QueryEscape(req.GetParent()))} hds = append(c.xGoogHeaders, hds...) hds = append(hds, "Content-Type", "application/json") headers := gax.BuildHeaders(ctx, hds...) unm := protojson.UnmarshalOptions{AllowPartial: true, DiscardUnknown: true} resp := &longrunningpb.Operation{} e := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error { if settings.Path != "" { baseUrl.Path = settings.Path } httpReq, err := http.NewRequest("POST", baseUrl.String(), bytes.NewReader(jsonReq)) if err != nil { return err } httpReq = httpReq.WithContext(ctx) httpReq.Header = headers buf, err := executeHTTPRequest(ctx, c.httpClient, httpReq, c.logger, jsonReq, "BulkDeleteConversations") if err != nil { return err } if err := unm.Unmarshal(buf, resp); err != nil { return err } return nil }, opts...) if e != nil { return nil, e } override := fmt.Sprintf("/v1/%s", resp.GetName()) return &BulkDeleteConversationsOperation{ lro: longrunning.InternalNewOperation(*c.LROClient, resp), pollPath: override, }, nil } // IngestConversations imports conversations and processes them according to the user’s // configuration. func (c *restClient) IngestConversations(ctx context.Context, req *contactcenterinsightspb.IngestConversationsRequest, opts ...gax.CallOption) (*IngestConversationsOperation, error) { m := protojson.MarshalOptions{AllowPartial: true, UseEnumNumbers: true} jsonReq, err := m.Marshal(req) if err != nil { return nil, err } baseUrl, err := url.Parse(c.endpoint) if err != nil { return nil, err } baseUrl.Path += fmt.Sprintf("/v1/%v/conversations:ingest", req.GetParent()) params := url.Values{} params.Add("$alt", "json;enum-encoding=int") baseUrl.RawQuery = params.Encode() // Build HTTP headers from client and context metadata. hds := []string{"x-goog-request-params", fmt.Sprintf("%s=%v", "parent", url.QueryEscape(req.GetParent()))} hds = append(c.xGoogHeaders, hds...) hds = append(hds, "Content-Type", "application/json") headers := gax.BuildHeaders(ctx, hds...) unm := protojson.UnmarshalOptions{AllowPartial: true, DiscardUnknown: true} resp := &longrunningpb.Operation{} e := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error { if settings.Path != "" { baseUrl.Path = settings.Path } httpReq, err := http.NewRequest("POST", baseUrl.String(), bytes.NewReader(jsonReq)) if err != nil { return err } httpReq = httpReq.WithContext(ctx) httpReq.Header = headers buf, err := executeHTTPRequest(ctx, c.httpClient, httpReq, c.logger, jsonReq, "IngestConversations") if err != nil { return err } if err := unm.Unmarshal(buf, resp); err != nil { return err } return nil }, opts...) if e != nil { return nil, e } override := fmt.Sprintf("/v1/%s", resp.GetName()) return &IngestConversationsOperation{ lro: longrunning.InternalNewOperation(*c.LROClient, resp), pollPath: override, }, nil } // ExportInsightsData export insights data to a destination defined in the request body. func (c *restClient) ExportInsightsData(ctx context.Context, req *contactcenterinsightspb.ExportInsightsDataRequest, opts ...gax.CallOption) (*ExportInsightsDataOperation, error) { m := protojson.MarshalOptions{AllowPartial: true, UseEnumNumbers: true} jsonReq, err := m.Marshal(req) if err != nil { return nil, err } baseUrl, err := url.Parse(c.endpoint) if err != nil { return nil, err } baseUrl.Path += fmt.Sprintf("/v1/%v/insightsdata:export", req.GetParent()) params := url.Values{} params.Add("$alt", "json;enum-encoding=int") baseUrl.RawQuery = params.Encode() // Build HTTP headers from client and context metadata. hds := []string{"x-goog-request-params", fmt.Sprintf("%s=%v", "parent", url.QueryEscape(req.GetParent()))} hds = append(c.xGoogHeaders, hds...) hds = append(hds, "Content-Type", "application/json") headers := gax.BuildHeaders(ctx, hds...) unm := protojson.UnmarshalOptions{AllowPartial: true, DiscardUnknown: true} resp := &longrunningpb.Operation{} e := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error { if settings.Path != "" { baseUrl.Path = settings.Path } httpReq, err := http.NewRequest("POST", baseUrl.String(), bytes.NewReader(jsonReq)) if err != nil { return err } httpReq = httpReq.WithContext(ctx) httpReq.Header = headers buf, err := executeHTTPRequest(ctx, c.httpClient, httpReq, c.logger, jsonReq, "ExportInsightsData") if err != nil { return err } if err := unm.Unmarshal(buf, resp); err != nil { return err } return nil }, opts...) if e != nil { return nil, e } override := fmt.Sprintf("/v1/%s", resp.GetName()) return &ExportInsightsDataOperation{ lro: longrunning.InternalNewOperation(*c.LROClient, resp), pollPath: override, }, nil } // CreateIssueModel creates an issue model. func (c *restClient) CreateIssueModel(ctx context.Context, req *contactcenterinsightspb.CreateIssueModelRequest, opts ...gax.CallOption) (*CreateIssueModelOperation, error) { m := protojson.MarshalOptions{AllowPartial: true, UseEnumNumbers: true} body := req.GetIssueModel() jsonReq, err := m.Marshal(body) if err != nil { return nil, err } baseUrl, err := url.Parse(c.endpoint) if err != nil { return nil, err } baseUrl.Path += fmt.Sprintf("/v1/%v/issueModels", req.GetParent()) params := url.Values{} params.Add("$alt", "json;enum-encoding=int") baseUrl.RawQuery = params.Encode() // Build HTTP headers from client and context metadata. hds := []string{"x-goog-request-params", fmt.Sprintf("%s=%v", "parent", url.QueryEscape(req.GetParent()))} hds = append(c.xGoogHeaders, hds...) hds = append(hds, "Content-Type", "application/json") headers := gax.BuildHeaders(ctx, hds...) unm := protojson.UnmarshalOptions{AllowPartial: true, DiscardUnknown: true} resp := &longrunningpb.Operation{} e := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error { if settings.Path != "" { baseUrl.Path = settings.Path } httpReq, err := http.NewRequest("POST", baseUrl.String(), bytes.NewReader(jsonReq)) if err != nil { return err } httpReq = httpReq.WithContext(ctx) httpReq.Header = headers buf, err := executeHTTPRequest(ctx, c.httpClient, httpReq, c.logger, jsonReq, "CreateIssueModel") if err != nil { return err } if err := unm.Unmarshal(buf, resp); err != nil { return err } return nil }, opts...) if e != nil { return nil, e } override := fmt.Sprintf("/v1/%s", resp.GetName()) return &CreateIssueModelOperation{ lro: longrunning.InternalNewOperation(*c.LROClient, resp), pollPath: override, }, nil } // UpdateIssueModel updates an issue model. func (c *restClient) UpdateIssueModel(ctx context.Context, req *contactcenterinsightspb.UpdateIssueModelRequest, opts ...gax.CallOption) (*contactcenterinsightspb.IssueModel, error) { m := protojson.MarshalOptions{AllowPartial: true, UseEnumNumbers: true} body := req.GetIssueModel() jsonReq, err := m.Marshal(body) if err != nil { return nil, err } baseUrl, err := url.Parse(c.endpoint) if err != nil { return nil, err } baseUrl.Path += fmt.Sprintf("/v1/%v", req.GetIssueModel().GetName()) params := url.Values{} params.Add("$alt", "json;enum-encoding=int") if req.GetUpdateMask() != nil { field, err := protojson.Marshal(req.GetUpdateMask()) if err != nil { return nil, err } params.Add("updateMask", string(field[1:len(field)-1])) } baseUrl.RawQuery = params.Encode() // Build HTTP headers from client and context metadata. hds := []string{"x-goog-request-params", fmt.Sprintf("%s=%v", "issue_model.name", url.QueryEscape(req.GetIssueModel().GetName()))} hds = append(c.xGoogHeaders, hds...) hds = append(hds, "Content-Type", "application/json") headers := gax.BuildHeaders(ctx, hds...) opts = append((*c.CallOptions).UpdateIssueModel[0:len((*c.CallOptions).UpdateIssueModel):len((*c.CallOptions).UpdateIssueModel)], opts...) unm := protojson.UnmarshalOptions{AllowPartial: true, DiscardUnknown: true} resp := &contactcenterinsightspb.IssueModel{} e := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error { if settings.Path != "" { baseUrl.Path = settings.Path } httpReq, err := http.NewRequest("PATCH", baseUrl.String(), bytes.NewReader(jsonReq)) if err != nil { return err } httpReq = httpReq.WithContext(ctx) httpReq.Header = headers buf, err := executeHTTPRequest(ctx, c.httpClient, httpReq, c.logger, jsonReq, "UpdateIssueModel") if err != nil { return err } if err := unm.Unmarshal(buf, resp); err != nil { return err } return nil }, opts...) if e != nil { return nil, e } return resp, nil } // GetIssueModel gets an issue model. func (c *restClient) GetIssueModel(ctx context.Context, req *contactcenterinsightspb.GetIssueModelRequest, opts ...gax.CallOption) (*contactcenterinsightspb.IssueModel, error) { baseUrl, err := url.Parse(c.endpoint) if err != nil { return nil, err } baseUrl.Path += fmt.Sprintf("/v1/%v", req.GetName()) params := url.Values{} params.Add("$alt", "json;enum-encoding=int") baseUrl.RawQuery = params.Encode() // Build HTTP headers from client and context metadata. hds := []string{"x-goog-request-params", fmt.Sprintf("%s=%v", "name", url.QueryEscape(req.GetName()))} hds = append(c.xGoogHeaders, hds...) hds = append(hds, "Content-Type", "application/json") headers := gax.BuildHeaders(ctx, hds...) opts = append((*c.CallOptions).GetIssueModel[0:len((*c.CallOptions).GetIssueModel):len((*c.CallOptions).GetIssueModel)], opts...) unm := protojson.UnmarshalOptions{AllowPartial: true, DiscardUnknown: true} resp := &contactcenterinsightspb.IssueModel{} e := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error { if settings.Path != "" { baseUrl.Path = settings.Path } httpReq, err := http.NewRequest("GET", baseUrl.String(), nil) if err != nil { return err } httpReq = httpReq.WithContext(ctx) httpReq.Header = headers buf, err := executeHTTPRequest(ctx, c.httpClient, httpReq, c.logger, nil, "GetIssueModel") if err != nil { return err } if err := unm.Unmarshal(buf, resp); err != nil { return err } return nil }, opts...) if e != nil { return nil, e } return resp, nil } // ListIssueModels lists issue models. func (c *restClient) ListIssueModels(ctx context.Context, req *contactcenterinsightspb.ListIssueModelsRequest, opts ...gax.CallOption) (*contactcenterinsightspb.ListIssueModelsResponse, error) { baseUrl, err := url.Parse(c.endpoint) if err != nil { return nil, err } baseUrl.Path += fmt.Sprintf("/v1/%v/issueModels", req.GetParent()) params := url.Values{} params.Add("$alt", "json;enum-encoding=int") baseUrl.RawQuery = params.Encode() // Build HTTP headers from client and context metadata. hds := []string{"x-goog-request-params", fmt.Sprintf("%s=%v", "parent", url.QueryEscape(req.GetParent()))} hds = append(c.xGoogHeaders, hds...) hds = append(hds, "Content-Type", "application/json") headers := gax.BuildHeaders(ctx, hds...) opts = append((*c.CallOptions).ListIssueModels[0:len((*c.CallOptions).ListIssueModels):len((*c.CallOptions).ListIssueModels)], opts...) unm := protojson.UnmarshalOptions{AllowPartial: true, DiscardUnknown: true} resp := &contactcenterinsightspb.ListIssueModelsResponse{} e := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error { if settings.Path != "" { baseUrl.Path = settings.Path } httpReq, err := http.NewRequest("GET", baseUrl.String(), nil) if err != nil { return err } httpReq = httpReq.WithContext(ctx) httpReq.Header = headers buf, err := executeHTTPRequest(ctx, c.httpClient, httpReq, c.logger, nil, "ListIssueModels") if err != nil { return err } if err := unm.Unmarshal(buf, resp); err != nil { return err } return nil }, opts...) if e != nil { return nil, e } return resp, nil } // DeleteIssueModel deletes an issue model. func (c *restClient) DeleteIssueModel(ctx context.Context, req *contactcenterinsightspb.DeleteIssueModelRequest, opts ...gax.CallOption) (*DeleteIssueModelOperation, error) { baseUrl, err := url.Parse(c.endpoint) if err != nil { return nil, err } baseUrl.Path += fmt.Sprintf("/v1/%v", req.GetName()) params := url.Values{} params.Add("$alt", "json;enum-encoding=int") baseUrl.RawQuery = params.Encode() // Build HTTP headers from client and context metadata. hds := []string{"x-goog-request-params", fmt.Sprintf("%s=%v", "name", url.QueryEscape(req.GetName()))} hds = append(c.xGoogHeaders, hds...) hds = append(hds, "Content-Type", "application/json") headers := gax.BuildHeaders(ctx, hds...) unm := protojson.UnmarshalOptions{AllowPartial: true, DiscardUnknown: true} resp := &longrunningpb.Operation{} e := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error { if settings.Path != "" { baseUrl.Path = settings.Path } httpReq, err := http.NewRequest("DELETE", baseUrl.String(), nil) if err != nil { return err } httpReq = httpReq.WithContext(ctx) httpReq.Header = headers buf, err := executeHTTPRequest(ctx, c.httpClient, httpReq, c.logger, nil, "DeleteIssueModel") if err != nil { return err } if err := unm.Unmarshal(buf, resp); err != nil { return err } return nil }, opts...) if e != nil { return nil, e } override := fmt.Sprintf("/v1/%s", resp.GetName()) return &DeleteIssueModelOperation{ lro: longrunning.InternalNewOperation(*c.LROClient, resp), pollPath: override, }, nil } // DeployIssueModel deploys an issue model. Returns an error if a model is already deployed. // An issue model can only be used in analysis after it has been deployed. func (c *restClient) DeployIssueModel(ctx context.Context, req *contactcenterinsightspb.DeployIssueModelRequest, opts ...gax.CallOption) (*DeployIssueModelOperation, error) { m := protojson.MarshalOptions{AllowPartial: true, UseEnumNumbers: true} jsonReq, err := m.Marshal(req) if err != nil { return nil, err } baseUrl, err := url.Parse(c.endpoint) if err != nil { return nil, err } baseUrl.Path += fmt.Sprintf("/v1/%v:deploy", req.GetName()) params := url.Values{} params.Add("$alt", "json;enum-encoding=int") baseUrl.RawQuery = params.Encode() // Build HTTP headers from client and context metadata. hds := []string{"x-goog-request-params", fmt.Sprintf("%s=%v", "name", url.QueryEscape(req.GetName()))} hds = append(c.xGoogHeaders, hds...) hds = append(hds, "Content-Type", "application/json") headers := gax.BuildHeaders(ctx, hds...) unm := protojson.UnmarshalOptions{AllowPartial: true, DiscardUnknown: true} resp := &longrunningpb.Operation{} e := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error { if settings.Path != "" { baseUrl.Path = settings.Path } httpReq, err := http.NewRequest("POST", baseUrl.String(), bytes.NewReader(jsonReq)) if err != nil { return err } httpReq = httpReq.WithContext(ctx) httpReq.Header = headers buf, err := executeHTTPRequest(ctx, c.httpClient, httpReq, c.logger, jsonReq, "DeployIssueModel") if err != nil { return err } if err := unm.Unmarshal(buf, resp); err != nil { return err } return nil }, opts...) if e != nil { return nil, e } override := fmt.Sprintf("/v1/%s", resp.GetName()) return &DeployIssueModelOperation{ lro: longrunning.InternalNewOperation(*c.LROClient, resp), pollPath: override, }, nil } // UndeployIssueModel undeploys an issue model. // An issue model can not be used in analysis after it has been undeployed. func (c *restClient) UndeployIssueModel(ctx context.Context, req *contactcenterinsightspb.UndeployIssueModelRequest, opts ...gax.CallOption) (*UndeployIssueModelOperation, error) { m := protojson.MarshalOptions{AllowPartial: true, UseEnumNumbers: true} jsonReq, err := m.Marshal(req) if err != nil { return nil, err } baseUrl, err := url.Parse(c.endpoint) if err != nil { return nil, err } baseUrl.Path += fmt.Sprintf("/v1/%v:undeploy", req.GetName()) params := url.Values{} params.Add("$alt", "json;enum-encoding=int") baseUrl.RawQuery = params.Encode() // Build HTTP headers from client and context metadata. hds := []string{"x-goog-request-params", fmt.Sprintf("%s=%v", "name", url.QueryEscape(req.GetName()))} hds = append(c.xGoogHeaders, hds...) hds = append(hds, "Content-Type", "application/json") headers := gax.BuildHeaders(ctx, hds...) unm := protojson.UnmarshalOptions{AllowPartial: true, DiscardUnknown: true} resp := &longrunningpb.Operation{} e := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error { if settings.Path != "" { baseUrl.Path = settings.Path } httpReq, err := http.NewRequest("POST", baseUrl.String(), bytes.NewReader(jsonReq)) if err != nil { return err } httpReq = httpReq.WithContext(ctx) httpReq.Header = headers buf, err := executeHTTPRequest(ctx, c.httpClient, httpReq, c.logger, jsonReq, "UndeployIssueModel") if err != nil { return err } if err := unm.Unmarshal(buf, resp); err != nil { return err } return nil }, opts...) if e != nil { return nil, e } override := fmt.Sprintf("/v1/%s", resp.GetName()) return &UndeployIssueModelOperation{ lro: longrunning.InternalNewOperation(*c.LROClient, resp), pollPath: override, }, nil } // ExportIssueModel exports an issue model to the provided destination. func (c *restClient) ExportIssueModel(ctx context.Context, req *contactcenterinsightspb.ExportIssueModelRequest, opts ...gax.CallOption) (*ExportIssueModelOperation, error) { m := protojson.MarshalOptions{AllowPartial: true, UseEnumNumbers: true} jsonReq, err := m.Marshal(req) if err != nil { return nil, err } baseUrl, err := url.Parse(c.endpoint) if err != nil { return nil, err } baseUrl.Path += fmt.Sprintf("/v1/%v:export", req.GetName()) params := url.Values{} params.Add("$alt", "json;enum-encoding=int") baseUrl.RawQuery = params.Encode() // Build HTTP headers from client and context metadata. hds := []string{"x-goog-request-params", fmt.Sprintf("%s=%v", "name", url.QueryEscape(req.GetName()))} hds = append(c.xGoogHeaders, hds...) hds = append(hds, "Content-Type", "application/json") headers := gax.BuildHeaders(ctx, hds...) unm := protojson.UnmarshalOptions{AllowPartial: true, DiscardUnknown: true} resp := &longrunningpb.Operation{} e := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error { if settings.Path != "" { baseUrl.Path = settings.Path } httpReq, err := http.NewRequest("POST", baseUrl.String(), bytes.NewReader(jsonReq)) if err != nil { return err } httpReq = httpReq.WithContext(ctx) httpReq.Header = headers buf, err := executeHTTPRequest(ctx, c.httpClient, httpReq, c.logger, jsonReq, "ExportIssueModel") if err != nil { return err } if err := unm.Unmarshal(buf, resp); err != nil { return err } return nil }, opts...) if e != nil { return nil, e } override := fmt.Sprintf("/v1/%s", resp.GetName()) return &ExportIssueModelOperation{ lro: longrunning.InternalNewOperation(*c.LROClient, resp), pollPath: override, }, nil } // ImportIssueModel imports an issue model from a Cloud Storage bucket. func (c *restClient) ImportIssueModel(ctx context.Context, req *contactcenterinsightspb.ImportIssueModelRequest, opts ...gax.CallOption) (*ImportIssueModelOperation, error) { m := protojson.MarshalOptions{AllowPartial: true, UseEnumNumbers: true} jsonReq, err := m.Marshal(req) if err != nil { return nil, err } baseUrl, err := url.Parse(c.endpoint) if err != nil { return nil, err } baseUrl.Path += fmt.Sprintf("/v1/%v/issueModels:import", req.GetParent()) params := url.Values{} params.Add("$alt", "json;enum-encoding=int") baseUrl.RawQuery = params.Encode() // Build HTTP headers from client and context metadata. hds := []string{"x-goog-request-params", fmt.Sprintf("%s=%v", "parent", url.QueryEscape(req.GetParent()))} hds = append(c.xGoogHeaders, hds...) hds = append(hds, "Content-Type", "application/json") headers := gax.BuildHeaders(ctx, hds...) unm := protojson.UnmarshalOptions{AllowPartial: true, DiscardUnknown: true} resp := &longrunningpb.Operation{} e := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error { if settings.Path != "" { baseUrl.Path = settings.Path } httpReq, err := http.NewRequest("POST", baseUrl.String(), bytes.NewReader(jsonReq)) if err != nil { return err } httpReq = httpReq.WithContext(ctx) httpReq.Header = headers buf, err := executeHTTPRequest(ctx, c.httpClient, httpReq, c.logger, jsonReq, "ImportIssueModel") if err != nil { return err } if err := unm.Unmarshal(buf, resp); err != nil { return err } return nil }, opts...) if e != nil { return nil, e } override := fmt.Sprintf("/v1/%s", resp.GetName()) return &ImportIssueModelOperation{ lro: longrunning.InternalNewOperation(*c.LROClient, resp), pollPath: override, }, nil } // GetIssue gets an issue. func (c *restClient) GetIssue(ctx context.Context, req *contactcenterinsightspb.GetIssueRequest, opts ...gax.CallOption) (*contactcenterinsightspb.Issue, error) { baseUrl, err := url.Parse(c.endpoint) if err != nil { return nil, err } baseUrl.Path += fmt.Sprintf("/v1/%v", req.GetName()) params := url.Values{} params.Add("$alt", "json;enum-encoding=int") baseUrl.RawQuery = params.Encode() // Build HTTP headers from client and context metadata. hds := []string{"x-goog-request-params", fmt.Sprintf("%s=%v", "name", url.QueryEscape(req.GetName()))} hds = append(c.xGoogHeaders, hds...) hds = append(hds, "Content-Type", "application/json") headers := gax.BuildHeaders(ctx, hds...) opts = append((*c.CallOptions).GetIssue[0:len((*c.CallOptions).GetIssue):len((*c.CallOptions).GetIssue)], opts...) unm := protojson.UnmarshalOptions{AllowPartial: true, DiscardUnknown: true} resp := &contactcenterinsightspb.Issue{} e := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error { if settings.Path != "" { baseUrl.Path = settings.Path } httpReq, err := http.NewRequest("GET", baseUrl.String(), nil) if err != nil { return err } httpReq = httpReq.WithContext(ctx) httpReq.Header = headers buf, err := executeHTTPRequest(ctx, c.httpClient, httpReq, c.logger, nil, "GetIssue") if err != nil { return err } if err := unm.Unmarshal(buf, resp); err != nil { return err } return nil }, opts...) if e != nil { return nil, e } return resp, nil } // ListIssues lists issues. func (c *restClient) ListIssues(ctx context.Context, req *contactcenterinsightspb.ListIssuesRequest, opts ...gax.CallOption) (*contactcenterinsightspb.ListIssuesResponse, error) { baseUrl, err := url.Parse(c.endpoint) if err != nil { return nil, err } baseUrl.Path += fmt.Sprintf("/v1/%v/issues", req.GetParent()) params := url.Values{} params.Add("$alt", "json;enum-encoding=int") baseUrl.RawQuery = params.Encode() // Build HTTP headers from client and context metadata. hds := []string{"x-goog-request-params", fmt.Sprintf("%s=%v", "parent", url.QueryEscape(req.GetParent()))} hds = append(c.xGoogHeaders, hds...) hds = append(hds, "Content-Type", "application/json") headers := gax.BuildHeaders(ctx, hds...) opts = append((*c.CallOptions).ListIssues[0:len((*c.CallOptions).ListIssues):len((*c.CallOptions).ListIssues)], opts...) unm := protojson.UnmarshalOptions{AllowPartial: true, DiscardUnknown: true} resp := &contactcenterinsightspb.ListIssuesResponse{} e := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error { if settings.Path != "" { baseUrl.Path = settings.Path } httpReq, err := http.NewRequest("GET", baseUrl.String(), nil) if err != nil { return err } httpReq = httpReq.WithContext(ctx) httpReq.Header = headers buf, err := executeHTTPRequest(ctx, c.httpClient, httpReq, c.logger, nil, "ListIssues") if err != nil { return err } if err := unm.Unmarshal(buf, resp); err != nil { return err } return nil }, opts...) if e != nil { return nil, e } return resp, nil } // UpdateIssue updates an issue. func (c *restClient) UpdateIssue(ctx context.Context, req *contactcenterinsightspb.UpdateIssueRequest, opts ...gax.CallOption) (*contactcenterinsightspb.Issue, error) { m := protojson.MarshalOptions{AllowPartial: true, UseEnumNumbers: true} body := req.GetIssue() jsonReq, err := m.Marshal(body) if err != nil { return nil, err } baseUrl, err := url.Parse(c.endpoint) if err != nil { return nil, err } baseUrl.Path += fmt.Sprintf("/v1/%v", req.GetIssue().GetName()) params := url.Values{} params.Add("$alt", "json;enum-encoding=int") if req.GetUpdateMask() != nil { field, err := protojson.Marshal(req.GetUpdateMask()) if err != nil { return nil, err } params.Add("updateMask", string(field[1:len(field)-1])) } baseUrl.RawQuery = params.Encode() // Build HTTP headers from client and context metadata. hds := []string{"x-goog-request-params", fmt.Sprintf("%s=%v", "issue.name", url.QueryEscape(req.GetIssue().GetName()))} hds = append(c.xGoogHeaders, hds...) hds = append(hds, "Content-Type", "application/json") headers := gax.BuildHeaders(ctx, hds...) opts = append((*c.CallOptions).UpdateIssue[0:len((*c.CallOptions).UpdateIssue):len((*c.CallOptions).UpdateIssue)], opts...) unm := protojson.UnmarshalOptions{AllowPartial: true, DiscardUnknown: true} resp := &contactcenterinsightspb.Issue{} e := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error { if settings.Path != "" { baseUrl.Path = settings.Path } httpReq, err := http.NewRequest("PATCH", baseUrl.String(), bytes.NewReader(jsonReq)) if err != nil { return err } httpReq = httpReq.WithContext(ctx) httpReq.Header = headers buf, err := executeHTTPRequest(ctx, c.httpClient, httpReq, c.logger, jsonReq, "UpdateIssue") if err != nil { return err } if err := unm.Unmarshal(buf, resp); err != nil { return err } return nil }, opts...) if e != nil { return nil, e } return resp, nil } // DeleteIssue deletes an issue. func (c *restClient) DeleteIssue(ctx context.Context, req *contactcenterinsightspb.DeleteIssueRequest, opts ...gax.CallOption) error { baseUrl, err := url.Parse(c.endpoint) if err != nil { return err } baseUrl.Path += fmt.Sprintf("/v1/%v", req.GetName()) params := url.Values{} params.Add("$alt", "json;enum-encoding=int") baseUrl.RawQuery = params.Encode() // Build HTTP headers from client and context metadata. hds := []string{"x-goog-request-params", fmt.Sprintf("%s=%v", "name", url.QueryEscape(req.GetName()))} hds = append(c.xGoogHeaders, hds...) hds = append(hds, "Content-Type", "application/json") headers := gax.BuildHeaders(ctx, hds...) return gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error { if settings.Path != "" { baseUrl.Path = settings.Path } httpReq, err := http.NewRequest("DELETE", baseUrl.String(), nil) if err != nil { return err } httpReq = httpReq.WithContext(ctx) httpReq.Header = headers _, err = executeHTTPRequest(ctx, c.httpClient, httpReq, c.logger, nil, "DeleteIssue") return err }, opts...) } // CalculateIssueModelStats gets an issue model’s statistics. func (c *restClient) CalculateIssueModelStats(ctx context.Context, req *contactcenterinsightspb.CalculateIssueModelStatsRequest, opts ...gax.CallOption) (*contactcenterinsightspb.CalculateIssueModelStatsResponse, error) { baseUrl, err := url.Parse(c.endpoint) if err != nil { return nil, err } baseUrl.Path += fmt.Sprintf("/v1/%v:calculateIssueModelStats", req.GetIssueModel()) params := url.Values{} params.Add("$alt", "json;enum-encoding=int") baseUrl.RawQuery = params.Encode() // Build HTTP headers from client and context metadata. hds := []string{"x-goog-request-params", fmt.Sprintf("%s=%v", "issue_model", url.QueryEscape(req.GetIssueModel()))} hds = append(c.xGoogHeaders, hds...) hds = append(hds, "Content-Type", "application/json") headers := gax.BuildHeaders(ctx, hds...) opts = append((*c.CallOptions).CalculateIssueModelStats[0:len((*c.CallOptions).CalculateIssueModelStats):len((*c.CallOptions).CalculateIssueModelStats)], opts...) unm := protojson.UnmarshalOptions{AllowPartial: true, DiscardUnknown: true} resp := &contactcenterinsightspb.CalculateIssueModelStatsResponse{} e := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error { if settings.Path != "" { baseUrl.Path = settings.Path } httpReq, err := http.NewRequest("GET", baseUrl.String(), nil) if err != nil { return err } httpReq = httpReq.WithContext(ctx) httpReq.Header = headers buf, err := executeHTTPRequest(ctx, c.httpClient, httpReq, c.logger, nil, "CalculateIssueModelStats") if err != nil { return err } if err := unm.Unmarshal(buf, resp); err != nil { return err } return nil }, opts...) if e != nil { return nil, e } return resp, nil } // CreatePhraseMatcher creates a phrase matcher. func (c *restClient) CreatePhraseMatcher(ctx context.Context, req *contactcenterinsightspb.CreatePhraseMatcherRequest, opts ...gax.CallOption) (*contactcenterinsightspb.PhraseMatcher, error) { m := protojson.MarshalOptions{AllowPartial: true, UseEnumNumbers: true} body := req.GetPhraseMatcher() jsonReq, err := m.Marshal(body) if err != nil { return nil, err } baseUrl, err := url.Parse(c.endpoint) if err != nil { return nil, err } baseUrl.Path += fmt.Sprintf("/v1/%v/phraseMatchers", req.GetParent()) params := url.Values{} params.Add("$alt", "json;enum-encoding=int") baseUrl.RawQuery = params.Encode() // Build HTTP headers from client and context metadata. hds := []string{"x-goog-request-params", fmt.Sprintf("%s=%v", "parent", url.QueryEscape(req.GetParent()))} hds = append(c.xGoogHeaders, hds...) hds = append(hds, "Content-Type", "application/json") headers := gax.BuildHeaders(ctx, hds...) opts = append((*c.CallOptions).CreatePhraseMatcher[0:len((*c.CallOptions).CreatePhraseMatcher):len((*c.CallOptions).CreatePhraseMatcher)], opts...) unm := protojson.UnmarshalOptions{AllowPartial: true, DiscardUnknown: true} resp := &contactcenterinsightspb.PhraseMatcher{} e := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error { if settings.Path != "" { baseUrl.Path = settings.Path } httpReq, err := http.NewRequest("POST", baseUrl.String(), bytes.NewReader(jsonReq)) if err != nil { return err } httpReq = httpReq.WithContext(ctx) httpReq.Header = headers buf, err := executeHTTPRequest(ctx, c.httpClient, httpReq, c.logger, jsonReq, "CreatePhraseMatcher") if err != nil { return err } if err := unm.Unmarshal(buf, resp); err != nil { return err } return nil }, opts...) if e != nil { return nil, e } return resp, nil } // GetPhraseMatcher gets a phrase matcher. func (c *restClient) GetPhraseMatcher(ctx context.Context, req *contactcenterinsightspb.GetPhraseMatcherRequest, opts ...gax.CallOption) (*contactcenterinsightspb.PhraseMatcher, error) { baseUrl, err := url.Parse(c.endpoint) if err != nil { return nil, err } baseUrl.Path += fmt.Sprintf("/v1/%v", req.GetName()) params := url.Values{} params.Add("$alt", "json;enum-encoding=int") baseUrl.RawQuery = params.Encode() // Build HTTP headers from client and context metadata. hds := []string{"x-goog-request-params", fmt.Sprintf("%s=%v", "name", url.QueryEscape(req.GetName()))} hds = append(c.xGoogHeaders, hds...) hds = append(hds, "Content-Type", "application/json") headers := gax.BuildHeaders(ctx, hds...) opts = append((*c.CallOptions).GetPhraseMatcher[0:len((*c.CallOptions).GetPhraseMatcher):len((*c.CallOptions).GetPhraseMatcher)], opts...) unm := protojson.UnmarshalOptions{AllowPartial: true, DiscardUnknown: true} resp := &contactcenterinsightspb.PhraseMatcher{} e := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error { if settings.Path != "" { baseUrl.Path = settings.Path } httpReq, err := http.NewRequest("GET", baseUrl.String(), nil) if err != nil { return err } httpReq = httpReq.WithContext(ctx) httpReq.Header = headers buf, err := executeHTTPRequest(ctx, c.httpClient, httpReq, c.logger, nil, "GetPhraseMatcher") if err != nil { return err } if err := unm.Unmarshal(buf, resp); err != nil { return err } return nil }, opts...) if e != nil { return nil, e } return resp, nil } // ListPhraseMatchers lists phrase matchers. func (c *restClient) ListPhraseMatchers(ctx context.Context, req *contactcenterinsightspb.ListPhraseMatchersRequest, opts ...gax.CallOption) *PhraseMatcherIterator { it := &PhraseMatcherIterator{} req = proto.Clone(req).(*contactcenterinsightspb.ListPhraseMatchersRequest) unm := protojson.UnmarshalOptions{AllowPartial: true, DiscardUnknown: true} it.InternalFetch = func(pageSize int, pageToken string) ([]*contactcenterinsightspb.PhraseMatcher, string, error) { resp := &contactcenterinsightspb.ListPhraseMatchersResponse{} if pageToken != "" { req.PageToken = pageToken } if pageSize > math.MaxInt32 { req.PageSize = math.MaxInt32 } else if pageSize != 0 { req.PageSize = int32(pageSize) } baseUrl, err := url.Parse(c.endpoint) if err != nil { return nil, "", err } baseUrl.Path += fmt.Sprintf("/v1/%v/phraseMatchers", req.GetParent()) params := url.Values{} params.Add("$alt", "json;enum-encoding=int") if req.GetFilter() != "" { params.Add("filter", fmt.Sprintf("%v", req.GetFilter())) } if req.GetPageSize() != 0 { params.Add("pageSize", fmt.Sprintf("%v", req.GetPageSize())) } if req.GetPageToken() != "" { params.Add("pageToken", fmt.Sprintf("%v", req.GetPageToken())) } baseUrl.RawQuery = params.Encode() // Build HTTP headers from client and context metadata. hds := append(c.xGoogHeaders, "Content-Type", "application/json") headers := gax.BuildHeaders(ctx, hds...) e := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error { if settings.Path != "" { baseUrl.Path = settings.Path } httpReq, err := http.NewRequest("GET", baseUrl.String(), nil) if err != nil { return err } httpReq.Header = headers buf, err := executeHTTPRequest(ctx, c.httpClient, httpReq, c.logger, nil, "ListPhraseMatchers") if err != nil { return err } if err := unm.Unmarshal(buf, resp); err != nil { return err } return nil }, opts...) if e != nil { return nil, "", e } it.Response = resp return resp.GetPhraseMatchers(), resp.GetNextPageToken(), 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.GetPageSize()) it.pageInfo.Token = req.GetPageToken() return it } // DeletePhraseMatcher deletes a phrase matcher. func (c *restClient) DeletePhraseMatcher(ctx context.Context, req *contactcenterinsightspb.DeletePhraseMatcherRequest, opts ...gax.CallOption) error { baseUrl, err := url.Parse(c.endpoint) if err != nil { return err } baseUrl.Path += fmt.Sprintf("/v1/%v", req.GetName()) params := url.Values{} params.Add("$alt", "json;enum-encoding=int") baseUrl.RawQuery = params.Encode() // Build HTTP headers from client and context metadata. hds := []string{"x-goog-request-params", fmt.Sprintf("%s=%v", "name", url.QueryEscape(req.GetName()))} hds = append(c.xGoogHeaders, hds...) hds = append(hds, "Content-Type", "application/json") headers := gax.BuildHeaders(ctx, hds...) return gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error { if settings.Path != "" { baseUrl.Path = settings.Path } httpReq, err := http.NewRequest("DELETE", baseUrl.String(), nil) if err != nil { return err } httpReq = httpReq.WithContext(ctx) httpReq.Header = headers _, err = executeHTTPRequest(ctx, c.httpClient, httpReq, c.logger, nil, "DeletePhraseMatcher") return err }, opts...) } // UpdatePhraseMatcher updates a phrase matcher. func (c *restClient) UpdatePhraseMatcher(ctx context.Context, req *contactcenterinsightspb.UpdatePhraseMatcherRequest, opts ...gax.CallOption) (*contactcenterinsightspb.PhraseMatcher, error) { m := protojson.MarshalOptions{AllowPartial: true, UseEnumNumbers: true} body := req.GetPhraseMatcher() jsonReq, err := m.Marshal(body) if err != nil { return nil, err } baseUrl, err := url.Parse(c.endpoint) if err != nil { return nil, err } baseUrl.Path += fmt.Sprintf("/v1/%v", req.GetPhraseMatcher().GetName()) params := url.Values{} params.Add("$alt", "json;enum-encoding=int") if req.GetUpdateMask() != nil { field, err := protojson.Marshal(req.GetUpdateMask()) if err != nil { return nil, err } params.Add("updateMask", string(field[1:len(field)-1])) } baseUrl.RawQuery = params.Encode() // Build HTTP headers from client and context metadata. hds := []string{"x-goog-request-params", fmt.Sprintf("%s=%v", "phrase_matcher.name", url.QueryEscape(req.GetPhraseMatcher().GetName()))} hds = append(c.xGoogHeaders, hds...) hds = append(hds, "Content-Type", "application/json") headers := gax.BuildHeaders(ctx, hds...) opts = append((*c.CallOptions).UpdatePhraseMatcher[0:len((*c.CallOptions).UpdatePhraseMatcher):len((*c.CallOptions).UpdatePhraseMatcher)], opts...) unm := protojson.UnmarshalOptions{AllowPartial: true, DiscardUnknown: true} resp := &contactcenterinsightspb.PhraseMatcher{} e := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error { if settings.Path != "" { baseUrl.Path = settings.Path } httpReq, err := http.NewRequest("PATCH", baseUrl.String(), bytes.NewReader(jsonReq)) if err != nil { return err } httpReq = httpReq.WithContext(ctx) httpReq.Header = headers buf, err := executeHTTPRequest(ctx, c.httpClient, httpReq, c.logger, jsonReq, "UpdatePhraseMatcher") if err != nil { return err } if err := unm.Unmarshal(buf, resp); err != nil { return err } return nil }, opts...) if e != nil { return nil, e } return resp, nil } // CalculateStats gets conversation statistics. func (c *restClient) CalculateStats(ctx context.Context, req *contactcenterinsightspb.CalculateStatsRequest, opts ...gax.CallOption) (*contactcenterinsightspb.CalculateStatsResponse, error) { baseUrl, err := url.Parse(c.endpoint) if err != nil { return nil, err } baseUrl.Path += fmt.Sprintf("/v1/%v/conversations:calculateStats", req.GetLocation()) params := url.Values{} params.Add("$alt", "json;enum-encoding=int") if req.GetFilter() != "" { params.Add("filter", fmt.Sprintf("%v", req.GetFilter())) } baseUrl.RawQuery = params.Encode() // Build HTTP headers from client and context metadata. hds := []string{"x-goog-request-params", fmt.Sprintf("%s=%v", "location", url.QueryEscape(req.GetLocation()))} hds = append(c.xGoogHeaders, hds...) hds = append(hds, "Content-Type", "application/json") headers := gax.BuildHeaders(ctx, hds...) opts = append((*c.CallOptions).CalculateStats[0:len((*c.CallOptions).CalculateStats):len((*c.CallOptions).CalculateStats)], opts...) unm := protojson.UnmarshalOptions{AllowPartial: true, DiscardUnknown: true} resp := &contactcenterinsightspb.CalculateStatsResponse{} e := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error { if settings.Path != "" { baseUrl.Path = settings.Path } httpReq, err := http.NewRequest("GET", baseUrl.String(), nil) if err != nil { return err } httpReq = httpReq.WithContext(ctx) httpReq.Header = headers buf, err := executeHTTPRequest(ctx, c.httpClient, httpReq, c.logger, nil, "CalculateStats") if err != nil { return err } if err := unm.Unmarshal(buf, resp); err != nil { return err } return nil }, opts...) if e != nil { return nil, e } return resp, nil } // GetSettings gets project-level settings. func (c *restClient) GetSettings(ctx context.Context, req *contactcenterinsightspb.GetSettingsRequest, opts ...gax.CallOption) (*contactcenterinsightspb.Settings, error) { baseUrl, err := url.Parse(c.endpoint) if err != nil { return nil, err } baseUrl.Path += fmt.Sprintf("/v1/%v", req.GetName()) params := url.Values{} params.Add("$alt", "json;enum-encoding=int") baseUrl.RawQuery = params.Encode() // Build HTTP headers from client and context metadata. hds := []string{"x-goog-request-params", fmt.Sprintf("%s=%v", "name", url.QueryEscape(req.GetName()))} hds = append(c.xGoogHeaders, hds...) hds = append(hds, "Content-Type", "application/json") headers := gax.BuildHeaders(ctx, hds...) opts = append((*c.CallOptions).GetSettings[0:len((*c.CallOptions).GetSettings):len((*c.CallOptions).GetSettings)], opts...) unm := protojson.UnmarshalOptions{AllowPartial: true, DiscardUnknown: true} resp := &contactcenterinsightspb.Settings{} e := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error { if settings.Path != "" { baseUrl.Path = settings.Path } httpReq, err := http.NewRequest("GET", baseUrl.String(), nil) if err != nil { return err } httpReq = httpReq.WithContext(ctx) httpReq.Header = headers buf, err := executeHTTPRequest(ctx, c.httpClient, httpReq, c.logger, nil, "GetSettings") if err != nil { return err } if err := unm.Unmarshal(buf, resp); err != nil { return err } return nil }, opts...) if e != nil { return nil, e } return resp, nil } // UpdateSettings updates project-level settings. func (c *restClient) UpdateSettings(ctx context.Context, req *contactcenterinsightspb.UpdateSettingsRequest, opts ...gax.CallOption) (*contactcenterinsightspb.Settings, error) { m := protojson.MarshalOptions{AllowPartial: true, UseEnumNumbers: true} body := req.GetSettings() jsonReq, err := m.Marshal(body) if err != nil { return nil, err } baseUrl, err := url.Parse(c.endpoint) if err != nil { return nil, err } baseUrl.Path += fmt.Sprintf("/v1/%v", req.GetSettings().GetName()) params := url.Values{} params.Add("$alt", "json;enum-encoding=int") if req.GetUpdateMask() != nil { field, err := protojson.Marshal(req.GetUpdateMask()) if err != nil { return nil, err } params.Add("updateMask", string(field[1:len(field)-1])) } baseUrl.RawQuery = params.Encode() // Build HTTP headers from client and context metadata. hds := []string{"x-goog-request-params", fmt.Sprintf("%s=%v", "settings.name", url.QueryEscape(req.GetSettings().GetName()))} hds = append(c.xGoogHeaders, hds...) hds = append(hds, "Content-Type", "application/json") headers := gax.BuildHeaders(ctx, hds...) opts = append((*c.CallOptions).UpdateSettings[0:len((*c.CallOptions).UpdateSettings):len((*c.CallOptions).UpdateSettings)], opts...) unm := protojson.UnmarshalOptions{AllowPartial: true, DiscardUnknown: true} resp := &contactcenterinsightspb.Settings{} e := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error { if settings.Path != "" { baseUrl.Path = settings.Path } httpReq, err := http.NewRequest("PATCH", baseUrl.String(), bytes.NewReader(jsonReq)) if err != nil { return err } httpReq = httpReq.WithContext(ctx) httpReq.Header = headers buf, err := executeHTTPRequest(ctx, c.httpClient, httpReq, c.logger, jsonReq, "UpdateSettings") if err != nil { return err } if err := unm.Unmarshal(buf, resp); err != nil { return err } return nil }, opts...) if e != nil { return nil, e } return resp, nil } // CreateAnalysisRule creates a analysis rule. func (c *restClient) CreateAnalysisRule(ctx context.Context, req *contactcenterinsightspb.CreateAnalysisRuleRequest, opts ...gax.CallOption) (*contactcenterinsightspb.AnalysisRule, error) { m := protojson.MarshalOptions{AllowPartial: true, UseEnumNumbers: true} body := req.GetAnalysisRule() jsonReq, err := m.Marshal(body) if err != nil { return nil, err } baseUrl, err := url.Parse(c.endpoint) if err != nil { return nil, err } baseUrl.Path += fmt.Sprintf("/v1/%v/analysisRules", req.GetParent()) params := url.Values{} params.Add("$alt", "json;enum-encoding=int") baseUrl.RawQuery = params.Encode() // Build HTTP headers from client and context metadata. hds := []string{"x-goog-request-params", fmt.Sprintf("%s=%v", "parent", url.QueryEscape(req.GetParent()))} hds = append(c.xGoogHeaders, hds...) hds = append(hds, "Content-Type", "application/json") headers := gax.BuildHeaders(ctx, hds...) opts = append((*c.CallOptions).CreateAnalysisRule[0:len((*c.CallOptions).CreateAnalysisRule):len((*c.CallOptions).CreateAnalysisRule)], opts...) unm := protojson.UnmarshalOptions{AllowPartial: true, DiscardUnknown: true} resp := &contactcenterinsightspb.AnalysisRule{} e := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error { if settings.Path != "" { baseUrl.Path = settings.Path } httpReq, err := http.NewRequest("POST", baseUrl.String(), bytes.NewReader(jsonReq)) if err != nil { return err } httpReq = httpReq.WithContext(ctx) httpReq.Header = headers buf, err := executeHTTPRequest(ctx, c.httpClient, httpReq, c.logger, jsonReq, "CreateAnalysisRule") if err != nil { return err } if err := unm.Unmarshal(buf, resp); err != nil { return err } return nil }, opts...) if e != nil { return nil, e } return resp, nil } // GetAnalysisRule get a analysis rule. func (c *restClient) GetAnalysisRule(ctx context.Context, req *contactcenterinsightspb.GetAnalysisRuleRequest, opts ...gax.CallOption) (*contactcenterinsightspb.AnalysisRule, error) { baseUrl, err := url.Parse(c.endpoint) if err != nil { return nil, err } baseUrl.Path += fmt.Sprintf("/v1/%v", req.GetName()) params := url.Values{} params.Add("$alt", "json;enum-encoding=int") baseUrl.RawQuery = params.Encode() // Build HTTP headers from client and context metadata. hds := []string{"x-goog-request-params", fmt.Sprintf("%s=%v", "name", url.QueryEscape(req.GetName()))} hds = append(c.xGoogHeaders, hds...) hds = append(hds, "Content-Type", "application/json") headers := gax.BuildHeaders(ctx, hds...) opts = append((*c.CallOptions).GetAnalysisRule[0:len((*c.CallOptions).GetAnalysisRule):len((*c.CallOptions).GetAnalysisRule)], opts...) unm := protojson.UnmarshalOptions{AllowPartial: true, DiscardUnknown: true} resp := &contactcenterinsightspb.AnalysisRule{} e := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error { if settings.Path != "" { baseUrl.Path = settings.Path } httpReq, err := http.NewRequest("GET", baseUrl.String(), nil) if err != nil { return err } httpReq = httpReq.WithContext(ctx) httpReq.Header = headers buf, err := executeHTTPRequest(ctx, c.httpClient, httpReq, c.logger, nil, "GetAnalysisRule") if err != nil { return err } if err := unm.Unmarshal(buf, resp); err != nil { return err } return nil }, opts...) if e != nil { return nil, e } return resp, nil } // ListAnalysisRules lists analysis rules. func (c *restClient) ListAnalysisRules(ctx context.Context, req *contactcenterinsightspb.ListAnalysisRulesRequest, opts ...gax.CallOption) *AnalysisRuleIterator { it := &AnalysisRuleIterator{} req = proto.Clone(req).(*contactcenterinsightspb.ListAnalysisRulesRequest) unm := protojson.UnmarshalOptions{AllowPartial: true, DiscardUnknown: true} it.InternalFetch = func(pageSize int, pageToken string) ([]*contactcenterinsightspb.AnalysisRule, string, error) { resp := &contactcenterinsightspb.ListAnalysisRulesResponse{} if pageToken != "" { req.PageToken = pageToken } if pageSize > math.MaxInt32 { req.PageSize = math.MaxInt32 } else if pageSize != 0 { req.PageSize = int32(pageSize) } baseUrl, err := url.Parse(c.endpoint) if err != nil { return nil, "", err } baseUrl.Path += fmt.Sprintf("/v1/%v/analysisRules", req.GetParent()) params := url.Values{} params.Add("$alt", "json;enum-encoding=int") if req.GetPageSize() != 0 { params.Add("pageSize", fmt.Sprintf("%v", req.GetPageSize())) } if req.GetPageToken() != "" { params.Add("pageToken", fmt.Sprintf("%v", req.GetPageToken())) } baseUrl.RawQuery = params.Encode() // Build HTTP headers from client and context metadata. hds := append(c.xGoogHeaders, "Content-Type", "application/json") headers := gax.BuildHeaders(ctx, hds...) e := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error { if settings.Path != "" { baseUrl.Path = settings.Path } httpReq, err := http.NewRequest("GET", baseUrl.String(), nil) if err != nil { return err } httpReq.Header = headers buf, err := executeHTTPRequest(ctx, c.httpClient, httpReq, c.logger, nil, "ListAnalysisRules") if err != nil { return err } if err := unm.Unmarshal(buf, resp); err != nil { return err } return nil }, opts...) if e != nil { return nil, "", e } it.Response = resp return resp.GetAnalysisRules(), resp.GetNextPageToken(), 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.GetPageSize()) it.pageInfo.Token = req.GetPageToken() return it } // UpdateAnalysisRule updates a analysis rule. func (c *restClient) UpdateAnalysisRule(ctx context.Context, req *contactcenterinsightspb.UpdateAnalysisRuleRequest, opts ...gax.CallOption) (*contactcenterinsightspb.AnalysisRule, error) { m := protojson.MarshalOptions{AllowPartial: true, UseEnumNumbers: true} body := req.GetAnalysisRule() jsonReq, err := m.Marshal(body) if err != nil { return nil, err } baseUrl, err := url.Parse(c.endpoint) if err != nil { return nil, err } baseUrl.Path += fmt.Sprintf("/v1/%v", req.GetAnalysisRule().GetName()) params := url.Values{} params.Add("$alt", "json;enum-encoding=int") if req.GetUpdateMask() != nil { field, err := protojson.Marshal(req.GetUpdateMask()) if err != nil { return nil, err } params.Add("updateMask", string(field[1:len(field)-1])) } baseUrl.RawQuery = params.Encode() // Build HTTP headers from client and context metadata. hds := []string{"x-goog-request-params", fmt.Sprintf("%s=%v", "analysis_rule.name", url.QueryEscape(req.GetAnalysisRule().GetName()))} hds = append(c.xGoogHeaders, hds...) hds = append(hds, "Content-Type", "application/json") headers := gax.BuildHeaders(ctx, hds...) opts = append((*c.CallOptions).UpdateAnalysisRule[0:len((*c.CallOptions).UpdateAnalysisRule):len((*c.CallOptions).UpdateAnalysisRule)], opts...) unm := protojson.UnmarshalOptions{AllowPartial: true, DiscardUnknown: true} resp := &contactcenterinsightspb.AnalysisRule{} e := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error { if settings.Path != "" { baseUrl.Path = settings.Path } httpReq, err := http.NewRequest("PATCH", baseUrl.String(), bytes.NewReader(jsonReq)) if err != nil { return err } httpReq = httpReq.WithContext(ctx) httpReq.Header = headers buf, err := executeHTTPRequest(ctx, c.httpClient, httpReq, c.logger, jsonReq, "UpdateAnalysisRule") if err != nil { return err } if err := unm.Unmarshal(buf, resp); err != nil { return err } return nil }, opts...) if e != nil { return nil, e } return resp, nil } // DeleteAnalysisRule deletes a analysis rule. func (c *restClient) DeleteAnalysisRule(ctx context.Context, req *contactcenterinsightspb.DeleteAnalysisRuleRequest, opts ...gax.CallOption) error { baseUrl, err := url.Parse(c.endpoint) if err != nil { return err } baseUrl.Path += fmt.Sprintf("/v1/%v", req.GetName()) params := url.Values{} params.Add("$alt", "json;enum-encoding=int") baseUrl.RawQuery = params.Encode() // Build HTTP headers from client and context metadata. hds := []string{"x-goog-request-params", fmt.Sprintf("%s=%v", "name", url.QueryEscape(req.GetName()))} hds = append(c.xGoogHeaders, hds...) hds = append(hds, "Content-Type", "application/json") headers := gax.BuildHeaders(ctx, hds...) return gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error { if settings.Path != "" { baseUrl.Path = settings.Path } httpReq, err := http.NewRequest("DELETE", baseUrl.String(), nil) if err != nil { return err } httpReq = httpReq.WithContext(ctx) httpReq.Header = headers _, err = executeHTTPRequest(ctx, c.httpClient, httpReq, c.logger, nil, "DeleteAnalysisRule") return err }, opts...) } // GetEncryptionSpec gets location-level encryption key specification. func (c *restClient) GetEncryptionSpec(ctx context.Context, req *contactcenterinsightspb.GetEncryptionSpecRequest, opts ...gax.CallOption) (*contactcenterinsightspb.EncryptionSpec, error) { baseUrl, err := url.Parse(c.endpoint) if err != nil { return nil, err } baseUrl.Path += fmt.Sprintf("/v1/%v", req.GetName()) params := url.Values{} params.Add("$alt", "json;enum-encoding=int") baseUrl.RawQuery = params.Encode() // Build HTTP headers from client and context metadata. hds := []string{"x-goog-request-params", fmt.Sprintf("%s=%v", "name", url.QueryEscape(req.GetName()))} hds = append(c.xGoogHeaders, hds...) hds = append(hds, "Content-Type", "application/json") headers := gax.BuildHeaders(ctx, hds...) opts = append((*c.CallOptions).GetEncryptionSpec[0:len((*c.CallOptions).GetEncryptionSpec):len((*c.CallOptions).GetEncryptionSpec)], opts...) unm := protojson.UnmarshalOptions{AllowPartial: true, DiscardUnknown: true} resp := &contactcenterinsightspb.EncryptionSpec{} e := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error { if settings.Path != "" { baseUrl.Path = settings.Path } httpReq, err := http.NewRequest("GET", baseUrl.String(), nil) if err != nil { return err } httpReq = httpReq.WithContext(ctx) httpReq.Header = headers buf, err := executeHTTPRequest(ctx, c.httpClient, httpReq, c.logger, nil, "GetEncryptionSpec") if err != nil { return err } if err := unm.Unmarshal(buf, resp); err != nil { return err } return nil }, opts...) if e != nil { return nil, e } return resp, nil } // InitializeEncryptionSpec initializes a location-level encryption key specification. An error will // result if the location has resources already created before the // initialization. After the encryption specification is initialized at a // location, it is immutable and all newly created resources under the // location will be encrypted with the existing specification. func (c *restClient) InitializeEncryptionSpec(ctx context.Context, req *contactcenterinsightspb.InitializeEncryptionSpecRequest, opts ...gax.CallOption) (*InitializeEncryptionSpecOperation, error) { m := protojson.MarshalOptions{AllowPartial: true, UseEnumNumbers: true} jsonReq, err := m.Marshal(req) if err != nil { return nil, err } baseUrl, err := url.Parse(c.endpoint) if err != nil { return nil, err } baseUrl.Path += fmt.Sprintf("/v1/%v:initialize", req.GetEncryptionSpec().GetName()) params := url.Values{} params.Add("$alt", "json;enum-encoding=int") baseUrl.RawQuery = params.Encode() // Build HTTP headers from client and context metadata. hds := []string{"x-goog-request-params", fmt.Sprintf("%s=%v", "encryption_spec.name", url.QueryEscape(req.GetEncryptionSpec().GetName()))} hds = append(c.xGoogHeaders, hds...) hds = append(hds, "Content-Type", "application/json") headers := gax.BuildHeaders(ctx, hds...) unm := protojson.UnmarshalOptions{AllowPartial: true, DiscardUnknown: true} resp := &longrunningpb.Operation{} e := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error { if settings.Path != "" { baseUrl.Path = settings.Path } httpReq, err := http.NewRequest("POST", baseUrl.String(), bytes.NewReader(jsonReq)) if err != nil { return err } httpReq = httpReq.WithContext(ctx) httpReq.Header = headers buf, err := executeHTTPRequest(ctx, c.httpClient, httpReq, c.logger, jsonReq, "InitializeEncryptionSpec") if err != nil { return err } if err := unm.Unmarshal(buf, resp); err != nil { return err } return nil }, opts...) if e != nil { return nil, e } override := fmt.Sprintf("/v1/%s", resp.GetName()) return &InitializeEncryptionSpecOperation{ lro: longrunning.InternalNewOperation(*c.LROClient, resp), pollPath: override, }, nil } // CreateView creates a view. func (c *restClient) CreateView(ctx context.Context, req *contactcenterinsightspb.CreateViewRequest, opts ...gax.CallOption) (*contactcenterinsightspb.View, error) { m := protojson.MarshalOptions{AllowPartial: true, UseEnumNumbers: true} body := req.GetView() jsonReq, err := m.Marshal(body) if err != nil { return nil, err } baseUrl, err := url.Parse(c.endpoint) if err != nil { return nil, err } baseUrl.Path += fmt.Sprintf("/v1/%v/views", req.GetParent()) params := url.Values{} params.Add("$alt", "json;enum-encoding=int") baseUrl.RawQuery = params.Encode() // Build HTTP headers from client and context metadata. hds := []string{"x-goog-request-params", fmt.Sprintf("%s=%v", "parent", url.QueryEscape(req.GetParent()))} hds = append(c.xGoogHeaders, hds...) hds = append(hds, "Content-Type", "application/json") headers := gax.BuildHeaders(ctx, hds...) opts = append((*c.CallOptions).CreateView[0:len((*c.CallOptions).CreateView):len((*c.CallOptions).CreateView)], opts...) unm := protojson.UnmarshalOptions{AllowPartial: true, DiscardUnknown: true} resp := &contactcenterinsightspb.View{} e := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error { if settings.Path != "" { baseUrl.Path = settings.Path } httpReq, err := http.NewRequest("POST", baseUrl.String(), bytes.NewReader(jsonReq)) if err != nil { return err } httpReq = httpReq.WithContext(ctx) httpReq.Header = headers buf, err := executeHTTPRequest(ctx, c.httpClient, httpReq, c.logger, jsonReq, "CreateView") if err != nil { return err } if err := unm.Unmarshal(buf, resp); err != nil { return err } return nil }, opts...) if e != nil { return nil, e } return resp, nil } // GetView gets a view. func (c *restClient) GetView(ctx context.Context, req *contactcenterinsightspb.GetViewRequest, opts ...gax.CallOption) (*contactcenterinsightspb.View, error) { baseUrl, err := url.Parse(c.endpoint) if err != nil { return nil, err } baseUrl.Path += fmt.Sprintf("/v1/%v", req.GetName()) params := url.Values{} params.Add("$alt", "json;enum-encoding=int") baseUrl.RawQuery = params.Encode() // Build HTTP headers from client and context metadata. hds := []string{"x-goog-request-params", fmt.Sprintf("%s=%v", "name", url.QueryEscape(req.GetName()))} hds = append(c.xGoogHeaders, hds...) hds = append(hds, "Content-Type", "application/json") headers := gax.BuildHeaders(ctx, hds...) opts = append((*c.CallOptions).GetView[0:len((*c.CallOptions).GetView):len((*c.CallOptions).GetView)], opts...) unm := protojson.UnmarshalOptions{AllowPartial: true, DiscardUnknown: true} resp := &contactcenterinsightspb.View{} e := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error { if settings.Path != "" { baseUrl.Path = settings.Path } httpReq, err := http.NewRequest("GET", baseUrl.String(), nil) if err != nil { return err } httpReq = httpReq.WithContext(ctx) httpReq.Header = headers buf, err := executeHTTPRequest(ctx, c.httpClient, httpReq, c.logger, nil, "GetView") if err != nil { return err } if err := unm.Unmarshal(buf, resp); err != nil { return err } return nil }, opts...) if e != nil { return nil, e } return resp, nil } // ListViews lists views. func (c *restClient) ListViews(ctx context.Context, req *contactcenterinsightspb.ListViewsRequest, opts ...gax.CallOption) *ViewIterator { it := &ViewIterator{} req = proto.Clone(req).(*contactcenterinsightspb.ListViewsRequest) unm := protojson.UnmarshalOptions{AllowPartial: true, DiscardUnknown: true} it.InternalFetch = func(pageSize int, pageToken string) ([]*contactcenterinsightspb.View, string, error) { resp := &contactcenterinsightspb.ListViewsResponse{} if pageToken != "" { req.PageToken = pageToken } if pageSize > math.MaxInt32 { req.PageSize = math.MaxInt32 } else if pageSize != 0 { req.PageSize = int32(pageSize) } baseUrl, err := url.Parse(c.endpoint) if err != nil { return nil, "", err } baseUrl.Path += fmt.Sprintf("/v1/%v/views", req.GetParent()) params := url.Values{} params.Add("$alt", "json;enum-encoding=int") if req.GetPageSize() != 0 { params.Add("pageSize", fmt.Sprintf("%v", req.GetPageSize())) } if req.GetPageToken() != "" { params.Add("pageToken", fmt.Sprintf("%v", req.GetPageToken())) } baseUrl.RawQuery = params.Encode() // Build HTTP headers from client and context metadata. hds := append(c.xGoogHeaders, "Content-Type", "application/json") headers := gax.BuildHeaders(ctx, hds...) e := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error { if settings.Path != "" { baseUrl.Path = settings.Path } httpReq, err := http.NewRequest("GET", baseUrl.String(), nil) if err != nil { return err } httpReq.Header = headers buf, err := executeHTTPRequest(ctx, c.httpClient, httpReq, c.logger, nil, "ListViews") if err != nil { return err } if err := unm.Unmarshal(buf, resp); err != nil { return err } return nil }, opts...) if e != nil { return nil, "", e } it.Response = resp return resp.GetViews(), resp.GetNextPageToken(), 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.GetPageSize()) it.pageInfo.Token = req.GetPageToken() return it } // UpdateView updates a view. func (c *restClient) UpdateView(ctx context.Context, req *contactcenterinsightspb.UpdateViewRequest, opts ...gax.CallOption) (*contactcenterinsightspb.View, error) { m := protojson.MarshalOptions{AllowPartial: true, UseEnumNumbers: true} body := req.GetView() jsonReq, err := m.Marshal(body) if err != nil { return nil, err } baseUrl, err := url.Parse(c.endpoint) if err != nil { return nil, err } baseUrl.Path += fmt.Sprintf("/v1/%v", req.GetView().GetName()) params := url.Values{} params.Add("$alt", "json;enum-encoding=int") if req.GetUpdateMask() != nil { field, err := protojson.Marshal(req.GetUpdateMask()) if err != nil { return nil, err } params.Add("updateMask", string(field[1:len(field)-1])) } baseUrl.RawQuery = params.Encode() // Build HTTP headers from client and context metadata. hds := []string{"x-goog-request-params", fmt.Sprintf("%s=%v", "view.name", url.QueryEscape(req.GetView().GetName()))} hds = append(c.xGoogHeaders, hds...) hds = append(hds, "Content-Type", "application/json") headers := gax.BuildHeaders(ctx, hds...) opts = append((*c.CallOptions).UpdateView[0:len((*c.CallOptions).UpdateView):len((*c.CallOptions).UpdateView)], opts...) unm := protojson.UnmarshalOptions{AllowPartial: true, DiscardUnknown: true} resp := &contactcenterinsightspb.View{} e := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error { if settings.Path != "" { baseUrl.Path = settings.Path } httpReq, err := http.NewRequest("PATCH", baseUrl.String(), bytes.NewReader(jsonReq)) if err != nil { return err } httpReq = httpReq.WithContext(ctx) httpReq.Header = headers buf, err := executeHTTPRequest(ctx, c.httpClient, httpReq, c.logger, jsonReq, "UpdateView") if err != nil { return err } if err := unm.Unmarshal(buf, resp); err != nil { return err } return nil }, opts...) if e != nil { return nil, e } return resp, nil } // DeleteView deletes a view. func (c *restClient) DeleteView(ctx context.Context, req *contactcenterinsightspb.DeleteViewRequest, opts ...gax.CallOption) error { baseUrl, err := url.Parse(c.endpoint) if err != nil { return err } baseUrl.Path += fmt.Sprintf("/v1/%v", req.GetName()) params := url.Values{} params.Add("$alt", "json;enum-encoding=int") baseUrl.RawQuery = params.Encode() // Build HTTP headers from client and context metadata. hds := []string{"x-goog-request-params", fmt.Sprintf("%s=%v", "name", url.QueryEscape(req.GetName()))} hds = append(c.xGoogHeaders, hds...) hds = append(hds, "Content-Type", "application/json") headers := gax.BuildHeaders(ctx, hds...) return gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error { if settings.Path != "" { baseUrl.Path = settings.Path } httpReq, err := http.NewRequest("DELETE", baseUrl.String(), nil) if err != nil { return err } httpReq = httpReq.WithContext(ctx) httpReq.Header = headers _, err = executeHTTPRequest(ctx, c.httpClient, httpReq, c.logger, nil, "DeleteView") return err }, opts...) } // QueryMetrics query metrics. func (c *restClient) QueryMetrics(ctx context.Context, req *contactcenterinsightspb.QueryMetricsRequest, opts ...gax.CallOption) (*QueryMetricsOperation, error) { m := protojson.MarshalOptions{AllowPartial: true, UseEnumNumbers: true} jsonReq, err := m.Marshal(req) if err != nil { return nil, err } baseUrl, err := url.Parse(c.endpoint) if err != nil { return nil, err } baseUrl.Path += fmt.Sprintf("/v1/%v:queryMetrics", req.GetLocation()) params := url.Values{} params.Add("$alt", "json;enum-encoding=int") baseUrl.RawQuery = params.Encode() // Build HTTP headers from client and context metadata. hds := []string{"x-goog-request-params", fmt.Sprintf("%s=%v", "location", url.QueryEscape(req.GetLocation()))} hds = append(c.xGoogHeaders, hds...) hds = append(hds, "Content-Type", "application/json") headers := gax.BuildHeaders(ctx, hds...) unm := protojson.UnmarshalOptions{AllowPartial: true, DiscardUnknown: true} resp := &longrunningpb.Operation{} e := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error { if settings.Path != "" { baseUrl.Path = settings.Path } httpReq, err := http.NewRequest("POST", baseUrl.String(), bytes.NewReader(jsonReq)) if err != nil { return err } httpReq = httpReq.WithContext(ctx) httpReq.Header = headers buf, err := executeHTTPRequest(ctx, c.httpClient, httpReq, c.logger, jsonReq, "QueryMetrics") if err != nil { return err } if err := unm.Unmarshal(buf, resp); err != nil { return err } return nil }, opts...) if e != nil { return nil, e } override := fmt.Sprintf("/v1/%s", resp.GetName()) return &QueryMetricsOperation{ lro: longrunning.InternalNewOperation(*c.LROClient, resp), pollPath: override, }, nil } // CreateQaQuestion create a QaQuestion. func (c *restClient) CreateQaQuestion(ctx context.Context, req *contactcenterinsightspb.CreateQaQuestionRequest, opts ...gax.CallOption) (*contactcenterinsightspb.QaQuestion, error) { m := protojson.MarshalOptions{AllowPartial: true, UseEnumNumbers: true} body := req.GetQaQuestion() jsonReq, err := m.Marshal(body) if err != nil { return nil, err } baseUrl, err := url.Parse(c.endpoint) if err != nil { return nil, err } baseUrl.Path += fmt.Sprintf("/v1/%v/qaQuestions", req.GetParent()) params := url.Values{} params.Add("$alt", "json;enum-encoding=int") if req.GetQaQuestionId() != "" { params.Add("qaQuestionId", fmt.Sprintf("%v", req.GetQaQuestionId())) } baseUrl.RawQuery = params.Encode() // Build HTTP headers from client and context metadata. hds := []string{"x-goog-request-params", fmt.Sprintf("%s=%v", "parent", url.QueryEscape(req.GetParent()))} hds = append(c.xGoogHeaders, hds...) hds = append(hds, "Content-Type", "application/json") headers := gax.BuildHeaders(ctx, hds...) opts = append((*c.CallOptions).CreateQaQuestion[0:len((*c.CallOptions).CreateQaQuestion):len((*c.CallOptions).CreateQaQuestion)], opts...) unm := protojson.UnmarshalOptions{AllowPartial: true, DiscardUnknown: true} resp := &contactcenterinsightspb.QaQuestion{} e := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error { if settings.Path != "" { baseUrl.Path = settings.Path } httpReq, err := http.NewRequest("POST", baseUrl.String(), bytes.NewReader(jsonReq)) if err != nil { return err } httpReq = httpReq.WithContext(ctx) httpReq.Header = headers buf, err := executeHTTPRequest(ctx, c.httpClient, httpReq, c.logger, jsonReq, "CreateQaQuestion") if err != nil { return err } if err := unm.Unmarshal(buf, resp); err != nil { return err } return nil }, opts...) if e != nil { return nil, e } return resp, nil } // GetQaQuestion gets a QaQuestion. func (c *restClient) GetQaQuestion(ctx context.Context, req *contactcenterinsightspb.GetQaQuestionRequest, opts ...gax.CallOption) (*contactcenterinsightspb.QaQuestion, error) { baseUrl, err := url.Parse(c.endpoint) if err != nil { return nil, err } baseUrl.Path += fmt.Sprintf("/v1/%v", req.GetName()) params := url.Values{} params.Add("$alt", "json;enum-encoding=int") baseUrl.RawQuery = params.Encode() // Build HTTP headers from client and context metadata. hds := []string{"x-goog-request-params", fmt.Sprintf("%s=%v", "name", url.QueryEscape(req.GetName()))} hds = append(c.xGoogHeaders, hds...) hds = append(hds, "Content-Type", "application/json") headers := gax.BuildHeaders(ctx, hds...) opts = append((*c.CallOptions).GetQaQuestion[0:len((*c.CallOptions).GetQaQuestion):len((*c.CallOptions).GetQaQuestion)], opts...) unm := protojson.UnmarshalOptions{AllowPartial: true, DiscardUnknown: true} resp := &contactcenterinsightspb.QaQuestion{} e := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error { if settings.Path != "" { baseUrl.Path = settings.Path } httpReq, err := http.NewRequest("GET", baseUrl.String(), nil) if err != nil { return err } httpReq = httpReq.WithContext(ctx) httpReq.Header = headers buf, err := executeHTTPRequest(ctx, c.httpClient, httpReq, c.logger, nil, "GetQaQuestion") if err != nil { return err } if err := unm.Unmarshal(buf, resp); err != nil { return err } return nil }, opts...) if e != nil { return nil, e } return resp, nil } // UpdateQaQuestion updates a QaQuestion. func (c *restClient) UpdateQaQuestion(ctx context.Context, req *contactcenterinsightspb.UpdateQaQuestionRequest, opts ...gax.CallOption) (*contactcenterinsightspb.QaQuestion, error) { m := protojson.MarshalOptions{AllowPartial: true, UseEnumNumbers: true} body := req.GetQaQuestion() jsonReq, err := m.Marshal(body) if err != nil { return nil, err } baseUrl, err := url.Parse(c.endpoint) if err != nil { return nil, err } baseUrl.Path += fmt.Sprintf("/v1/%v", req.GetQaQuestion().GetName()) params := url.Values{} params.Add("$alt", "json;enum-encoding=int") if req.GetUpdateMask() != nil { field, err := protojson.Marshal(req.GetUpdateMask()) if err != nil { return nil, err } params.Add("updateMask", string(field[1:len(field)-1])) } baseUrl.RawQuery = params.Encode() // Build HTTP headers from client and context metadata. hds := []string{"x-goog-request-params", fmt.Sprintf("%s=%v", "qa_question.name", url.QueryEscape(req.GetQaQuestion().GetName()))} hds = append(c.xGoogHeaders, hds...) hds = append(hds, "Content-Type", "application/json") headers := gax.BuildHeaders(ctx, hds...) opts = append((*c.CallOptions).UpdateQaQuestion[0:len((*c.CallOptions).UpdateQaQuestion):len((*c.CallOptions).UpdateQaQuestion)], opts...) unm := protojson.UnmarshalOptions{AllowPartial: true, DiscardUnknown: true} resp := &contactcenterinsightspb.QaQuestion{} e := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error { if settings.Path != "" { baseUrl.Path = settings.Path } httpReq, err := http.NewRequest("PATCH", baseUrl.String(), bytes.NewReader(jsonReq)) if err != nil { return err } httpReq = httpReq.WithContext(ctx) httpReq.Header = headers buf, err := executeHTTPRequest(ctx, c.httpClient, httpReq, c.logger, jsonReq, "UpdateQaQuestion") if err != nil { return err } if err := unm.Unmarshal(buf, resp); err != nil { return err } return nil }, opts...) if e != nil { return nil, e } return resp, nil } // DeleteQaQuestion deletes a QaQuestion. func (c *restClient) DeleteQaQuestion(ctx context.Context, req *contactcenterinsightspb.DeleteQaQuestionRequest, opts ...gax.CallOption) error { baseUrl, err := url.Parse(c.endpoint) if err != nil { return err } baseUrl.Path += fmt.Sprintf("/v1/%v", req.GetName()) params := url.Values{} params.Add("$alt", "json;enum-encoding=int") baseUrl.RawQuery = params.Encode() // Build HTTP headers from client and context metadata. hds := []string{"x-goog-request-params", fmt.Sprintf("%s=%v", "name", url.QueryEscape(req.GetName()))} hds = append(c.xGoogHeaders, hds...) hds = append(hds, "Content-Type", "application/json") headers := gax.BuildHeaders(ctx, hds...) return gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error { if settings.Path != "" { baseUrl.Path = settings.Path } httpReq, err := http.NewRequest("DELETE", baseUrl.String(), nil) if err != nil { return err } httpReq = httpReq.WithContext(ctx) httpReq.Header = headers _, err = executeHTTPRequest(ctx, c.httpClient, httpReq, c.logger, nil, "DeleteQaQuestion") return err }, opts...) } // ListQaQuestions lists QaQuestions. func (c *restClient) ListQaQuestions(ctx context.Context, req *contactcenterinsightspb.ListQaQuestionsRequest, opts ...gax.CallOption) *QaQuestionIterator { it := &QaQuestionIterator{} req = proto.Clone(req).(*contactcenterinsightspb.ListQaQuestionsRequest) unm := protojson.UnmarshalOptions{AllowPartial: true, DiscardUnknown: true} it.InternalFetch = func(pageSize int, pageToken string) ([]*contactcenterinsightspb.QaQuestion, string, error) { resp := &contactcenterinsightspb.ListQaQuestionsResponse{} if pageToken != "" { req.PageToken = pageToken } if pageSize > math.MaxInt32 { req.PageSize = math.MaxInt32 } else if pageSize != 0 { req.PageSize = int32(pageSize) } baseUrl, err := url.Parse(c.endpoint) if err != nil { return nil, "", err } baseUrl.Path += fmt.Sprintf("/v1/%v/qaQuestions", req.GetParent()) params := url.Values{} params.Add("$alt", "json;enum-encoding=int") if req.GetPageSize() != 0 { params.Add("pageSize", fmt.Sprintf("%v", req.GetPageSize())) } if req.GetPageToken() != "" { params.Add("pageToken", fmt.Sprintf("%v", req.GetPageToken())) } baseUrl.RawQuery = params.Encode() // Build HTTP headers from client and context metadata. hds := append(c.xGoogHeaders, "Content-Type", "application/json") headers := gax.BuildHeaders(ctx, hds...) e := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error { if settings.Path != "" { baseUrl.Path = settings.Path } httpReq, err := http.NewRequest("GET", baseUrl.String(), nil) if err != nil { return err } httpReq.Header = headers buf, err := executeHTTPRequest(ctx, c.httpClient, httpReq, c.logger, nil, "ListQaQuestions") if err != nil { return err } if err := unm.Unmarshal(buf, resp); err != nil { return err } return nil }, opts...) if e != nil { return nil, "", e } it.Response = resp return resp.GetQaQuestions(), resp.GetNextPageToken(), 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.GetPageSize()) it.pageInfo.Token = req.GetPageToken() return it } // CreateQaScorecard create a QaScorecard. func (c *restClient) CreateQaScorecard(ctx context.Context, req *contactcenterinsightspb.CreateQaScorecardRequest, opts ...gax.CallOption) (*contactcenterinsightspb.QaScorecard, error) { m := protojson.MarshalOptions{AllowPartial: true, UseEnumNumbers: true} body := req.GetQaScorecard() jsonReq, err := m.Marshal(body) if err != nil { return nil, err } baseUrl, err := url.Parse(c.endpoint) if err != nil { return nil, err } baseUrl.Path += fmt.Sprintf("/v1/%v/qaScorecards", req.GetParent()) params := url.Values{} params.Add("$alt", "json;enum-encoding=int") if req.GetQaScorecardId() != "" { params.Add("qaScorecardId", fmt.Sprintf("%v", req.GetQaScorecardId())) } baseUrl.RawQuery = params.Encode() // Build HTTP headers from client and context metadata. hds := []string{"x-goog-request-params", fmt.Sprintf("%s=%v", "parent", url.QueryEscape(req.GetParent()))} hds = append(c.xGoogHeaders, hds...) hds = append(hds, "Content-Type", "application/json") headers := gax.BuildHeaders(ctx, hds...) opts = append((*c.CallOptions).CreateQaScorecard[0:len((*c.CallOptions).CreateQaScorecard):len((*c.CallOptions).CreateQaScorecard)], opts...) unm := protojson.UnmarshalOptions{AllowPartial: true, DiscardUnknown: true} resp := &contactcenterinsightspb.QaScorecard{} e := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error { if settings.Path != "" { baseUrl.Path = settings.Path } httpReq, err := http.NewRequest("POST", baseUrl.String(), bytes.NewReader(jsonReq)) if err != nil { return err } httpReq = httpReq.WithContext(ctx) httpReq.Header = headers buf, err := executeHTTPRequest(ctx, c.httpClient, httpReq, c.logger, jsonReq, "CreateQaScorecard") if err != nil { return err } if err := unm.Unmarshal(buf, resp); err != nil { return err } return nil }, opts...) if e != nil { return nil, e } return resp, nil } // GetQaScorecard gets a QaScorecard. func (c *restClient) GetQaScorecard(ctx context.Context, req *contactcenterinsightspb.GetQaScorecardRequest, opts ...gax.CallOption) (*contactcenterinsightspb.QaScorecard, error) { baseUrl, err := url.Parse(c.endpoint) if err != nil { return nil, err } baseUrl.Path += fmt.Sprintf("/v1/%v", req.GetName()) params := url.Values{} params.Add("$alt", "json;enum-encoding=int") baseUrl.RawQuery = params.Encode() // Build HTTP headers from client and context metadata. hds := []string{"x-goog-request-params", fmt.Sprintf("%s=%v", "name", url.QueryEscape(req.GetName()))} hds = append(c.xGoogHeaders, hds...) hds = append(hds, "Content-Type", "application/json") headers := gax.BuildHeaders(ctx, hds...) opts = append((*c.CallOptions).GetQaScorecard[0:len((*c.CallOptions).GetQaScorecard):len((*c.CallOptions).GetQaScorecard)], opts...) unm := protojson.UnmarshalOptions{AllowPartial: true, DiscardUnknown: true} resp := &contactcenterinsightspb.QaScorecard{} e := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error { if settings.Path != "" { baseUrl.Path = settings.Path } httpReq, err := http.NewRequest("GET", baseUrl.String(), nil) if err != nil { return err } httpReq = httpReq.WithContext(ctx) httpReq.Header = headers buf, err := executeHTTPRequest(ctx, c.httpClient, httpReq, c.logger, nil, "GetQaScorecard") if err != nil { return err } if err := unm.Unmarshal(buf, resp); err != nil { return err } return nil }, opts...) if e != nil { return nil, e } return resp, nil } // UpdateQaScorecard updates a QaScorecard. func (c *restClient) UpdateQaScorecard(ctx context.Context, req *contactcenterinsightspb.UpdateQaScorecardRequest, opts ...gax.CallOption) (*contactcenterinsightspb.QaScorecard, error) { m := protojson.MarshalOptions{AllowPartial: true, UseEnumNumbers: true} body := req.GetQaScorecard() jsonReq, err := m.Marshal(body) if err != nil { return nil, err } baseUrl, err := url.Parse(c.endpoint) if err != nil { return nil, err } baseUrl.Path += fmt.Sprintf("/v1/%v", req.GetQaScorecard().GetName()) params := url.Values{} params.Add("$alt", "json;enum-encoding=int") if req.GetUpdateMask() != nil { field, err := protojson.Marshal(req.GetUpdateMask()) if err != nil { return nil, err } params.Add("updateMask", string(field[1:len(field)-1])) } baseUrl.RawQuery = params.Encode() // Build HTTP headers from client and context metadata. hds := []string{"x-goog-request-params", fmt.Sprintf("%s=%v", "qa_scorecard.name", url.QueryEscape(req.GetQaScorecard().GetName()))} hds = append(c.xGoogHeaders, hds...) hds = append(hds, "Content-Type", "application/json") headers := gax.BuildHeaders(ctx, hds...) opts = append((*c.CallOptions).UpdateQaScorecard[0:len((*c.CallOptions).UpdateQaScorecard):len((*c.CallOptions).UpdateQaScorecard)], opts...) unm := protojson.UnmarshalOptions{AllowPartial: true, DiscardUnknown: true} resp := &contactcenterinsightspb.QaScorecard{} e := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error { if settings.Path != "" { baseUrl.Path = settings.Path } httpReq, err := http.NewRequest("PATCH", baseUrl.String(), bytes.NewReader(jsonReq)) if err != nil { return err } httpReq = httpReq.WithContext(ctx) httpReq.Header = headers buf, err := executeHTTPRequest(ctx, c.httpClient, httpReq, c.logger, jsonReq, "UpdateQaScorecard") if err != nil { return err } if err := unm.Unmarshal(buf, resp); err != nil { return err } return nil }, opts...) if e != nil { return nil, e } return resp, nil } // DeleteQaScorecard deletes a QaScorecard. func (c *restClient) DeleteQaScorecard(ctx context.Context, req *contactcenterinsightspb.DeleteQaScorecardRequest, opts ...gax.CallOption) error { baseUrl, err := url.Parse(c.endpoint) if err != nil { return err } baseUrl.Path += fmt.Sprintf("/v1/%v", req.GetName()) params := url.Values{} params.Add("$alt", "json;enum-encoding=int") if req.GetForce() { params.Add("force", fmt.Sprintf("%v", req.GetForce())) } baseUrl.RawQuery = params.Encode() // Build HTTP headers from client and context metadata. hds := []string{"x-goog-request-params", fmt.Sprintf("%s=%v", "name", url.QueryEscape(req.GetName()))} hds = append(c.xGoogHeaders, hds...) hds = append(hds, "Content-Type", "application/json") headers := gax.BuildHeaders(ctx, hds...) return gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error { if settings.Path != "" { baseUrl.Path = settings.Path } httpReq, err := http.NewRequest("DELETE", baseUrl.String(), nil) if err != nil { return err } httpReq = httpReq.WithContext(ctx) httpReq.Header = headers _, err = executeHTTPRequest(ctx, c.httpClient, httpReq, c.logger, nil, "DeleteQaScorecard") return err }, opts...) } // ListQaScorecards lists QaScorecards. func (c *restClient) ListQaScorecards(ctx context.Context, req *contactcenterinsightspb.ListQaScorecardsRequest, opts ...gax.CallOption) *QaScorecardIterator { it := &QaScorecardIterator{} req = proto.Clone(req).(*contactcenterinsightspb.ListQaScorecardsRequest) unm := protojson.UnmarshalOptions{AllowPartial: true, DiscardUnknown: true} it.InternalFetch = func(pageSize int, pageToken string) ([]*contactcenterinsightspb.QaScorecard, string, error) { resp := &contactcenterinsightspb.ListQaScorecardsResponse{} if pageToken != "" { req.PageToken = pageToken } if pageSize > math.MaxInt32 { req.PageSize = math.MaxInt32 } else if pageSize != 0 { req.PageSize = int32(pageSize) } baseUrl, err := url.Parse(c.endpoint) if err != nil { return nil, "", err } baseUrl.Path += fmt.Sprintf("/v1/%v/qaScorecards", req.GetParent()) params := url.Values{} params.Add("$alt", "json;enum-encoding=int") if req.GetPageSize() != 0 { params.Add("pageSize", fmt.Sprintf("%v", req.GetPageSize())) } if req.GetPageToken() != "" { params.Add("pageToken", fmt.Sprintf("%v", req.GetPageToken())) } baseUrl.RawQuery = params.Encode() // Build HTTP headers from client and context metadata. hds := append(c.xGoogHeaders, "Content-Type", "application/json") headers := gax.BuildHeaders(ctx, hds...) e := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error { if settings.Path != "" { baseUrl.Path = settings.Path } httpReq, err := http.NewRequest("GET", baseUrl.String(), nil) if err != nil { return err } httpReq.Header = headers buf, err := executeHTTPRequest(ctx, c.httpClient, httpReq, c.logger, nil, "ListQaScorecards") if err != nil { return err } if err := unm.Unmarshal(buf, resp); err != nil { return err } return nil }, opts...) if e != nil { return nil, "", e } it.Response = resp return resp.GetQaScorecards(), resp.GetNextPageToken(), 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.GetPageSize()) it.pageInfo.Token = req.GetPageToken() return it } // CreateQaScorecardRevision creates a QaScorecardRevision. func (c *restClient) CreateQaScorecardRevision(ctx context.Context, req *contactcenterinsightspb.CreateQaScorecardRevisionRequest, opts ...gax.CallOption) (*contactcenterinsightspb.QaScorecardRevision, error) { m := protojson.MarshalOptions{AllowPartial: true, UseEnumNumbers: true} body := req.GetQaScorecardRevision() jsonReq, err := m.Marshal(body) if err != nil { return nil, err } baseUrl, err := url.Parse(c.endpoint) if err != nil { return nil, err } baseUrl.Path += fmt.Sprintf("/v1/%v/revisions", req.GetParent()) params := url.Values{} params.Add("$alt", "json;enum-encoding=int") if req.GetQaScorecardRevisionId() != "" { params.Add("qaScorecardRevisionId", fmt.Sprintf("%v", req.GetQaScorecardRevisionId())) } baseUrl.RawQuery = params.Encode() // Build HTTP headers from client and context metadata. hds := []string{"x-goog-request-params", fmt.Sprintf("%s=%v", "parent", url.QueryEscape(req.GetParent()))} hds = append(c.xGoogHeaders, hds...) hds = append(hds, "Content-Type", "application/json") headers := gax.BuildHeaders(ctx, hds...) opts = append((*c.CallOptions).CreateQaScorecardRevision[0:len((*c.CallOptions).CreateQaScorecardRevision):len((*c.CallOptions).CreateQaScorecardRevision)], opts...) unm := protojson.UnmarshalOptions{AllowPartial: true, DiscardUnknown: true} resp := &contactcenterinsightspb.QaScorecardRevision{} e := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error { if settings.Path != "" { baseUrl.Path = settings.Path } httpReq, err := http.NewRequest("POST", baseUrl.String(), bytes.NewReader(jsonReq)) if err != nil { return err } httpReq = httpReq.WithContext(ctx) httpReq.Header = headers buf, err := executeHTTPRequest(ctx, c.httpClient, httpReq, c.logger, jsonReq, "CreateQaScorecardRevision") if err != nil { return err } if err := unm.Unmarshal(buf, resp); err != nil { return err } return nil }, opts...) if e != nil { return nil, e } return resp, nil } // GetQaScorecardRevision gets a QaScorecardRevision. func (c *restClient) GetQaScorecardRevision(ctx context.Context, req *contactcenterinsightspb.GetQaScorecardRevisionRequest, opts ...gax.CallOption) (*contactcenterinsightspb.QaScorecardRevision, error) { baseUrl, err := url.Parse(c.endpoint) if err != nil { return nil, err } baseUrl.Path += fmt.Sprintf("/v1/%v", req.GetName()) params := url.Values{} params.Add("$alt", "json;enum-encoding=int") baseUrl.RawQuery = params.Encode() // Build HTTP headers from client and context metadata. hds := []string{"x-goog-request-params", fmt.Sprintf("%s=%v", "name", url.QueryEscape(req.GetName()))} hds = append(c.xGoogHeaders, hds...) hds = append(hds, "Content-Type", "application/json") headers := gax.BuildHeaders(ctx, hds...) opts = append((*c.CallOptions).GetQaScorecardRevision[0:len((*c.CallOptions).GetQaScorecardRevision):len((*c.CallOptions).GetQaScorecardRevision)], opts...) unm := protojson.UnmarshalOptions{AllowPartial: true, DiscardUnknown: true} resp := &contactcenterinsightspb.QaScorecardRevision{} e := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error { if settings.Path != "" { baseUrl.Path = settings.Path } httpReq, err := http.NewRequest("GET", baseUrl.String(), nil) if err != nil { return err } httpReq = httpReq.WithContext(ctx) httpReq.Header = headers buf, err := executeHTTPRequest(ctx, c.httpClient, httpReq, c.logger, nil, "GetQaScorecardRevision") if err != nil { return err } if err := unm.Unmarshal(buf, resp); err != nil { return err } return nil }, opts...) if e != nil { return nil, e } return resp, nil } // TuneQaScorecardRevision fine tune one or more QaModels. func (c *restClient) TuneQaScorecardRevision(ctx context.Context, req *contactcenterinsightspb.TuneQaScorecardRevisionRequest, opts ...gax.CallOption) (*TuneQaScorecardRevisionOperation, error) { m := protojson.MarshalOptions{AllowPartial: true, UseEnumNumbers: true} jsonReq, err := m.Marshal(req) if err != nil { return nil, err } baseUrl, err := url.Parse(c.endpoint) if err != nil { return nil, err } baseUrl.Path += fmt.Sprintf("/v1/%v:tuneQaScorecardRevision", req.GetParent()) params := url.Values{} params.Add("$alt", "json;enum-encoding=int") baseUrl.RawQuery = params.Encode() // Build HTTP headers from client and context metadata. hds := []string{"x-goog-request-params", fmt.Sprintf("%s=%v", "parent", url.QueryEscape(req.GetParent()))} hds = append(c.xGoogHeaders, hds...) hds = append(hds, "Content-Type", "application/json") headers := gax.BuildHeaders(ctx, hds...) unm := protojson.UnmarshalOptions{AllowPartial: true, DiscardUnknown: true} resp := &longrunningpb.Operation{} e := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error { if settings.Path != "" { baseUrl.Path = settings.Path } httpReq, err := http.NewRequest("POST", baseUrl.String(), bytes.NewReader(jsonReq)) if err != nil { return err } httpReq = httpReq.WithContext(ctx) httpReq.Header = headers buf, err := executeHTTPRequest(ctx, c.httpClient, httpReq, c.logger, jsonReq, "TuneQaScorecardRevision") if err != nil { return err } if err := unm.Unmarshal(buf, resp); err != nil { return err } return nil }, opts...) if e != nil { return nil, e } override := fmt.Sprintf("/v1/%s", resp.GetName()) return &TuneQaScorecardRevisionOperation{ lro: longrunning.InternalNewOperation(*c.LROClient, resp), pollPath: override, }, nil } // DeployQaScorecardRevision deploy a QaScorecardRevision. func (c *restClient) DeployQaScorecardRevision(ctx context.Context, req *contactcenterinsightspb.DeployQaScorecardRevisionRequest, opts ...gax.CallOption) (*contactcenterinsightspb.QaScorecardRevision, error) { m := protojson.MarshalOptions{AllowPartial: true, UseEnumNumbers: true} jsonReq, err := m.Marshal(req) if err != nil { return nil, err } baseUrl, err := url.Parse(c.endpoint) if err != nil { return nil, err } baseUrl.Path += fmt.Sprintf("/v1/%v:deploy", req.GetName()) params := url.Values{} params.Add("$alt", "json;enum-encoding=int") baseUrl.RawQuery = params.Encode() // Build HTTP headers from client and context metadata. hds := []string{"x-goog-request-params", fmt.Sprintf("%s=%v", "name", url.QueryEscape(req.GetName()))} hds = append(c.xGoogHeaders, hds...) hds = append(hds, "Content-Type", "application/json") headers := gax.BuildHeaders(ctx, hds...) opts = append((*c.CallOptions).DeployQaScorecardRevision[0:len((*c.CallOptions).DeployQaScorecardRevision):len((*c.CallOptions).DeployQaScorecardRevision)], opts...) unm := protojson.UnmarshalOptions{AllowPartial: true, DiscardUnknown: true} resp := &contactcenterinsightspb.QaScorecardRevision{} e := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error { if settings.Path != "" { baseUrl.Path = settings.Path } httpReq, err := http.NewRequest("POST", baseUrl.String(), bytes.NewReader(jsonReq)) if err != nil { return err } httpReq = httpReq.WithContext(ctx) httpReq.Header = headers buf, err := executeHTTPRequest(ctx, c.httpClient, httpReq, c.logger, jsonReq, "DeployQaScorecardRevision") if err != nil { return err } if err := unm.Unmarshal(buf, resp); err != nil { return err } return nil }, opts...) if e != nil { return nil, e } return resp, nil } // UndeployQaScorecardRevision undeploy a QaScorecardRevision. func (c *restClient) UndeployQaScorecardRevision(ctx context.Context, req *contactcenterinsightspb.UndeployQaScorecardRevisionRequest, opts ...gax.CallOption) (*contactcenterinsightspb.QaScorecardRevision, error) { m := protojson.MarshalOptions{AllowPartial: true, UseEnumNumbers: true} jsonReq, err := m.Marshal(req) if err != nil { return nil, err } baseUrl, err := url.Parse(c.endpoint) if err != nil { return nil, err } baseUrl.Path += fmt.Sprintf("/v1/%v:undeploy", req.GetName()) params := url.Values{} params.Add("$alt", "json;enum-encoding=int") baseUrl.RawQuery = params.Encode() // Build HTTP headers from client and context metadata. hds := []string{"x-goog-request-params", fmt.Sprintf("%s=%v", "name", url.QueryEscape(req.GetName()))} hds = append(c.xGoogHeaders, hds...) hds = append(hds, "Content-Type", "application/json") headers := gax.BuildHeaders(ctx, hds...) opts = append((*c.CallOptions).UndeployQaScorecardRevision[0:len((*c.CallOptions).UndeployQaScorecardRevision):len((*c.CallOptions).UndeployQaScorecardRevision)], opts...) unm := protojson.UnmarshalOptions{AllowPartial: true, DiscardUnknown: true} resp := &contactcenterinsightspb.QaScorecardRevision{} e := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error { if settings.Path != "" { baseUrl.Path = settings.Path } httpReq, err := http.NewRequest("POST", baseUrl.String(), bytes.NewReader(jsonReq)) if err != nil { return err } httpReq = httpReq.WithContext(ctx) httpReq.Header = headers buf, err := executeHTTPRequest(ctx, c.httpClient, httpReq, c.logger, jsonReq, "UndeployQaScorecardRevision") if err != nil { return err } if err := unm.Unmarshal(buf, resp); err != nil { return err } return nil }, opts...) if e != nil { return nil, e } return resp, nil } // DeleteQaScorecardRevision deletes a QaScorecardRevision. func (c *restClient) DeleteQaScorecardRevision(ctx context.Context, req *contactcenterinsightspb.DeleteQaScorecardRevisionRequest, opts ...gax.CallOption) error { baseUrl, err := url.Parse(c.endpoint) if err != nil { return err } baseUrl.Path += fmt.Sprintf("/v1/%v", req.GetName()) params := url.Values{} params.Add("$alt", "json;enum-encoding=int") if req.GetForce() { params.Add("force", fmt.Sprintf("%v", req.GetForce())) } baseUrl.RawQuery = params.Encode() // Build HTTP headers from client and context metadata. hds := []string{"x-goog-request-params", fmt.Sprintf("%s=%v", "name", url.QueryEscape(req.GetName()))} hds = append(c.xGoogHeaders, hds...) hds = append(hds, "Content-Type", "application/json") headers := gax.BuildHeaders(ctx, hds...) return gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error { if settings.Path != "" { baseUrl.Path = settings.Path } httpReq, err := http.NewRequest("DELETE", baseUrl.String(), nil) if err != nil { return err } httpReq = httpReq.WithContext(ctx) httpReq.Header = headers _, err = executeHTTPRequest(ctx, c.httpClient, httpReq, c.logger, nil, "DeleteQaScorecardRevision") return err }, opts...) } // ListQaScorecardRevisions lists all revisions under the parent QaScorecard. func (c *restClient) ListQaScorecardRevisions(ctx context.Context, req *contactcenterinsightspb.ListQaScorecardRevisionsRequest, opts ...gax.CallOption) *QaScorecardRevisionIterator { it := &QaScorecardRevisionIterator{} req = proto.Clone(req).(*contactcenterinsightspb.ListQaScorecardRevisionsRequest) unm := protojson.UnmarshalOptions{AllowPartial: true, DiscardUnknown: true} it.InternalFetch = func(pageSize int, pageToken string) ([]*contactcenterinsightspb.QaScorecardRevision, string, error) { resp := &contactcenterinsightspb.ListQaScorecardRevisionsResponse{} if pageToken != "" { req.PageToken = pageToken } if pageSize > math.MaxInt32 { req.PageSize = math.MaxInt32 } else if pageSize != 0 { req.PageSize = int32(pageSize) } baseUrl, err := url.Parse(c.endpoint) if err != nil { return nil, "", err } baseUrl.Path += fmt.Sprintf("/v1/%v/revisions", req.GetParent()) params := url.Values{} params.Add("$alt", "json;enum-encoding=int") if req.GetFilter() != "" { params.Add("filter", fmt.Sprintf("%v", req.GetFilter())) } if req.GetPageSize() != 0 { params.Add("pageSize", fmt.Sprintf("%v", req.GetPageSize())) } if req.GetPageToken() != "" { params.Add("pageToken", fmt.Sprintf("%v", req.GetPageToken())) } baseUrl.RawQuery = params.Encode() // Build HTTP headers from client and context metadata. hds := append(c.xGoogHeaders, "Content-Type", "application/json") headers := gax.BuildHeaders(ctx, hds...) e := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error { if settings.Path != "" { baseUrl.Path = settings.Path } httpReq, err := http.NewRequest("GET", baseUrl.String(), nil) if err != nil { return err } httpReq.Header = headers buf, err := executeHTTPRequest(ctx, c.httpClient, httpReq, c.logger, nil, "ListQaScorecardRevisions") if err != nil { return err } if err := unm.Unmarshal(buf, resp); err != nil { return err } return nil }, opts...) if e != nil { return nil, "", e } it.Response = resp return resp.GetQaScorecardRevisions(), resp.GetNextPageToken(), 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.GetPageSize()) it.pageInfo.Token = req.GetPageToken() return it } // CreateFeedbackLabel create feedback label. func (c *restClient) CreateFeedbackLabel(ctx context.Context, req *contactcenterinsightspb.CreateFeedbackLabelRequest, opts ...gax.CallOption) (*contactcenterinsightspb.FeedbackLabel, error) { m := protojson.MarshalOptions{AllowPartial: true, UseEnumNumbers: true} body := req.GetFeedbackLabel() jsonReq, err := m.Marshal(body) if err != nil { return nil, err } baseUrl, err := url.Parse(c.endpoint) if err != nil { return nil, err } baseUrl.Path += fmt.Sprintf("/v1/%v/feedbackLabels", req.GetParent()) params := url.Values{} params.Add("$alt", "json;enum-encoding=int") if req.GetFeedbackLabelId() != "" { params.Add("feedbackLabelId", fmt.Sprintf("%v", req.GetFeedbackLabelId())) } baseUrl.RawQuery = params.Encode() // Build HTTP headers from client and context metadata. hds := []string{"x-goog-request-params", fmt.Sprintf("%s=%v", "parent", url.QueryEscape(req.GetParent()))} hds = append(c.xGoogHeaders, hds...) hds = append(hds, "Content-Type", "application/json") headers := gax.BuildHeaders(ctx, hds...) opts = append((*c.CallOptions).CreateFeedbackLabel[0:len((*c.CallOptions).CreateFeedbackLabel):len((*c.CallOptions).CreateFeedbackLabel)], opts...) unm := protojson.UnmarshalOptions{AllowPartial: true, DiscardUnknown: true} resp := &contactcenterinsightspb.FeedbackLabel{} e := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error { if settings.Path != "" { baseUrl.Path = settings.Path } httpReq, err := http.NewRequest("POST", baseUrl.String(), bytes.NewReader(jsonReq)) if err != nil { return err } httpReq = httpReq.WithContext(ctx) httpReq.Header = headers buf, err := executeHTTPRequest(ctx, c.httpClient, httpReq, c.logger, jsonReq, "CreateFeedbackLabel") if err != nil { return err } if err := unm.Unmarshal(buf, resp); err != nil { return err } return nil }, opts...) if e != nil { return nil, e } return resp, nil } // ListFeedbackLabels list feedback labels. func (c *restClient) ListFeedbackLabels(ctx context.Context, req *contactcenterinsightspb.ListFeedbackLabelsRequest, opts ...gax.CallOption) *FeedbackLabelIterator { it := &FeedbackLabelIterator{} req = proto.Clone(req).(*contactcenterinsightspb.ListFeedbackLabelsRequest) unm := protojson.UnmarshalOptions{AllowPartial: true, DiscardUnknown: true} it.InternalFetch = func(pageSize int, pageToken string) ([]*contactcenterinsightspb.FeedbackLabel, string, error) { resp := &contactcenterinsightspb.ListFeedbackLabelsResponse{} if pageToken != "" { req.PageToken = pageToken } if pageSize > math.MaxInt32 { req.PageSize = math.MaxInt32 } else if pageSize != 0 { req.PageSize = int32(pageSize) } baseUrl, err := url.Parse(c.endpoint) if err != nil { return nil, "", err } baseUrl.Path += fmt.Sprintf("/v1/%v/feedbackLabels", req.GetParent()) params := url.Values{} params.Add("$alt", "json;enum-encoding=int") if req.GetFilter() != "" { params.Add("filter", fmt.Sprintf("%v", req.GetFilter())) } if req.GetPageSize() != 0 { params.Add("pageSize", fmt.Sprintf("%v", req.GetPageSize())) } if req.GetPageToken() != "" { params.Add("pageToken", fmt.Sprintf("%v", req.GetPageToken())) } baseUrl.RawQuery = params.Encode() // Build HTTP headers from client and context metadata. hds := append(c.xGoogHeaders, "Content-Type", "application/json") headers := gax.BuildHeaders(ctx, hds...) e := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error { if settings.Path != "" { baseUrl.Path = settings.Path } httpReq, err := http.NewRequest("GET", baseUrl.String(), nil) if err != nil { return err } httpReq.Header = headers buf, err := executeHTTPRequest(ctx, c.httpClient, httpReq, c.logger, nil, "ListFeedbackLabels") if err != nil { return err } if err := unm.Unmarshal(buf, resp); err != nil { return err } return nil }, opts...) if e != nil { return nil, "", e } it.Response = resp return resp.GetFeedbackLabels(), resp.GetNextPageToken(), 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.GetPageSize()) it.pageInfo.Token = req.GetPageToken() return it } // GetFeedbackLabel get feedback label. func (c *restClient) GetFeedbackLabel(ctx context.Context, req *contactcenterinsightspb.GetFeedbackLabelRequest, opts ...gax.CallOption) (*contactcenterinsightspb.FeedbackLabel, error) { baseUrl, err := url.Parse(c.endpoint) if err != nil { return nil, err } baseUrl.Path += fmt.Sprintf("/v1/%v", req.GetName()) params := url.Values{} params.Add("$alt", "json;enum-encoding=int") baseUrl.RawQuery = params.Encode() // Build HTTP headers from client and context metadata. hds := []string{"x-goog-request-params", fmt.Sprintf("%s=%v", "name", url.QueryEscape(req.GetName()))} hds = append(c.xGoogHeaders, hds...) hds = append(hds, "Content-Type", "application/json") headers := gax.BuildHeaders(ctx, hds...) opts = append((*c.CallOptions).GetFeedbackLabel[0:len((*c.CallOptions).GetFeedbackLabel):len((*c.CallOptions).GetFeedbackLabel)], opts...) unm := protojson.UnmarshalOptions{AllowPartial: true, DiscardUnknown: true} resp := &contactcenterinsightspb.FeedbackLabel{} e := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error { if settings.Path != "" { baseUrl.Path = settings.Path } httpReq, err := http.NewRequest("GET", baseUrl.String(), nil) if err != nil { return err } httpReq = httpReq.WithContext(ctx) httpReq.Header = headers buf, err := executeHTTPRequest(ctx, c.httpClient, httpReq, c.logger, nil, "GetFeedbackLabel") if err != nil { return err } if err := unm.Unmarshal(buf, resp); err != nil { return err } return nil }, opts...) if e != nil { return nil, e } return resp, nil } // UpdateFeedbackLabel update feedback label. func (c *restClient) UpdateFeedbackLabel(ctx context.Context, req *contactcenterinsightspb.UpdateFeedbackLabelRequest, opts ...gax.CallOption) (*contactcenterinsightspb.FeedbackLabel, error) { m := protojson.MarshalOptions{AllowPartial: true, UseEnumNumbers: true} body := req.GetFeedbackLabel() jsonReq, err := m.Marshal(body) if err != nil { return nil, err } baseUrl, err := url.Parse(c.endpoint) if err != nil { return nil, err } baseUrl.Path += fmt.Sprintf("/v1/%v", req.GetFeedbackLabel().GetName()) params := url.Values{} params.Add("$alt", "json;enum-encoding=int") if req.GetUpdateMask() != nil { field, err := protojson.Marshal(req.GetUpdateMask()) if err != nil { return nil, err } params.Add("updateMask", string(field[1:len(field)-1])) } baseUrl.RawQuery = params.Encode() // Build HTTP headers from client and context metadata. hds := []string{"x-goog-request-params", fmt.Sprintf("%s=%v", "feedback_label.name", url.QueryEscape(req.GetFeedbackLabel().GetName()))} hds = append(c.xGoogHeaders, hds...) hds = append(hds, "Content-Type", "application/json") headers := gax.BuildHeaders(ctx, hds...) opts = append((*c.CallOptions).UpdateFeedbackLabel[0:len((*c.CallOptions).UpdateFeedbackLabel):len((*c.CallOptions).UpdateFeedbackLabel)], opts...) unm := protojson.UnmarshalOptions{AllowPartial: true, DiscardUnknown: true} resp := &contactcenterinsightspb.FeedbackLabel{} e := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error { if settings.Path != "" { baseUrl.Path = settings.Path } httpReq, err := http.NewRequest("PATCH", baseUrl.String(), bytes.NewReader(jsonReq)) if err != nil { return err } httpReq = httpReq.WithContext(ctx) httpReq.Header = headers buf, err := executeHTTPRequest(ctx, c.httpClient, httpReq, c.logger, jsonReq, "UpdateFeedbackLabel") if err != nil { return err } if err := unm.Unmarshal(buf, resp); err != nil { return err } return nil }, opts...) if e != nil { return nil, e } return resp, nil } // DeleteFeedbackLabel delete feedback label. func (c *restClient) DeleteFeedbackLabel(ctx context.Context, req *contactcenterinsightspb.DeleteFeedbackLabelRequest, opts ...gax.CallOption) error { baseUrl, err := url.Parse(c.endpoint) if err != nil { return err } baseUrl.Path += fmt.Sprintf("/v1/%v", req.GetName()) params := url.Values{} params.Add("$alt", "json;enum-encoding=int") baseUrl.RawQuery = params.Encode() // Build HTTP headers from client and context metadata. hds := []string{"x-goog-request-params", fmt.Sprintf("%s=%v", "name", url.QueryEscape(req.GetName()))} hds = append(c.xGoogHeaders, hds...) hds = append(hds, "Content-Type", "application/json") headers := gax.BuildHeaders(ctx, hds...) return gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error { if settings.Path != "" { baseUrl.Path = settings.Path } httpReq, err := http.NewRequest("DELETE", baseUrl.String(), nil) if err != nil { return err } httpReq = httpReq.WithContext(ctx) httpReq.Header = headers _, err = executeHTTPRequest(ctx, c.httpClient, httpReq, c.logger, nil, "DeleteFeedbackLabel") return err }, opts...) } // ListAllFeedbackLabels list all feedback labels by project number. func (c *restClient) ListAllFeedbackLabels(ctx context.Context, req *contactcenterinsightspb.ListAllFeedbackLabelsRequest, opts ...gax.CallOption) *FeedbackLabelIterator { it := &FeedbackLabelIterator{} req = proto.Clone(req).(*contactcenterinsightspb.ListAllFeedbackLabelsRequest) unm := protojson.UnmarshalOptions{AllowPartial: true, DiscardUnknown: true} it.InternalFetch = func(pageSize int, pageToken string) ([]*contactcenterinsightspb.FeedbackLabel, string, error) { resp := &contactcenterinsightspb.ListAllFeedbackLabelsResponse{} if pageToken != "" { req.PageToken = pageToken } if pageSize > math.MaxInt32 { req.PageSize = math.MaxInt32 } else if pageSize != 0 { req.PageSize = int32(pageSize) } baseUrl, err := url.Parse(c.endpoint) if err != nil { return nil, "", err } baseUrl.Path += fmt.Sprintf("/v1/%v:listAllFeedbackLabels", req.GetParent()) params := url.Values{} params.Add("$alt", "json;enum-encoding=int") if req.GetFilter() != "" { params.Add("filter", fmt.Sprintf("%v", req.GetFilter())) } if req.GetPageSize() != 0 { params.Add("pageSize", fmt.Sprintf("%v", req.GetPageSize())) } if req.GetPageToken() != "" { params.Add("pageToken", fmt.Sprintf("%v", req.GetPageToken())) } baseUrl.RawQuery = params.Encode() // Build HTTP headers from client and context metadata. hds := append(c.xGoogHeaders, "Content-Type", "application/json") headers := gax.BuildHeaders(ctx, hds...) e := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error { if settings.Path != "" { baseUrl.Path = settings.Path } httpReq, err := http.NewRequest("GET", baseUrl.String(), nil) if err != nil { return err } httpReq.Header = headers buf, err := executeHTTPRequest(ctx, c.httpClient, httpReq, c.logger, nil, "ListAllFeedbackLabels") if err != nil { return err } if err := unm.Unmarshal(buf, resp); err != nil { return err } return nil }, opts...) if e != nil { return nil, "", e } it.Response = resp return resp.GetFeedbackLabels(), resp.GetNextPageToken(), 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.GetPageSize()) it.pageInfo.Token = req.GetPageToken() return it } // BulkUploadFeedbackLabels upload feedback labels in bulk. func (c *restClient) BulkUploadFeedbackLabels(ctx context.Context, req *contactcenterinsightspb.BulkUploadFeedbackLabelsRequest, opts ...gax.CallOption) (*BulkUploadFeedbackLabelsOperation, error) { m := protojson.MarshalOptions{AllowPartial: true, UseEnumNumbers: true} jsonReq, err := m.Marshal(req) if err != nil { return nil, err } baseUrl, err := url.Parse(c.endpoint) if err != nil { return nil, err } baseUrl.Path += fmt.Sprintf("/v1/%v:bulkUploadFeedbackLabels", req.GetParent()) params := url.Values{} params.Add("$alt", "json;enum-encoding=int") baseUrl.RawQuery = params.Encode() // Build HTTP headers from client and context metadata. hds := []string{"x-goog-request-params", fmt.Sprintf("%s=%v", "parent", url.QueryEscape(req.GetParent()))} hds = append(c.xGoogHeaders, hds...) hds = append(hds, "Content-Type", "application/json") headers := gax.BuildHeaders(ctx, hds...) unm := protojson.UnmarshalOptions{AllowPartial: true, DiscardUnknown: true} resp := &longrunningpb.Operation{} e := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error { if settings.Path != "" { baseUrl.Path = settings.Path } httpReq, err := http.NewRequest("POST", baseUrl.String(), bytes.NewReader(jsonReq)) if err != nil { return err } httpReq = httpReq.WithContext(ctx) httpReq.Header = headers buf, err := executeHTTPRequest(ctx, c.httpClient, httpReq, c.logger, jsonReq, "BulkUploadFeedbackLabels") if err != nil { return err } if err := unm.Unmarshal(buf, resp); err != nil { return err } return nil }, opts...) if e != nil { return nil, e } override := fmt.Sprintf("/v1/%s", resp.GetName()) return &BulkUploadFeedbackLabelsOperation{ lro: longrunning.InternalNewOperation(*c.LROClient, resp), pollPath: override, }, nil } // BulkDownloadFeedbackLabels download feedback labels in bulk. func (c *restClient) BulkDownloadFeedbackLabels(ctx context.Context, req *contactcenterinsightspb.BulkDownloadFeedbackLabelsRequest, opts ...gax.CallOption) (*BulkDownloadFeedbackLabelsOperation, error) { m := protojson.MarshalOptions{AllowPartial: true, UseEnumNumbers: true} jsonReq, err := m.Marshal(req) if err != nil { return nil, err } baseUrl, err := url.Parse(c.endpoint) if err != nil { return nil, err } baseUrl.Path += fmt.Sprintf("/v1/%v:bulkDownloadFeedbackLabels", req.GetParent()) params := url.Values{} params.Add("$alt", "json;enum-encoding=int") baseUrl.RawQuery = params.Encode() // Build HTTP headers from client and context metadata. hds := []string{"x-goog-request-params", fmt.Sprintf("%s=%v", "parent", url.QueryEscape(req.GetParent()))} hds = append(c.xGoogHeaders, hds...) hds = append(hds, "Content-Type", "application/json") headers := gax.BuildHeaders(ctx, hds...) unm := protojson.UnmarshalOptions{AllowPartial: true, DiscardUnknown: true} resp := &longrunningpb.Operation{} e := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error { if settings.Path != "" { baseUrl.Path = settings.Path } httpReq, err := http.NewRequest("POST", baseUrl.String(), bytes.NewReader(jsonReq)) if err != nil { return err } httpReq = httpReq.WithContext(ctx) httpReq.Header = headers buf, err := executeHTTPRequest(ctx, c.httpClient, httpReq, c.logger, jsonReq, "BulkDownloadFeedbackLabels") if err != nil { return err } if err := unm.Unmarshal(buf, resp); err != nil { return err } return nil }, opts...) if e != nil { return nil, e } override := fmt.Sprintf("/v1/%s", resp.GetName()) return &BulkDownloadFeedbackLabelsOperation{ lro: longrunning.InternalNewOperation(*c.LROClient, resp), pollPath: override, }, nil } // CancelOperation is a utility method from google.longrunning.Operations. func (c *restClient) CancelOperation(ctx context.Context, req *longrunningpb.CancelOperationRequest, opts ...gax.CallOption) error { baseUrl, err := url.Parse(c.endpoint) if err != nil { return err } baseUrl.Path += fmt.Sprintf("/v1/%v:cancel", req.GetName()) params := url.Values{} params.Add("$alt", "json;enum-encoding=int") baseUrl.RawQuery = params.Encode() // Build HTTP headers from client and context metadata. hds := []string{"x-goog-request-params", fmt.Sprintf("%s=%v", "name", url.QueryEscape(req.GetName()))} hds = append(c.xGoogHeaders, hds...) hds = append(hds, "Content-Type", "application/json") headers := gax.BuildHeaders(ctx, hds...) return gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error { if settings.Path != "" { baseUrl.Path = settings.Path } httpReq, err := http.NewRequest("POST", baseUrl.String(), nil) if err != nil { return err } httpReq = httpReq.WithContext(ctx) httpReq.Header = headers _, err = executeHTTPRequest(ctx, c.httpClient, httpReq, c.logger, nil, "CancelOperation") return err }, opts...) } // GetOperation is a utility method from google.longrunning.Operations. func (c *restClient) GetOperation(ctx context.Context, req *longrunningpb.GetOperationRequest, opts ...gax.CallOption) (*longrunningpb.Operation, error) { baseUrl, err := url.Parse(c.endpoint) if err != nil { return nil, err } baseUrl.Path += fmt.Sprintf("/v1/%v", req.GetName()) params := url.Values{} params.Add("$alt", "json;enum-encoding=int") baseUrl.RawQuery = params.Encode() // Build HTTP headers from client and context metadata. hds := []string{"x-goog-request-params", fmt.Sprintf("%s=%v", "name", url.QueryEscape(req.GetName()))} hds = append(c.xGoogHeaders, hds...) hds = append(hds, "Content-Type", "application/json") headers := gax.BuildHeaders(ctx, hds...) opts = append((*c.CallOptions).GetOperation[0:len((*c.CallOptions).GetOperation):len((*c.CallOptions).GetOperation)], opts...) unm := protojson.UnmarshalOptions{AllowPartial: true, DiscardUnknown: true} resp := &longrunningpb.Operation{} e := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error { if settings.Path != "" { baseUrl.Path = settings.Path } httpReq, err := http.NewRequest("GET", baseUrl.String(), nil) if err != nil { return err } httpReq = httpReq.WithContext(ctx) httpReq.Header = headers buf, err := executeHTTPRequest(ctx, c.httpClient, httpReq, c.logger, nil, "GetOperation") if err != nil { return err } if err := unm.Unmarshal(buf, resp); err != nil { return err } return nil }, opts...) if e != nil { return nil, e } return resp, nil } // ListOperations is a utility method from google.longrunning.Operations. func (c *restClient) ListOperations(ctx context.Context, req *longrunningpb.ListOperationsRequest, opts ...gax.CallOption) *OperationIterator { it := &OperationIterator{} req = proto.Clone(req).(*longrunningpb.ListOperationsRequest) unm := protojson.UnmarshalOptions{AllowPartial: true, DiscardUnknown: true} it.InternalFetch = func(pageSize int, pageToken string) ([]*longrunningpb.Operation, string, error) { resp := &longrunningpb.ListOperationsResponse{} if pageToken != "" { req.PageToken = pageToken } if pageSize > math.MaxInt32 { req.PageSize = math.MaxInt32 } else if pageSize != 0 { req.PageSize = int32(pageSize) } baseUrl, err := url.Parse(c.endpoint) if err != nil { return nil, "", err } baseUrl.Path += fmt.Sprintf("/v1/%v/operations", req.GetName()) params := url.Values{} params.Add("$alt", "json;enum-encoding=int") if req.GetFilter() != "" { params.Add("filter", fmt.Sprintf("%v", req.GetFilter())) } if req.GetPageSize() != 0 { params.Add("pageSize", fmt.Sprintf("%v", req.GetPageSize())) } if req.GetPageToken() != "" { params.Add("pageToken", fmt.Sprintf("%v", req.GetPageToken())) } baseUrl.RawQuery = params.Encode() // Build HTTP headers from client and context metadata. hds := append(c.xGoogHeaders, "Content-Type", "application/json") headers := gax.BuildHeaders(ctx, hds...) e := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error { if settings.Path != "" { baseUrl.Path = settings.Path } httpReq, err := http.NewRequest("GET", baseUrl.String(), nil) if err != nil { return err } httpReq.Header = headers buf, err := executeHTTPRequest(ctx, c.httpClient, httpReq, c.logger, nil, "ListOperations") if err != nil { return err } if err := unm.Unmarshal(buf, resp); err != nil { return err } return nil }, opts...) if e != nil { return nil, "", e } it.Response = resp return resp.GetOperations(), resp.GetNextPageToken(), 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.GetPageSize()) it.pageInfo.Token = req.GetPageToken() return it } // BulkAnalyzeConversationsOperation returns a new BulkAnalyzeConversationsOperation from a given name. // The name must be that of a previously created BulkAnalyzeConversationsOperation, possibly from a different process. func (c *gRPCClient) BulkAnalyzeConversationsOperation(name string) *BulkAnalyzeConversationsOperation { return &BulkAnalyzeConversationsOperation{ lro: longrunning.InternalNewOperation(*c.LROClient, &longrunningpb.Operation{Name: name}), } } // BulkAnalyzeConversationsOperation returns a new BulkAnalyzeConversationsOperation from a given name. // The name must be that of a previously created BulkAnalyzeConversationsOperation, possibly from a different process. func (c *restClient) BulkAnalyzeConversationsOperation(name string) *BulkAnalyzeConversationsOperation { override := fmt.Sprintf("/v1/%s", name) return &BulkAnalyzeConversationsOperation{ lro: longrunning.InternalNewOperation(*c.LROClient, &longrunningpb.Operation{Name: name}), pollPath: override, } } // BulkDeleteConversationsOperation returns a new BulkDeleteConversationsOperation from a given name. // The name must be that of a previously created BulkDeleteConversationsOperation, possibly from a different process. func (c *gRPCClient) BulkDeleteConversationsOperation(name string) *BulkDeleteConversationsOperation { return &BulkDeleteConversationsOperation{ lro: longrunning.InternalNewOperation(*c.LROClient, &longrunningpb.Operation{Name: name}), } } // BulkDeleteConversationsOperation returns a new BulkDeleteConversationsOperation from a given name. // The name must be that of a previously created BulkDeleteConversationsOperation, possibly from a different process. func (c *restClient) BulkDeleteConversationsOperation(name string) *BulkDeleteConversationsOperation { override := fmt.Sprintf("/v1/%s", name) return &BulkDeleteConversationsOperation{ lro: longrunning.InternalNewOperation(*c.LROClient, &longrunningpb.Operation{Name: name}), pollPath: override, } } // BulkDownloadFeedbackLabelsOperation returns a new BulkDownloadFeedbackLabelsOperation from a given name. // The name must be that of a previously created BulkDownloadFeedbackLabelsOperation, possibly from a different process. func (c *gRPCClient) BulkDownloadFeedbackLabelsOperation(name string) *BulkDownloadFeedbackLabelsOperation { return &BulkDownloadFeedbackLabelsOperation{ lro: longrunning.InternalNewOperation(*c.LROClient, &longrunningpb.Operation{Name: name}), } } // BulkDownloadFeedbackLabelsOperation returns a new BulkDownloadFeedbackLabelsOperation from a given name. // The name must be that of a previously created BulkDownloadFeedbackLabelsOperation, possibly from a different process. func (c *restClient) BulkDownloadFeedbackLabelsOperation(name string) *BulkDownloadFeedbackLabelsOperation { override := fmt.Sprintf("/v1/%s", name) return &BulkDownloadFeedbackLabelsOperation{ lro: longrunning.InternalNewOperation(*c.LROClient, &longrunningpb.Operation{Name: name}), pollPath: override, } } // BulkUploadFeedbackLabelsOperation returns a new BulkUploadFeedbackLabelsOperation from a given name. // The name must be that of a previously created BulkUploadFeedbackLabelsOperation, possibly from a different process. func (c *gRPCClient) BulkUploadFeedbackLabelsOperation(name string) *BulkUploadFeedbackLabelsOperation { return &BulkUploadFeedbackLabelsOperation{ lro: longrunning.InternalNewOperation(*c.LROClient, &longrunningpb.Operation{Name: name}), } } // BulkUploadFeedbackLabelsOperation returns a new BulkUploadFeedbackLabelsOperation from a given name. // The name must be that of a previously created BulkUploadFeedbackLabelsOperation, possibly from a different process. func (c *restClient) BulkUploadFeedbackLabelsOperation(name string) *BulkUploadFeedbackLabelsOperation { override := fmt.Sprintf("/v1/%s", name) return &BulkUploadFeedbackLabelsOperation{ lro: longrunning.InternalNewOperation(*c.LROClient, &longrunningpb.Operation{Name: name}), pollPath: override, } } // CreateAnalysisOperation returns a new CreateAnalysisOperation from a given name. // The name must be that of a previously created CreateAnalysisOperation, possibly from a different process. func (c *gRPCClient) CreateAnalysisOperation(name string) *CreateAnalysisOperation { return &CreateAnalysisOperation{ lro: longrunning.InternalNewOperation(*c.LROClient, &longrunningpb.Operation{Name: name}), } } // CreateAnalysisOperation returns a new CreateAnalysisOperation from a given name. // The name must be that of a previously created CreateAnalysisOperation, possibly from a different process. func (c *restClient) CreateAnalysisOperation(name string) *CreateAnalysisOperation { override := fmt.Sprintf("/v1/%s", name) return &CreateAnalysisOperation{ lro: longrunning.InternalNewOperation(*c.LROClient, &longrunningpb.Operation{Name: name}), pollPath: override, } } // CreateIssueModelOperation returns a new CreateIssueModelOperation from a given name. // The name must be that of a previously created CreateIssueModelOperation, possibly from a different process. func (c *gRPCClient) CreateIssueModelOperation(name string) *CreateIssueModelOperation { return &CreateIssueModelOperation{ lro: longrunning.InternalNewOperation(*c.LROClient, &longrunningpb.Operation{Name: name}), } } // CreateIssueModelOperation returns a new CreateIssueModelOperation from a given name. // The name must be that of a previously created CreateIssueModelOperation, possibly from a different process. func (c *restClient) CreateIssueModelOperation(name string) *CreateIssueModelOperation { override := fmt.Sprintf("/v1/%s", name) return &CreateIssueModelOperation{ lro: longrunning.InternalNewOperation(*c.LROClient, &longrunningpb.Operation{Name: name}), pollPath: override, } } // DeleteIssueModelOperation returns a new DeleteIssueModelOperation from a given name. // The name must be that of a previously created DeleteIssueModelOperation, possibly from a different process. func (c *gRPCClient) DeleteIssueModelOperation(name string) *DeleteIssueModelOperation { return &DeleteIssueModelOperation{ lro: longrunning.InternalNewOperation(*c.LROClient, &longrunningpb.Operation{Name: name}), } } // DeleteIssueModelOperation returns a new DeleteIssueModelOperation from a given name. // The name must be that of a previously created DeleteIssueModelOperation, possibly from a different process. func (c *restClient) DeleteIssueModelOperation(name string) *DeleteIssueModelOperation { override := fmt.Sprintf("/v1/%s", name) return &DeleteIssueModelOperation{ lro: longrunning.InternalNewOperation(*c.LROClient, &longrunningpb.Operation{Name: name}), pollPath: override, } } // DeployIssueModelOperation returns a new DeployIssueModelOperation from a given name. // The name must be that of a previously created DeployIssueModelOperation, possibly from a different process. func (c *gRPCClient) DeployIssueModelOperation(name string) *DeployIssueModelOperation { return &DeployIssueModelOperation{ lro: longrunning.InternalNewOperation(*c.LROClient, &longrunningpb.Operation{Name: name}), } } // DeployIssueModelOperation returns a new DeployIssueModelOperation from a given name. // The name must be that of a previously created DeployIssueModelOperation, possibly from a different process. func (c *restClient) DeployIssueModelOperation(name string) *DeployIssueModelOperation { override := fmt.Sprintf("/v1/%s", name) return &DeployIssueModelOperation{ lro: longrunning.InternalNewOperation(*c.LROClient, &longrunningpb.Operation{Name: name}), pollPath: override, } } // ExportInsightsDataOperation returns a new ExportInsightsDataOperation from a given name. // The name must be that of a previously created ExportInsightsDataOperation, possibly from a different process. func (c *gRPCClient) ExportInsightsDataOperation(name string) *ExportInsightsDataOperation { return &ExportInsightsDataOperation{ lro: longrunning.InternalNewOperation(*c.LROClient, &longrunningpb.Operation{Name: name}), } } // ExportInsightsDataOperation returns a new ExportInsightsDataOperation from a given name. // The name must be that of a previously created ExportInsightsDataOperation, possibly from a different process. func (c *restClient) ExportInsightsDataOperation(name string) *ExportInsightsDataOperation { override := fmt.Sprintf("/v1/%s", name) return &ExportInsightsDataOperation{ lro: longrunning.InternalNewOperation(*c.LROClient, &longrunningpb.Operation{Name: name}), pollPath: override, } } // ExportIssueModelOperation returns a new ExportIssueModelOperation from a given name. // The name must be that of a previously created ExportIssueModelOperation, possibly from a different process. func (c *gRPCClient) ExportIssueModelOperation(name string) *ExportIssueModelOperation { return &ExportIssueModelOperation{ lro: longrunning.InternalNewOperation(*c.LROClient, &longrunningpb.Operation{Name: name}), } } // ExportIssueModelOperation returns a new ExportIssueModelOperation from a given name. // The name must be that of a previously created ExportIssueModelOperation, possibly from a different process. func (c *restClient) ExportIssueModelOperation(name string) *ExportIssueModelOperation { override := fmt.Sprintf("/v1/%s", name) return &ExportIssueModelOperation{ lro: longrunning.InternalNewOperation(*c.LROClient, &longrunningpb.Operation{Name: name}), pollPath: override, } } // ImportIssueModelOperation returns a new ImportIssueModelOperation from a given name. // The name must be that of a previously created ImportIssueModelOperation, possibly from a different process. func (c *gRPCClient) ImportIssueModelOperation(name string) *ImportIssueModelOperation { return &ImportIssueModelOperation{ lro: longrunning.InternalNewOperation(*c.LROClient, &longrunningpb.Operation{Name: name}), } } // ImportIssueModelOperation returns a new ImportIssueModelOperation from a given name. // The name must be that of a previously created ImportIssueModelOperation, possibly from a different process. func (c *restClient) ImportIssueModelOperation(name string) *ImportIssueModelOperation { override := fmt.Sprintf("/v1/%s", name) return &ImportIssueModelOperation{ lro: longrunning.InternalNewOperation(*c.LROClient, &longrunningpb.Operation{Name: name}), pollPath: override, } } // IngestConversationsOperation returns a new IngestConversationsOperation from a given name. // The name must be that of a previously created IngestConversationsOperation, possibly from a different process. func (c *gRPCClient) IngestConversationsOperation(name string) *IngestConversationsOperation { return &IngestConversationsOperation{ lro: longrunning.InternalNewOperation(*c.LROClient, &longrunningpb.Operation{Name: name}), } } // IngestConversationsOperation returns a new IngestConversationsOperation from a given name. // The name must be that of a previously created IngestConversationsOperation, possibly from a different process. func (c *restClient) IngestConversationsOperation(name string) *IngestConversationsOperation { override := fmt.Sprintf("/v1/%s", name) return &IngestConversationsOperation{ lro: longrunning.InternalNewOperation(*c.LROClient, &longrunningpb.Operation{Name: name}), pollPath: override, } } // InitializeEncryptionSpecOperation returns a new InitializeEncryptionSpecOperation from a given name. // The name must be that of a previously created InitializeEncryptionSpecOperation, possibly from a different process. func (c *gRPCClient) InitializeEncryptionSpecOperation(name string) *InitializeEncryptionSpecOperation { return &InitializeEncryptionSpecOperation{ lro: longrunning.InternalNewOperation(*c.LROClient, &longrunningpb.Operation{Name: name}), } } // InitializeEncryptionSpecOperation returns a new InitializeEncryptionSpecOperation from a given name. // The name must be that of a previously created InitializeEncryptionSpecOperation, possibly from a different process. func (c *restClient) InitializeEncryptionSpecOperation(name string) *InitializeEncryptionSpecOperation { override := fmt.Sprintf("/v1/%s", name) return &InitializeEncryptionSpecOperation{ lro: longrunning.InternalNewOperation(*c.LROClient, &longrunningpb.Operation{Name: name}), pollPath: override, } } // QueryMetricsOperation returns a new QueryMetricsOperation from a given name. // The name must be that of a previously created QueryMetricsOperation, possibly from a different process. func (c *gRPCClient) QueryMetricsOperation(name string) *QueryMetricsOperation { return &QueryMetricsOperation{ lro: longrunning.InternalNewOperation(*c.LROClient, &longrunningpb.Operation{Name: name}), } } // QueryMetricsOperation returns a new QueryMetricsOperation from a given name. // The name must be that of a previously created QueryMetricsOperation, possibly from a different process. func (c *restClient) QueryMetricsOperation(name string) *QueryMetricsOperation { override := fmt.Sprintf("/v1/%s", name) return &QueryMetricsOperation{ lro: longrunning.InternalNewOperation(*c.LROClient, &longrunningpb.Operation{Name: name}), pollPath: override, } } // TuneQaScorecardRevisionOperation returns a new TuneQaScorecardRevisionOperation from a given name. // The name must be that of a previously created TuneQaScorecardRevisionOperation, possibly from a different process. func (c *gRPCClient) TuneQaScorecardRevisionOperation(name string) *TuneQaScorecardRevisionOperation { return &TuneQaScorecardRevisionOperation{ lro: longrunning.InternalNewOperation(*c.LROClient, &longrunningpb.Operation{Name: name}), } } // TuneQaScorecardRevisionOperation returns a new TuneQaScorecardRevisionOperation from a given name. // The name must be that of a previously created TuneQaScorecardRevisionOperation, possibly from a different process. func (c *restClient) TuneQaScorecardRevisionOperation(name string) *TuneQaScorecardRevisionOperation { override := fmt.Sprintf("/v1/%s", name) return &TuneQaScorecardRevisionOperation{ lro: longrunning.InternalNewOperation(*c.LROClient, &longrunningpb.Operation{Name: name}), pollPath: override, } } // UndeployIssueModelOperation returns a new UndeployIssueModelOperation from a given name. // The name must be that of a previously created UndeployIssueModelOperation, possibly from a different process. func (c *gRPCClient) UndeployIssueModelOperation(name string) *UndeployIssueModelOperation { return &UndeployIssueModelOperation{ lro: longrunning.InternalNewOperation(*c.LROClient, &longrunningpb.Operation{Name: name}), } } // UndeployIssueModelOperation returns a new UndeployIssueModelOperation from a given name. // The name must be that of a previously created UndeployIssueModelOperation, possibly from a different process. func (c *restClient) UndeployIssueModelOperation(name string) *UndeployIssueModelOperation { override := fmt.Sprintf("/v1/%s", name) return &UndeployIssueModelOperation{ lro: longrunning.InternalNewOperation(*c.LROClient, &longrunningpb.Operation{Name: name}), pollPath: override, } } // UploadConversationOperation returns a new UploadConversationOperation from a given name. // The name must be that of a previously created UploadConversationOperation, possibly from a different process. func (c *gRPCClient) UploadConversationOperation(name string) *UploadConversationOperation { return &UploadConversationOperation{ lro: longrunning.InternalNewOperation(*c.LROClient, &longrunningpb.Operation{Name: name}), } } // UploadConversationOperation returns a new UploadConversationOperation from a given name. // The name must be that of a previously created UploadConversationOperation, possibly from a different process. func (c *restClient) UploadConversationOperation(name string) *UploadConversationOperation { override := fmt.Sprintf("/v1/%s", name) return &UploadConversationOperation{ lro: longrunning.InternalNewOperation(*c.LROClient, &longrunningpb.Operation{Name: name}), pollPath: override, } }