| // Copyright 2024 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 admin |
| |
| import ( |
| "bytes" |
| "context" |
| "fmt" |
| "io" |
| "math" |
| "net/http" |
| "net/url" |
| "time" |
| |
| adminpb "cloud.google.com/go/analytics/admin/apiv1alpha/adminpb" |
| gax "github.com/googleapis/gax-go/v2" |
| "google.golang.org/api/googleapi" |
| "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 newAnalyticsAdminClientHook clientHook |
| |
| // AnalyticsAdminCallOptions contains the retry settings for each method of AnalyticsAdminClient. |
| type AnalyticsAdminCallOptions struct { |
| GetAccount []gax.CallOption |
| ListAccounts []gax.CallOption |
| DeleteAccount []gax.CallOption |
| UpdateAccount []gax.CallOption |
| ProvisionAccountTicket []gax.CallOption |
| ListAccountSummaries []gax.CallOption |
| GetProperty []gax.CallOption |
| ListProperties []gax.CallOption |
| CreateProperty []gax.CallOption |
| DeleteProperty []gax.CallOption |
| UpdateProperty []gax.CallOption |
| CreateFirebaseLink []gax.CallOption |
| DeleteFirebaseLink []gax.CallOption |
| ListFirebaseLinks []gax.CallOption |
| GetGlobalSiteTag []gax.CallOption |
| CreateGoogleAdsLink []gax.CallOption |
| UpdateGoogleAdsLink []gax.CallOption |
| DeleteGoogleAdsLink []gax.CallOption |
| ListGoogleAdsLinks []gax.CallOption |
| GetDataSharingSettings []gax.CallOption |
| GetMeasurementProtocolSecret []gax.CallOption |
| ListMeasurementProtocolSecrets []gax.CallOption |
| CreateMeasurementProtocolSecret []gax.CallOption |
| DeleteMeasurementProtocolSecret []gax.CallOption |
| UpdateMeasurementProtocolSecret []gax.CallOption |
| AcknowledgeUserDataCollection []gax.CallOption |
| GetSKAdNetworkConversionValueSchema []gax.CallOption |
| CreateSKAdNetworkConversionValueSchema []gax.CallOption |
| DeleteSKAdNetworkConversionValueSchema []gax.CallOption |
| UpdateSKAdNetworkConversionValueSchema []gax.CallOption |
| ListSKAdNetworkConversionValueSchemas []gax.CallOption |
| SearchChangeHistoryEvents []gax.CallOption |
| GetGoogleSignalsSettings []gax.CallOption |
| UpdateGoogleSignalsSettings []gax.CallOption |
| CreateConversionEvent []gax.CallOption |
| UpdateConversionEvent []gax.CallOption |
| GetConversionEvent []gax.CallOption |
| DeleteConversionEvent []gax.CallOption |
| ListConversionEvents []gax.CallOption |
| GetDisplayVideo360AdvertiserLink []gax.CallOption |
| ListDisplayVideo360AdvertiserLinks []gax.CallOption |
| CreateDisplayVideo360AdvertiserLink []gax.CallOption |
| DeleteDisplayVideo360AdvertiserLink []gax.CallOption |
| UpdateDisplayVideo360AdvertiserLink []gax.CallOption |
| GetDisplayVideo360AdvertiserLinkProposal []gax.CallOption |
| ListDisplayVideo360AdvertiserLinkProposals []gax.CallOption |
| CreateDisplayVideo360AdvertiserLinkProposal []gax.CallOption |
| DeleteDisplayVideo360AdvertiserLinkProposal []gax.CallOption |
| ApproveDisplayVideo360AdvertiserLinkProposal []gax.CallOption |
| CancelDisplayVideo360AdvertiserLinkProposal []gax.CallOption |
| CreateCustomDimension []gax.CallOption |
| UpdateCustomDimension []gax.CallOption |
| ListCustomDimensions []gax.CallOption |
| ArchiveCustomDimension []gax.CallOption |
| GetCustomDimension []gax.CallOption |
| CreateCustomMetric []gax.CallOption |
| UpdateCustomMetric []gax.CallOption |
| ListCustomMetrics []gax.CallOption |
| ArchiveCustomMetric []gax.CallOption |
| GetCustomMetric []gax.CallOption |
| GetDataRetentionSettings []gax.CallOption |
| UpdateDataRetentionSettings []gax.CallOption |
| CreateDataStream []gax.CallOption |
| DeleteDataStream []gax.CallOption |
| UpdateDataStream []gax.CallOption |
| ListDataStreams []gax.CallOption |
| GetDataStream []gax.CallOption |
| GetAudience []gax.CallOption |
| ListAudiences []gax.CallOption |
| CreateAudience []gax.CallOption |
| UpdateAudience []gax.CallOption |
| ArchiveAudience []gax.CallOption |
| GetSearchAds360Link []gax.CallOption |
| ListSearchAds360Links []gax.CallOption |
| CreateSearchAds360Link []gax.CallOption |
| DeleteSearchAds360Link []gax.CallOption |
| UpdateSearchAds360Link []gax.CallOption |
| GetAttributionSettings []gax.CallOption |
| UpdateAttributionSettings []gax.CallOption |
| RunAccessReport []gax.CallOption |
| CreateAccessBinding []gax.CallOption |
| GetAccessBinding []gax.CallOption |
| UpdateAccessBinding []gax.CallOption |
| DeleteAccessBinding []gax.CallOption |
| ListAccessBindings []gax.CallOption |
| BatchCreateAccessBindings []gax.CallOption |
| BatchGetAccessBindings []gax.CallOption |
| BatchUpdateAccessBindings []gax.CallOption |
| BatchDeleteAccessBindings []gax.CallOption |
| GetExpandedDataSet []gax.CallOption |
| ListExpandedDataSets []gax.CallOption |
| CreateExpandedDataSet []gax.CallOption |
| UpdateExpandedDataSet []gax.CallOption |
| DeleteExpandedDataSet []gax.CallOption |
| GetChannelGroup []gax.CallOption |
| ListChannelGroups []gax.CallOption |
| CreateChannelGroup []gax.CallOption |
| UpdateChannelGroup []gax.CallOption |
| DeleteChannelGroup []gax.CallOption |
| SetAutomatedGa4ConfigurationOptOut []gax.CallOption |
| FetchAutomatedGa4ConfigurationOptOut []gax.CallOption |
| GetBigQueryLink []gax.CallOption |
| ListBigQueryLinks []gax.CallOption |
| GetEnhancedMeasurementSettings []gax.CallOption |
| UpdateEnhancedMeasurementSettings []gax.CallOption |
| CreateConnectedSiteTag []gax.CallOption |
| DeleteConnectedSiteTag []gax.CallOption |
| ListConnectedSiteTags []gax.CallOption |
| FetchConnectedGa4Property []gax.CallOption |
| GetAdSenseLink []gax.CallOption |
| CreateAdSenseLink []gax.CallOption |
| DeleteAdSenseLink []gax.CallOption |
| ListAdSenseLinks []gax.CallOption |
| GetEventCreateRule []gax.CallOption |
| ListEventCreateRules []gax.CallOption |
| CreateEventCreateRule []gax.CallOption |
| UpdateEventCreateRule []gax.CallOption |
| DeleteEventCreateRule []gax.CallOption |
| UpdateDataRedactionSettings []gax.CallOption |
| GetDataRedactionSettings []gax.CallOption |
| GetCalculatedMetric []gax.CallOption |
| CreateCalculatedMetric []gax.CallOption |
| ListCalculatedMetrics []gax.CallOption |
| UpdateCalculatedMetric []gax.CallOption |
| DeleteCalculatedMetric []gax.CallOption |
| CreateRollupProperty []gax.CallOption |
| GetRollupPropertySourceLink []gax.CallOption |
| ListRollupPropertySourceLinks []gax.CallOption |
| CreateRollupPropertySourceLink []gax.CallOption |
| DeleteRollupPropertySourceLink []gax.CallOption |
| CreateSubproperty []gax.CallOption |
| CreateSubpropertyEventFilter []gax.CallOption |
| GetSubpropertyEventFilter []gax.CallOption |
| ListSubpropertyEventFilters []gax.CallOption |
| UpdateSubpropertyEventFilter []gax.CallOption |
| DeleteSubpropertyEventFilter []gax.CallOption |
| } |
| |
| func defaultAnalyticsAdminGRPCClientOptions() []option.ClientOption { |
| return []option.ClientOption{ |
| internaloption.WithDefaultEndpoint("analyticsadmin.googleapis.com:443"), |
| internaloption.WithDefaultEndpointTemplate("analyticsadmin.UNIVERSE_DOMAIN:443"), |
| internaloption.WithDefaultMTLSEndpoint("analyticsadmin.mtls.googleapis.com:443"), |
| internaloption.WithDefaultUniverseDomain("googleapis.com"), |
| internaloption.WithDefaultAudience("https://analyticsadmin.googleapis.com/"), |
| internaloption.WithDefaultScopes(DefaultAuthScopes()...), |
| internaloption.EnableJwtWithScope(), |
| option.WithGRPCDialOption(grpc.WithDefaultCallOptions( |
| grpc.MaxCallRecvMsgSize(math.MaxInt32))), |
| } |
| } |
| |
| func defaultAnalyticsAdminCallOptions() *AnalyticsAdminCallOptions { |
| return &AnalyticsAdminCallOptions{ |
| GetAccount: []gax.CallOption{ |
| gax.WithTimeout(60000 * time.Millisecond), |
| }, |
| ListAccounts: []gax.CallOption{ |
| gax.WithTimeout(60000 * time.Millisecond), |
| }, |
| DeleteAccount: []gax.CallOption{ |
| gax.WithTimeout(60000 * time.Millisecond), |
| }, |
| UpdateAccount: []gax.CallOption{ |
| gax.WithTimeout(60000 * time.Millisecond), |
| }, |
| ProvisionAccountTicket: []gax.CallOption{ |
| gax.WithTimeout(60000 * time.Millisecond), |
| }, |
| ListAccountSummaries: []gax.CallOption{ |
| gax.WithTimeout(60000 * time.Millisecond), |
| gax.WithRetry(func() gax.Retryer { |
| return gax.OnCodes([]codes.Code{ |
| codes.Unavailable, |
| codes.Unknown, |
| }, gax.Backoff{ |
| Initial: 1000 * time.Millisecond, |
| Max: 60000 * time.Millisecond, |
| Multiplier: 1.30, |
| }) |
| }), |
| }, |
| GetProperty: []gax.CallOption{ |
| gax.WithTimeout(60000 * time.Millisecond), |
| }, |
| ListProperties: []gax.CallOption{ |
| gax.WithTimeout(60000 * time.Millisecond), |
| }, |
| CreateProperty: []gax.CallOption{ |
| gax.WithTimeout(60000 * time.Millisecond), |
| }, |
| DeleteProperty: []gax.CallOption{ |
| gax.WithTimeout(60000 * time.Millisecond), |
| }, |
| UpdateProperty: []gax.CallOption{ |
| gax.WithTimeout(60000 * time.Millisecond), |
| }, |
| CreateFirebaseLink: []gax.CallOption{ |
| gax.WithTimeout(60000 * time.Millisecond), |
| }, |
| DeleteFirebaseLink: []gax.CallOption{ |
| gax.WithTimeout(60000 * time.Millisecond), |
| }, |
| ListFirebaseLinks: []gax.CallOption{ |
| gax.WithTimeout(60000 * time.Millisecond), |
| }, |
| GetGlobalSiteTag: []gax.CallOption{ |
| gax.WithTimeout(60000 * time.Millisecond), |
| }, |
| CreateGoogleAdsLink: []gax.CallOption{ |
| gax.WithTimeout(60000 * time.Millisecond), |
| }, |
| UpdateGoogleAdsLink: []gax.CallOption{ |
| gax.WithTimeout(60000 * time.Millisecond), |
| }, |
| DeleteGoogleAdsLink: []gax.CallOption{ |
| gax.WithTimeout(60000 * time.Millisecond), |
| }, |
| ListGoogleAdsLinks: []gax.CallOption{ |
| gax.WithTimeout(60000 * time.Millisecond), |
| }, |
| GetDataSharingSettings: []gax.CallOption{ |
| gax.WithTimeout(60000 * time.Millisecond), |
| gax.WithRetry(func() gax.Retryer { |
| return gax.OnCodes([]codes.Code{ |
| codes.Unavailable, |
| codes.Unknown, |
| }, gax.Backoff{ |
| Initial: 1000 * time.Millisecond, |
| Max: 60000 * time.Millisecond, |
| Multiplier: 1.30, |
| }) |
| }), |
| }, |
| GetMeasurementProtocolSecret: []gax.CallOption{ |
| gax.WithTimeout(60000 * time.Millisecond), |
| gax.WithRetry(func() gax.Retryer { |
| return gax.OnCodes([]codes.Code{ |
| codes.Unavailable, |
| codes.Unknown, |
| }, gax.Backoff{ |
| Initial: 1000 * time.Millisecond, |
| Max: 60000 * time.Millisecond, |
| Multiplier: 1.30, |
| }) |
| }), |
| }, |
| ListMeasurementProtocolSecrets: []gax.CallOption{ |
| gax.WithTimeout(60000 * time.Millisecond), |
| gax.WithRetry(func() gax.Retryer { |
| return gax.OnCodes([]codes.Code{ |
| codes.Unavailable, |
| codes.Unknown, |
| }, gax.Backoff{ |
| Initial: 1000 * time.Millisecond, |
| Max: 60000 * time.Millisecond, |
| Multiplier: 1.30, |
| }) |
| }), |
| }, |
| CreateMeasurementProtocolSecret: []gax.CallOption{ |
| gax.WithTimeout(60000 * time.Millisecond), |
| gax.WithRetry(func() gax.Retryer { |
| return gax.OnCodes([]codes.Code{ |
| codes.Unavailable, |
| codes.Unknown, |
| }, gax.Backoff{ |
| Initial: 1000 * time.Millisecond, |
| Max: 60000 * time.Millisecond, |
| Multiplier: 1.30, |
| }) |
| }), |
| }, |
| DeleteMeasurementProtocolSecret: []gax.CallOption{ |
| gax.WithTimeout(60000 * time.Millisecond), |
| gax.WithRetry(func() gax.Retryer { |
| return gax.OnCodes([]codes.Code{ |
| codes.Unavailable, |
| codes.Unknown, |
| }, gax.Backoff{ |
| Initial: 1000 * time.Millisecond, |
| Max: 60000 * time.Millisecond, |
| Multiplier: 1.30, |
| }) |
| }), |
| }, |
| UpdateMeasurementProtocolSecret: []gax.CallOption{ |
| gax.WithTimeout(60000 * time.Millisecond), |
| gax.WithRetry(func() gax.Retryer { |
| return gax.OnCodes([]codes.Code{ |
| codes.Unavailable, |
| codes.Unknown, |
| }, gax.Backoff{ |
| Initial: 1000 * time.Millisecond, |
| Max: 60000 * time.Millisecond, |
| Multiplier: 1.30, |
| }) |
| }), |
| }, |
| AcknowledgeUserDataCollection: []gax.CallOption{ |
| gax.WithTimeout(60000 * time.Millisecond), |
| gax.WithRetry(func() gax.Retryer { |
| return gax.OnCodes([]codes.Code{ |
| codes.Unavailable, |
| codes.Unknown, |
| }, gax.Backoff{ |
| Initial: 1000 * time.Millisecond, |
| Max: 60000 * time.Millisecond, |
| Multiplier: 1.30, |
| }) |
| }), |
| }, |
| GetSKAdNetworkConversionValueSchema: []gax.CallOption{ |
| gax.WithTimeout(60000 * time.Millisecond), |
| gax.WithRetry(func() gax.Retryer { |
| return gax.OnCodes([]codes.Code{ |
| codes.Unavailable, |
| codes.Unknown, |
| }, gax.Backoff{ |
| Initial: 1000 * time.Millisecond, |
| Max: 60000 * time.Millisecond, |
| Multiplier: 1.30, |
| }) |
| }), |
| }, |
| CreateSKAdNetworkConversionValueSchema: []gax.CallOption{ |
| gax.WithTimeout(60000 * time.Millisecond), |
| gax.WithRetry(func() gax.Retryer { |
| return gax.OnCodes([]codes.Code{ |
| codes.Unavailable, |
| codes.Unknown, |
| }, gax.Backoff{ |
| Initial: 1000 * time.Millisecond, |
| Max: 60000 * time.Millisecond, |
| Multiplier: 1.30, |
| }) |
| }), |
| }, |
| DeleteSKAdNetworkConversionValueSchema: []gax.CallOption{ |
| gax.WithTimeout(60000 * time.Millisecond), |
| gax.WithRetry(func() gax.Retryer { |
| return gax.OnCodes([]codes.Code{ |
| codes.Unavailable, |
| codes.Unknown, |
| }, gax.Backoff{ |
| Initial: 1000 * time.Millisecond, |
| Max: 60000 * time.Millisecond, |
| Multiplier: 1.30, |
| }) |
| }), |
| }, |
| UpdateSKAdNetworkConversionValueSchema: []gax.CallOption{ |
| gax.WithTimeout(60000 * time.Millisecond), |
| gax.WithRetry(func() gax.Retryer { |
| return gax.OnCodes([]codes.Code{ |
| codes.Unavailable, |
| codes.Unknown, |
| }, gax.Backoff{ |
| Initial: 1000 * time.Millisecond, |
| Max: 60000 * time.Millisecond, |
| Multiplier: 1.30, |
| }) |
| }), |
| }, |
| ListSKAdNetworkConversionValueSchemas: []gax.CallOption{ |
| gax.WithTimeout(60000 * time.Millisecond), |
| gax.WithRetry(func() gax.Retryer { |
| return gax.OnCodes([]codes.Code{ |
| codes.Unavailable, |
| codes.Unknown, |
| }, gax.Backoff{ |
| Initial: 1000 * time.Millisecond, |
| Max: 60000 * time.Millisecond, |
| Multiplier: 1.30, |
| }) |
| }), |
| }, |
| SearchChangeHistoryEvents: []gax.CallOption{ |
| gax.WithTimeout(60000 * time.Millisecond), |
| gax.WithRetry(func() gax.Retryer { |
| return gax.OnCodes([]codes.Code{ |
| codes.Unavailable, |
| codes.Unknown, |
| }, gax.Backoff{ |
| Initial: 1000 * time.Millisecond, |
| Max: 60000 * time.Millisecond, |
| Multiplier: 1.30, |
| }) |
| }), |
| }, |
| GetGoogleSignalsSettings: []gax.CallOption{ |
| gax.WithTimeout(60000 * time.Millisecond), |
| gax.WithRetry(func() gax.Retryer { |
| return gax.OnCodes([]codes.Code{ |
| codes.Unavailable, |
| codes.Unknown, |
| }, gax.Backoff{ |
| Initial: 1000 * time.Millisecond, |
| Max: 60000 * time.Millisecond, |
| Multiplier: 1.30, |
| }) |
| }), |
| }, |
| UpdateGoogleSignalsSettings: []gax.CallOption{ |
| gax.WithTimeout(60000 * time.Millisecond), |
| gax.WithRetry(func() gax.Retryer { |
| return gax.OnCodes([]codes.Code{ |
| codes.Unavailable, |
| codes.Unknown, |
| }, gax.Backoff{ |
| Initial: 1000 * time.Millisecond, |
| Max: 60000 * time.Millisecond, |
| Multiplier: 1.30, |
| }) |
| }), |
| }, |
| CreateConversionEvent: []gax.CallOption{ |
| gax.WithTimeout(60000 * time.Millisecond), |
| gax.WithRetry(func() gax.Retryer { |
| return gax.OnCodes([]codes.Code{ |
| codes.Unavailable, |
| codes.Unknown, |
| }, gax.Backoff{ |
| Initial: 1000 * time.Millisecond, |
| Max: 60000 * time.Millisecond, |
| Multiplier: 1.30, |
| }) |
| }), |
| }, |
| UpdateConversionEvent: []gax.CallOption{ |
| gax.WithTimeout(60000 * time.Millisecond), |
| gax.WithRetry(func() gax.Retryer { |
| return gax.OnCodes([]codes.Code{ |
| codes.Unavailable, |
| codes.Unknown, |
| }, gax.Backoff{ |
| Initial: 1000 * time.Millisecond, |
| Max: 60000 * time.Millisecond, |
| Multiplier: 1.30, |
| }) |
| }), |
| }, |
| GetConversionEvent: []gax.CallOption{ |
| gax.WithTimeout(60000 * time.Millisecond), |
| gax.WithRetry(func() gax.Retryer { |
| return gax.OnCodes([]codes.Code{ |
| codes.Unavailable, |
| codes.Unknown, |
| }, gax.Backoff{ |
| Initial: 1000 * time.Millisecond, |
| Max: 60000 * time.Millisecond, |
| Multiplier: 1.30, |
| }) |
| }), |
| }, |
| DeleteConversionEvent: []gax.CallOption{ |
| gax.WithTimeout(60000 * time.Millisecond), |
| gax.WithRetry(func() gax.Retryer { |
| return gax.OnCodes([]codes.Code{ |
| codes.Unavailable, |
| codes.Unknown, |
| }, gax.Backoff{ |
| Initial: 1000 * time.Millisecond, |
| Max: 60000 * time.Millisecond, |
| Multiplier: 1.30, |
| }) |
| }), |
| }, |
| ListConversionEvents: []gax.CallOption{ |
| gax.WithTimeout(60000 * time.Millisecond), |
| gax.WithRetry(func() gax.Retryer { |
| return gax.OnCodes([]codes.Code{ |
| codes.Unavailable, |
| codes.Unknown, |
| }, gax.Backoff{ |
| Initial: 1000 * time.Millisecond, |
| Max: 60000 * time.Millisecond, |
| Multiplier: 1.30, |
| }) |
| }), |
| }, |
| GetDisplayVideo360AdvertiserLink: []gax.CallOption{ |
| gax.WithTimeout(60000 * time.Millisecond), |
| gax.WithRetry(func() gax.Retryer { |
| return gax.OnCodes([]codes.Code{ |
| codes.Unavailable, |
| codes.Unknown, |
| }, gax.Backoff{ |
| Initial: 1000 * time.Millisecond, |
| Max: 60000 * time.Millisecond, |
| Multiplier: 1.30, |
| }) |
| }), |
| }, |
| ListDisplayVideo360AdvertiserLinks: []gax.CallOption{ |
| gax.WithTimeout(60000 * time.Millisecond), |
| gax.WithRetry(func() gax.Retryer { |
| return gax.OnCodes([]codes.Code{ |
| codes.Unavailable, |
| codes.Unknown, |
| }, gax.Backoff{ |
| Initial: 1000 * time.Millisecond, |
| Max: 60000 * time.Millisecond, |
| Multiplier: 1.30, |
| }) |
| }), |
| }, |
| CreateDisplayVideo360AdvertiserLink: []gax.CallOption{ |
| gax.WithTimeout(60000 * time.Millisecond), |
| gax.WithRetry(func() gax.Retryer { |
| return gax.OnCodes([]codes.Code{ |
| codes.Unavailable, |
| codes.Unknown, |
| }, gax.Backoff{ |
| Initial: 1000 * time.Millisecond, |
| Max: 60000 * time.Millisecond, |
| Multiplier: 1.30, |
| }) |
| }), |
| }, |
| DeleteDisplayVideo360AdvertiserLink: []gax.CallOption{ |
| gax.WithTimeout(60000 * time.Millisecond), |
| gax.WithRetry(func() gax.Retryer { |
| return gax.OnCodes([]codes.Code{ |
| codes.Unavailable, |
| codes.Unknown, |
| }, gax.Backoff{ |
| Initial: 1000 * time.Millisecond, |
| Max: 60000 * time.Millisecond, |
| Multiplier: 1.30, |
| }) |
| }), |
| }, |
| UpdateDisplayVideo360AdvertiserLink: []gax.CallOption{ |
| gax.WithTimeout(60000 * time.Millisecond), |
| gax.WithRetry(func() gax.Retryer { |
| return gax.OnCodes([]codes.Code{ |
| codes.Unavailable, |
| codes.Unknown, |
| }, gax.Backoff{ |
| Initial: 1000 * time.Millisecond, |
| Max: 60000 * time.Millisecond, |
| Multiplier: 1.30, |
| }) |
| }), |
| }, |
| GetDisplayVideo360AdvertiserLinkProposal: []gax.CallOption{ |
| gax.WithTimeout(60000 * time.Millisecond), |
| gax.WithRetry(func() gax.Retryer { |
| return gax.OnCodes([]codes.Code{ |
| codes.Unavailable, |
| codes.Unknown, |
| }, gax.Backoff{ |
| Initial: 1000 * time.Millisecond, |
| Max: 60000 * time.Millisecond, |
| Multiplier: 1.30, |
| }) |
| }), |
| }, |
| ListDisplayVideo360AdvertiserLinkProposals: []gax.CallOption{ |
| gax.WithTimeout(60000 * time.Millisecond), |
| gax.WithRetry(func() gax.Retryer { |
| return gax.OnCodes([]codes.Code{ |
| codes.Unavailable, |
| codes.Unknown, |
| }, gax.Backoff{ |
| Initial: 1000 * time.Millisecond, |
| Max: 60000 * time.Millisecond, |
| Multiplier: 1.30, |
| }) |
| }), |
| }, |
| CreateDisplayVideo360AdvertiserLinkProposal: []gax.CallOption{ |
| gax.WithTimeout(60000 * time.Millisecond), |
| gax.WithRetry(func() gax.Retryer { |
| return gax.OnCodes([]codes.Code{ |
| codes.Unavailable, |
| codes.Unknown, |
| }, gax.Backoff{ |
| Initial: 1000 * time.Millisecond, |
| Max: 60000 * time.Millisecond, |
| Multiplier: 1.30, |
| }) |
| }), |
| }, |
| DeleteDisplayVideo360AdvertiserLinkProposal: []gax.CallOption{ |
| gax.WithTimeout(60000 * time.Millisecond), |
| gax.WithRetry(func() gax.Retryer { |
| return gax.OnCodes([]codes.Code{ |
| codes.Unavailable, |
| codes.Unknown, |
| }, gax.Backoff{ |
| Initial: 1000 * time.Millisecond, |
| Max: 60000 * time.Millisecond, |
| Multiplier: 1.30, |
| }) |
| }), |
| }, |
| ApproveDisplayVideo360AdvertiserLinkProposal: []gax.CallOption{ |
| gax.WithTimeout(60000 * time.Millisecond), |
| gax.WithRetry(func() gax.Retryer { |
| return gax.OnCodes([]codes.Code{ |
| codes.Unavailable, |
| codes.Unknown, |
| }, gax.Backoff{ |
| Initial: 1000 * time.Millisecond, |
| Max: 60000 * time.Millisecond, |
| Multiplier: 1.30, |
| }) |
| }), |
| }, |
| CancelDisplayVideo360AdvertiserLinkProposal: []gax.CallOption{ |
| gax.WithTimeout(60000 * time.Millisecond), |
| gax.WithRetry(func() gax.Retryer { |
| return gax.OnCodes([]codes.Code{ |
| codes.Unavailable, |
| codes.Unknown, |
| }, gax.Backoff{ |
| Initial: 1000 * time.Millisecond, |
| Max: 60000 * time.Millisecond, |
| Multiplier: 1.30, |
| }) |
| }), |
| }, |
| CreateCustomDimension: []gax.CallOption{ |
| gax.WithTimeout(60000 * time.Millisecond), |
| gax.WithRetry(func() gax.Retryer { |
| return gax.OnCodes([]codes.Code{ |
| codes.Unavailable, |
| codes.Unknown, |
| }, gax.Backoff{ |
| Initial: 1000 * time.Millisecond, |
| Max: 60000 * time.Millisecond, |
| Multiplier: 1.30, |
| }) |
| }), |
| }, |
| UpdateCustomDimension: []gax.CallOption{ |
| gax.WithTimeout(60000 * time.Millisecond), |
| gax.WithRetry(func() gax.Retryer { |
| return gax.OnCodes([]codes.Code{ |
| codes.Unavailable, |
| codes.Unknown, |
| }, gax.Backoff{ |
| Initial: 1000 * time.Millisecond, |
| Max: 60000 * time.Millisecond, |
| Multiplier: 1.30, |
| }) |
| }), |
| }, |
| ListCustomDimensions: []gax.CallOption{ |
| gax.WithTimeout(60000 * time.Millisecond), |
| gax.WithRetry(func() gax.Retryer { |
| return gax.OnCodes([]codes.Code{ |
| codes.Unavailable, |
| codes.Unknown, |
| }, gax.Backoff{ |
| Initial: 1000 * time.Millisecond, |
| Max: 60000 * time.Millisecond, |
| Multiplier: 1.30, |
| }) |
| }), |
| }, |
| ArchiveCustomDimension: []gax.CallOption{ |
| gax.WithTimeout(60000 * time.Millisecond), |
| gax.WithRetry(func() gax.Retryer { |
| return gax.OnCodes([]codes.Code{ |
| codes.Unavailable, |
| codes.Unknown, |
| }, gax.Backoff{ |
| Initial: 1000 * time.Millisecond, |
| Max: 60000 * time.Millisecond, |
| Multiplier: 1.30, |
| }) |
| }), |
| }, |
| GetCustomDimension: []gax.CallOption{ |
| gax.WithTimeout(60000 * time.Millisecond), |
| gax.WithRetry(func() gax.Retryer { |
| return gax.OnCodes([]codes.Code{ |
| codes.Unavailable, |
| codes.Unknown, |
| }, gax.Backoff{ |
| Initial: 1000 * time.Millisecond, |
| Max: 60000 * time.Millisecond, |
| Multiplier: 1.30, |
| }) |
| }), |
| }, |
| CreateCustomMetric: []gax.CallOption{ |
| gax.WithTimeout(60000 * time.Millisecond), |
| gax.WithRetry(func() gax.Retryer { |
| return gax.OnCodes([]codes.Code{ |
| codes.Unavailable, |
| codes.Unknown, |
| }, gax.Backoff{ |
| Initial: 1000 * time.Millisecond, |
| Max: 60000 * time.Millisecond, |
| Multiplier: 1.30, |
| }) |
| }), |
| }, |
| UpdateCustomMetric: []gax.CallOption{ |
| gax.WithTimeout(60000 * time.Millisecond), |
| gax.WithRetry(func() gax.Retryer { |
| return gax.OnCodes([]codes.Code{ |
| codes.Unavailable, |
| codes.Unknown, |
| }, gax.Backoff{ |
| Initial: 1000 * time.Millisecond, |
| Max: 60000 * time.Millisecond, |
| Multiplier: 1.30, |
| }) |
| }), |
| }, |
| ListCustomMetrics: []gax.CallOption{ |
| gax.WithTimeout(60000 * time.Millisecond), |
| gax.WithRetry(func() gax.Retryer { |
| return gax.OnCodes([]codes.Code{ |
| codes.Unavailable, |
| codes.Unknown, |
| }, gax.Backoff{ |
| Initial: 1000 * time.Millisecond, |
| Max: 60000 * time.Millisecond, |
| Multiplier: 1.30, |
| }) |
| }), |
| }, |
| ArchiveCustomMetric: []gax.CallOption{ |
| gax.WithTimeout(60000 * time.Millisecond), |
| gax.WithRetry(func() gax.Retryer { |
| return gax.OnCodes([]codes.Code{ |
| codes.Unavailable, |
| codes.Unknown, |
| }, gax.Backoff{ |
| Initial: 1000 * time.Millisecond, |
| Max: 60000 * time.Millisecond, |
| Multiplier: 1.30, |
| }) |
| }), |
| }, |
| GetCustomMetric: []gax.CallOption{ |
| gax.WithTimeout(60000 * time.Millisecond), |
| gax.WithRetry(func() gax.Retryer { |
| return gax.OnCodes([]codes.Code{ |
| codes.Unavailable, |
| codes.Unknown, |
| }, gax.Backoff{ |
| Initial: 1000 * time.Millisecond, |
| Max: 60000 * time.Millisecond, |
| Multiplier: 1.30, |
| }) |
| }), |
| }, |
| GetDataRetentionSettings: []gax.CallOption{ |
| gax.WithTimeout(60000 * time.Millisecond), |
| gax.WithRetry(func() gax.Retryer { |
| return gax.OnCodes([]codes.Code{ |
| codes.Unavailable, |
| codes.Unknown, |
| }, gax.Backoff{ |
| Initial: 1000 * time.Millisecond, |
| Max: 60000 * time.Millisecond, |
| Multiplier: 1.30, |
| }) |
| }), |
| }, |
| UpdateDataRetentionSettings: []gax.CallOption{ |
| gax.WithTimeout(60000 * time.Millisecond), |
| gax.WithRetry(func() gax.Retryer { |
| return gax.OnCodes([]codes.Code{ |
| codes.Unavailable, |
| codes.Unknown, |
| }, gax.Backoff{ |
| Initial: 1000 * time.Millisecond, |
| Max: 60000 * time.Millisecond, |
| Multiplier: 1.30, |
| }) |
| }), |
| }, |
| CreateDataStream: []gax.CallOption{ |
| gax.WithTimeout(60000 * time.Millisecond), |
| gax.WithRetry(func() gax.Retryer { |
| return gax.OnCodes([]codes.Code{ |
| codes.Unavailable, |
| codes.Unknown, |
| }, gax.Backoff{ |
| Initial: 1000 * time.Millisecond, |
| Max: 60000 * time.Millisecond, |
| Multiplier: 1.30, |
| }) |
| }), |
| }, |
| DeleteDataStream: []gax.CallOption{ |
| gax.WithTimeout(60000 * time.Millisecond), |
| gax.WithRetry(func() gax.Retryer { |
| return gax.OnCodes([]codes.Code{ |
| codes.Unavailable, |
| codes.Unknown, |
| }, gax.Backoff{ |
| Initial: 1000 * time.Millisecond, |
| Max: 60000 * time.Millisecond, |
| Multiplier: 1.30, |
| }) |
| }), |
| }, |
| UpdateDataStream: []gax.CallOption{ |
| gax.WithTimeout(60000 * time.Millisecond), |
| gax.WithRetry(func() gax.Retryer { |
| return gax.OnCodes([]codes.Code{ |
| codes.Unavailable, |
| codes.Unknown, |
| }, gax.Backoff{ |
| Initial: 1000 * time.Millisecond, |
| Max: 60000 * time.Millisecond, |
| Multiplier: 1.30, |
| }) |
| }), |
| }, |
| ListDataStreams: []gax.CallOption{ |
| gax.WithTimeout(60000 * time.Millisecond), |
| gax.WithRetry(func() gax.Retryer { |
| return gax.OnCodes([]codes.Code{ |
| codes.Unavailable, |
| codes.Unknown, |
| }, gax.Backoff{ |
| Initial: 1000 * time.Millisecond, |
| Max: 60000 * time.Millisecond, |
| Multiplier: 1.30, |
| }) |
| }), |
| }, |
| GetDataStream: []gax.CallOption{ |
| gax.WithTimeout(60000 * time.Millisecond), |
| gax.WithRetry(func() gax.Retryer { |
| return gax.OnCodes([]codes.Code{ |
| codes.Unavailable, |
| codes.Unknown, |
| }, gax.Backoff{ |
| Initial: 1000 * time.Millisecond, |
| Max: 60000 * time.Millisecond, |
| Multiplier: 1.30, |
| }) |
| }), |
| }, |
| GetAudience: []gax.CallOption{ |
| gax.WithTimeout(60000 * time.Millisecond), |
| gax.WithRetry(func() gax.Retryer { |
| return gax.OnCodes([]codes.Code{ |
| codes.Unavailable, |
| codes.Unknown, |
| }, gax.Backoff{ |
| Initial: 1000 * time.Millisecond, |
| Max: 60000 * time.Millisecond, |
| Multiplier: 1.30, |
| }) |
| }), |
| }, |
| ListAudiences: []gax.CallOption{ |
| gax.WithTimeout(60000 * time.Millisecond), |
| gax.WithRetry(func() gax.Retryer { |
| return gax.OnCodes([]codes.Code{ |
| codes.Unavailable, |
| codes.Unknown, |
| }, gax.Backoff{ |
| Initial: 1000 * time.Millisecond, |
| Max: 60000 * time.Millisecond, |
| Multiplier: 1.30, |
| }) |
| }), |
| }, |
| CreateAudience: []gax.CallOption{ |
| gax.WithTimeout(60000 * time.Millisecond), |
| gax.WithRetry(func() gax.Retryer { |
| return gax.OnCodes([]codes.Code{ |
| codes.Unavailable, |
| codes.Unknown, |
| }, gax.Backoff{ |
| Initial: 1000 * time.Millisecond, |
| Max: 60000 * time.Millisecond, |
| Multiplier: 1.30, |
| }) |
| }), |
| }, |
| UpdateAudience: []gax.CallOption{ |
| gax.WithTimeout(60000 * time.Millisecond), |
| gax.WithRetry(func() gax.Retryer { |
| return gax.OnCodes([]codes.Code{ |
| codes.Unavailable, |
| codes.Unknown, |
| }, gax.Backoff{ |
| Initial: 1000 * time.Millisecond, |
| Max: 60000 * time.Millisecond, |
| Multiplier: 1.30, |
| }) |
| }), |
| }, |
| ArchiveAudience: []gax.CallOption{ |
| gax.WithTimeout(60000 * time.Millisecond), |
| gax.WithRetry(func() gax.Retryer { |
| return gax.OnCodes([]codes.Code{ |
| codes.Unavailable, |
| codes.Unknown, |
| }, gax.Backoff{ |
| Initial: 1000 * time.Millisecond, |
| Max: 60000 * time.Millisecond, |
| Multiplier: 1.30, |
| }) |
| }), |
| }, |
| GetSearchAds360Link: []gax.CallOption{ |
| gax.WithTimeout(60000 * time.Millisecond), |
| gax.WithRetry(func() gax.Retryer { |
| return gax.OnCodes([]codes.Code{ |
| codes.Unavailable, |
| codes.Unknown, |
| }, gax.Backoff{ |
| Initial: 1000 * time.Millisecond, |
| Max: 60000 * time.Millisecond, |
| Multiplier: 1.30, |
| }) |
| }), |
| }, |
| ListSearchAds360Links: []gax.CallOption{ |
| gax.WithTimeout(60000 * time.Millisecond), |
| gax.WithRetry(func() gax.Retryer { |
| return gax.OnCodes([]codes.Code{ |
| codes.Unavailable, |
| codes.Unknown, |
| }, gax.Backoff{ |
| Initial: 1000 * time.Millisecond, |
| Max: 60000 * time.Millisecond, |
| Multiplier: 1.30, |
| }) |
| }), |
| }, |
| CreateSearchAds360Link: []gax.CallOption{ |
| gax.WithTimeout(60000 * time.Millisecond), |
| gax.WithRetry(func() gax.Retryer { |
| return gax.OnCodes([]codes.Code{ |
| codes.Unavailable, |
| codes.Unknown, |
| }, gax.Backoff{ |
| Initial: 1000 * time.Millisecond, |
| Max: 60000 * time.Millisecond, |
| Multiplier: 1.30, |
| }) |
| }), |
| }, |
| DeleteSearchAds360Link: []gax.CallOption{ |
| gax.WithTimeout(60000 * time.Millisecond), |
| gax.WithRetry(func() gax.Retryer { |
| return gax.OnCodes([]codes.Code{ |
| codes.Unavailable, |
| codes.Unknown, |
| }, gax.Backoff{ |
| Initial: 1000 * time.Millisecond, |
| Max: 60000 * time.Millisecond, |
| Multiplier: 1.30, |
| }) |
| }), |
| }, |
| UpdateSearchAds360Link: []gax.CallOption{ |
| gax.WithTimeout(60000 * time.Millisecond), |
| gax.WithRetry(func() gax.Retryer { |
| return gax.OnCodes([]codes.Code{ |
| codes.Unavailable, |
| codes.Unknown, |
| }, gax.Backoff{ |
| Initial: 1000 * time.Millisecond, |
| Max: 60000 * time.Millisecond, |
| Multiplier: 1.30, |
| }) |
| }), |
| }, |
| GetAttributionSettings: []gax.CallOption{ |
| gax.WithTimeout(60000 * time.Millisecond), |
| gax.WithRetry(func() gax.Retryer { |
| return gax.OnCodes([]codes.Code{ |
| codes.Unavailable, |
| codes.Unknown, |
| }, gax.Backoff{ |
| Initial: 1000 * time.Millisecond, |
| Max: 60000 * time.Millisecond, |
| Multiplier: 1.30, |
| }) |
| }), |
| }, |
| UpdateAttributionSettings: []gax.CallOption{ |
| gax.WithTimeout(60000 * time.Millisecond), |
| gax.WithRetry(func() gax.Retryer { |
| return gax.OnCodes([]codes.Code{ |
| codes.Unavailable, |
| codes.Unknown, |
| }, gax.Backoff{ |
| Initial: 1000 * time.Millisecond, |
| Max: 60000 * time.Millisecond, |
| Multiplier: 1.30, |
| }) |
| }), |
| }, |
| RunAccessReport: []gax.CallOption{ |
| gax.WithTimeout(60000 * time.Millisecond), |
| gax.WithRetry(func() gax.Retryer { |
| return gax.OnCodes([]codes.Code{ |
| codes.Unavailable, |
| codes.Unknown, |
| }, gax.Backoff{ |
| Initial: 1000 * time.Millisecond, |
| Max: 60000 * time.Millisecond, |
| Multiplier: 1.30, |
| }) |
| }), |
| }, |
| CreateAccessBinding: []gax.CallOption{ |
| gax.WithTimeout(60000 * time.Millisecond), |
| gax.WithRetry(func() gax.Retryer { |
| return gax.OnCodes([]codes.Code{ |
| codes.Unavailable, |
| codes.Unknown, |
| }, gax.Backoff{ |
| Initial: 1000 * time.Millisecond, |
| Max: 60000 * time.Millisecond, |
| Multiplier: 1.30, |
| }) |
| }), |
| }, |
| GetAccessBinding: []gax.CallOption{ |
| gax.WithTimeout(60000 * time.Millisecond), |
| gax.WithRetry(func() gax.Retryer { |
| return gax.OnCodes([]codes.Code{ |
| codes.Unavailable, |
| codes.Unknown, |
| }, gax.Backoff{ |
| Initial: 1000 * time.Millisecond, |
| Max: 60000 * time.Millisecond, |
| Multiplier: 1.30, |
| }) |
| }), |
| }, |
| UpdateAccessBinding: []gax.CallOption{ |
| gax.WithTimeout(60000 * time.Millisecond), |
| gax.WithRetry(func() gax.Retryer { |
| return gax.OnCodes([]codes.Code{ |
| codes.Unavailable, |
| codes.Unknown, |
| }, gax.Backoff{ |
| Initial: 1000 * time.Millisecond, |
| Max: 60000 * time.Millisecond, |
| Multiplier: 1.30, |
| }) |
| }), |
| }, |
| DeleteAccessBinding: []gax.CallOption{ |
| gax.WithTimeout(60000 * time.Millisecond), |
| gax.WithRetry(func() gax.Retryer { |
| return gax.OnCodes([]codes.Code{ |
| codes.Unavailable, |
| codes.Unknown, |
| }, gax.Backoff{ |
| Initial: 1000 * time.Millisecond, |
| Max: 60000 * time.Millisecond, |
| Multiplier: 1.30, |
| }) |
| }), |
| }, |
| ListAccessBindings: []gax.CallOption{ |
| gax.WithTimeout(60000 * time.Millisecond), |
| gax.WithRetry(func() gax.Retryer { |
| return gax.OnCodes([]codes.Code{ |
| codes.Unavailable, |
| codes.Unknown, |
| }, gax.Backoff{ |
| Initial: 1000 * time.Millisecond, |
| Max: 60000 * time.Millisecond, |
| Multiplier: 1.30, |
| }) |
| }), |
| }, |
| BatchCreateAccessBindings: []gax.CallOption{ |
| gax.WithTimeout(60000 * time.Millisecond), |
| gax.WithRetry(func() gax.Retryer { |
| return gax.OnCodes([]codes.Code{ |
| codes.Unavailable, |
| codes.Unknown, |
| }, gax.Backoff{ |
| Initial: 1000 * time.Millisecond, |
| Max: 60000 * time.Millisecond, |
| Multiplier: 1.30, |
| }) |
| }), |
| }, |
| BatchGetAccessBindings: []gax.CallOption{ |
| gax.WithTimeout(60000 * time.Millisecond), |
| gax.WithRetry(func() gax.Retryer { |
| return gax.OnCodes([]codes.Code{ |
| codes.Unavailable, |
| codes.Unknown, |
| }, gax.Backoff{ |
| Initial: 1000 * time.Millisecond, |
| Max: 60000 * time.Millisecond, |
| Multiplier: 1.30, |
| }) |
| }), |
| }, |
| BatchUpdateAccessBindings: []gax.CallOption{ |
| gax.WithTimeout(60000 * time.Millisecond), |
| gax.WithRetry(func() gax.Retryer { |
| return gax.OnCodes([]codes.Code{ |
| codes.Unavailable, |
| codes.Unknown, |
| }, gax.Backoff{ |
| Initial: 1000 * time.Millisecond, |
| Max: 60000 * time.Millisecond, |
| Multiplier: 1.30, |
| }) |
| }), |
| }, |
| BatchDeleteAccessBindings: []gax.CallOption{ |
| gax.WithTimeout(60000 * time.Millisecond), |
| gax.WithRetry(func() gax.Retryer { |
| return gax.OnCodes([]codes.Code{ |
| codes.Unavailable, |
| codes.Unknown, |
| }, gax.Backoff{ |
| Initial: 1000 * time.Millisecond, |
| Max: 60000 * time.Millisecond, |
| Multiplier: 1.30, |
| }) |
| }), |
| }, |
| GetExpandedDataSet: []gax.CallOption{ |
| gax.WithTimeout(60000 * time.Millisecond), |
| gax.WithRetry(func() gax.Retryer { |
| return gax.OnCodes([]codes.Code{ |
| codes.Unavailable, |
| codes.Unknown, |
| }, gax.Backoff{ |
| Initial: 1000 * time.Millisecond, |
| Max: 60000 * time.Millisecond, |
| Multiplier: 1.30, |
| }) |
| }), |
| }, |
| ListExpandedDataSets: []gax.CallOption{ |
| gax.WithTimeout(60000 * time.Millisecond), |
| gax.WithRetry(func() gax.Retryer { |
| return gax.OnCodes([]codes.Code{ |
| codes.Unavailable, |
| codes.Unknown, |
| }, gax.Backoff{ |
| Initial: 1000 * time.Millisecond, |
| Max: 60000 * time.Millisecond, |
| Multiplier: 1.30, |
| }) |
| }), |
| }, |
| CreateExpandedDataSet: []gax.CallOption{ |
| gax.WithTimeout(60000 * time.Millisecond), |
| gax.WithRetry(func() gax.Retryer { |
| return gax.OnCodes([]codes.Code{ |
| codes.Unavailable, |
| codes.Unknown, |
| }, gax.Backoff{ |
| Initial: 1000 * time.Millisecond, |
| Max: 60000 * time.Millisecond, |
| Multiplier: 1.30, |
| }) |
| }), |
| }, |
| UpdateExpandedDataSet: []gax.CallOption{ |
| gax.WithTimeout(60000 * time.Millisecond), |
| gax.WithRetry(func() gax.Retryer { |
| return gax.OnCodes([]codes.Code{ |
| codes.Unavailable, |
| codes.Unknown, |
| }, gax.Backoff{ |
| Initial: 1000 * time.Millisecond, |
| Max: 60000 * time.Millisecond, |
| Multiplier: 1.30, |
| }) |
| }), |
| }, |
| DeleteExpandedDataSet: []gax.CallOption{ |
| gax.WithTimeout(60000 * time.Millisecond), |
| gax.WithRetry(func() gax.Retryer { |
| return gax.OnCodes([]codes.Code{ |
| codes.Unavailable, |
| codes.Unknown, |
| }, gax.Backoff{ |
| Initial: 1000 * time.Millisecond, |
| Max: 60000 * time.Millisecond, |
| Multiplier: 1.30, |
| }) |
| }), |
| }, |
| GetChannelGroup: []gax.CallOption{ |
| gax.WithTimeout(60000 * time.Millisecond), |
| gax.WithRetry(func() gax.Retryer { |
| return gax.OnCodes([]codes.Code{ |
| codes.Unavailable, |
| codes.Unknown, |
| }, gax.Backoff{ |
| Initial: 1000 * time.Millisecond, |
| Max: 60000 * time.Millisecond, |
| Multiplier: 1.30, |
| }) |
| }), |
| }, |
| ListChannelGroups: []gax.CallOption{ |
| gax.WithTimeout(60000 * time.Millisecond), |
| gax.WithRetry(func() gax.Retryer { |
| return gax.OnCodes([]codes.Code{ |
| codes.Unavailable, |
| codes.Unknown, |
| }, gax.Backoff{ |
| Initial: 1000 * time.Millisecond, |
| Max: 60000 * time.Millisecond, |
| Multiplier: 1.30, |
| }) |
| }), |
| }, |
| CreateChannelGroup: []gax.CallOption{ |
| gax.WithTimeout(60000 * time.Millisecond), |
| gax.WithRetry(func() gax.Retryer { |
| return gax.OnCodes([]codes.Code{ |
| codes.Unavailable, |
| codes.Unknown, |
| }, gax.Backoff{ |
| Initial: 1000 * time.Millisecond, |
| Max: 60000 * time.Millisecond, |
| Multiplier: 1.30, |
| }) |
| }), |
| }, |
| UpdateChannelGroup: []gax.CallOption{ |
| gax.WithTimeout(60000 * time.Millisecond), |
| gax.WithRetry(func() gax.Retryer { |
| return gax.OnCodes([]codes.Code{ |
| codes.Unavailable, |
| codes.Unknown, |
| }, gax.Backoff{ |
| Initial: 1000 * time.Millisecond, |
| Max: 60000 * time.Millisecond, |
| Multiplier: 1.30, |
| }) |
| }), |
| }, |
| DeleteChannelGroup: []gax.CallOption{ |
| gax.WithTimeout(60000 * time.Millisecond), |
| gax.WithRetry(func() gax.Retryer { |
| return gax.OnCodes([]codes.Code{ |
| codes.Unavailable, |
| codes.Unknown, |
| }, gax.Backoff{ |
| Initial: 1000 * time.Millisecond, |
| Max: 60000 * time.Millisecond, |
| Multiplier: 1.30, |
| }) |
| }), |
| }, |
| SetAutomatedGa4ConfigurationOptOut: []gax.CallOption{ |
| gax.WithTimeout(60000 * time.Millisecond), |
| gax.WithRetry(func() gax.Retryer { |
| return gax.OnCodes([]codes.Code{ |
| codes.Unavailable, |
| codes.Unknown, |
| }, gax.Backoff{ |
| Initial: 1000 * time.Millisecond, |
| Max: 60000 * time.Millisecond, |
| Multiplier: 1.30, |
| }) |
| }), |
| }, |
| FetchAutomatedGa4ConfigurationOptOut: []gax.CallOption{ |
| gax.WithTimeout(60000 * time.Millisecond), |
| gax.WithRetry(func() gax.Retryer { |
| return gax.OnCodes([]codes.Code{ |
| codes.Unavailable, |
| codes.Unknown, |
| }, gax.Backoff{ |
| Initial: 1000 * time.Millisecond, |
| Max: 60000 * time.Millisecond, |
| Multiplier: 1.30, |
| }) |
| }), |
| }, |
| GetBigQueryLink: []gax.CallOption{ |
| gax.WithTimeout(60000 * time.Millisecond), |
| gax.WithRetry(func() gax.Retryer { |
| return gax.OnCodes([]codes.Code{ |
| codes.Unavailable, |
| codes.Unknown, |
| }, gax.Backoff{ |
| Initial: 1000 * time.Millisecond, |
| Max: 60000 * time.Millisecond, |
| Multiplier: 1.30, |
| }) |
| }), |
| }, |
| ListBigQueryLinks: []gax.CallOption{ |
| gax.WithTimeout(60000 * time.Millisecond), |
| gax.WithRetry(func() gax.Retryer { |
| return gax.OnCodes([]codes.Code{ |
| codes.Unavailable, |
| codes.Unknown, |
| }, gax.Backoff{ |
| Initial: 1000 * time.Millisecond, |
| Max: 60000 * time.Millisecond, |
| Multiplier: 1.30, |
| }) |
| }), |
| }, |
| GetEnhancedMeasurementSettings: []gax.CallOption{ |
| gax.WithTimeout(60000 * time.Millisecond), |
| }, |
| UpdateEnhancedMeasurementSettings: []gax.CallOption{ |
| gax.WithTimeout(60000 * time.Millisecond), |
| }, |
| CreateConnectedSiteTag: []gax.CallOption{ |
| gax.WithTimeout(60000 * time.Millisecond), |
| gax.WithRetry(func() gax.Retryer { |
| return gax.OnCodes([]codes.Code{ |
| codes.Unavailable, |
| codes.Unknown, |
| }, gax.Backoff{ |
| Initial: 1000 * time.Millisecond, |
| Max: 60000 * time.Millisecond, |
| Multiplier: 1.30, |
| }) |
| }), |
| }, |
| DeleteConnectedSiteTag: []gax.CallOption{ |
| gax.WithTimeout(60000 * time.Millisecond), |
| gax.WithRetry(func() gax.Retryer { |
| return gax.OnCodes([]codes.Code{ |
| codes.Unavailable, |
| codes.Unknown, |
| }, gax.Backoff{ |
| Initial: 1000 * time.Millisecond, |
| Max: 60000 * time.Millisecond, |
| Multiplier: 1.30, |
| }) |
| }), |
| }, |
| ListConnectedSiteTags: []gax.CallOption{ |
| gax.WithTimeout(60000 * time.Millisecond), |
| gax.WithRetry(func() gax.Retryer { |
| return gax.OnCodes([]codes.Code{ |
| codes.Unavailable, |
| codes.Unknown, |
| }, gax.Backoff{ |
| Initial: 1000 * time.Millisecond, |
| Max: 60000 * time.Millisecond, |
| Multiplier: 1.30, |
| }) |
| }), |
| }, |
| FetchConnectedGa4Property: []gax.CallOption{ |
| gax.WithTimeout(60000 * time.Millisecond), |
| gax.WithRetry(func() gax.Retryer { |
| return gax.OnCodes([]codes.Code{ |
| codes.Unavailable, |
| codes.Unknown, |
| }, gax.Backoff{ |
| Initial: 1000 * time.Millisecond, |
| Max: 60000 * time.Millisecond, |
| Multiplier: 1.30, |
| }) |
| }), |
| }, |
| GetAdSenseLink: []gax.CallOption{ |
| gax.WithTimeout(60000 * time.Millisecond), |
| gax.WithRetry(func() gax.Retryer { |
| return gax.OnCodes([]codes.Code{ |
| codes.Unavailable, |
| codes.Unknown, |
| }, gax.Backoff{ |
| Initial: 1000 * time.Millisecond, |
| Max: 60000 * time.Millisecond, |
| Multiplier: 1.30, |
| }) |
| }), |
| }, |
| CreateAdSenseLink: []gax.CallOption{ |
| gax.WithTimeout(60000 * time.Millisecond), |
| gax.WithRetry(func() gax.Retryer { |
| return gax.OnCodes([]codes.Code{ |
| codes.Unavailable, |
| codes.Unknown, |
| }, gax.Backoff{ |
| Initial: 1000 * time.Millisecond, |
| Max: 60000 * time.Millisecond, |
| Multiplier: 1.30, |
| }) |
| }), |
| }, |
| DeleteAdSenseLink: []gax.CallOption{ |
| gax.WithTimeout(60000 * time.Millisecond), |
| gax.WithRetry(func() gax.Retryer { |
| return gax.OnCodes([]codes.Code{ |
| codes.Unavailable, |
| codes.Unknown, |
| }, gax.Backoff{ |
| Initial: 1000 * time.Millisecond, |
| Max: 60000 * time.Millisecond, |
| Multiplier: 1.30, |
| }) |
| }), |
| }, |
| ListAdSenseLinks: []gax.CallOption{ |
| gax.WithTimeout(60000 * time.Millisecond), |
| gax.WithRetry(func() gax.Retryer { |
| return gax.OnCodes([]codes.Code{ |
| codes.Unavailable, |
| codes.Unknown, |
| }, gax.Backoff{ |
| Initial: 1000 * time.Millisecond, |
| Max: 60000 * time.Millisecond, |
| Multiplier: 1.30, |
| }) |
| }), |
| }, |
| GetEventCreateRule: []gax.CallOption{ |
| gax.WithTimeout(60000 * time.Millisecond), |
| gax.WithRetry(func() gax.Retryer { |
| return gax.OnCodes([]codes.Code{ |
| codes.Unavailable, |
| codes.Unknown, |
| }, gax.Backoff{ |
| Initial: 1000 * time.Millisecond, |
| Max: 60000 * time.Millisecond, |
| Multiplier: 1.30, |
| }) |
| }), |
| }, |
| ListEventCreateRules: []gax.CallOption{ |
| gax.WithTimeout(60000 * time.Millisecond), |
| gax.WithRetry(func() gax.Retryer { |
| return gax.OnCodes([]codes.Code{ |
| codes.Unavailable, |
| codes.Unknown, |
| }, gax.Backoff{ |
| Initial: 1000 * time.Millisecond, |
| Max: 60000 * time.Millisecond, |
| Multiplier: 1.30, |
| }) |
| }), |
| }, |
| CreateEventCreateRule: []gax.CallOption{ |
| gax.WithTimeout(60000 * time.Millisecond), |
| gax.WithRetry(func() gax.Retryer { |
| return gax.OnCodes([]codes.Code{ |
| codes.Unavailable, |
| codes.Unknown, |
| }, gax.Backoff{ |
| Initial: 1000 * time.Millisecond, |
| Max: 60000 * time.Millisecond, |
| Multiplier: 1.30, |
| }) |
| }), |
| }, |
| UpdateEventCreateRule: []gax.CallOption{ |
| gax.WithTimeout(60000 * time.Millisecond), |
| gax.WithRetry(func() gax.Retryer { |
| return gax.OnCodes([]codes.Code{ |
| codes.Unavailable, |
| codes.Unknown, |
| }, gax.Backoff{ |
| Initial: 1000 * time.Millisecond, |
| Max: 60000 * time.Millisecond, |
| Multiplier: 1.30, |
| }) |
| }), |
| }, |
| DeleteEventCreateRule: []gax.CallOption{ |
| gax.WithTimeout(60000 * time.Millisecond), |
| gax.WithRetry(func() gax.Retryer { |
| return gax.OnCodes([]codes.Code{ |
| codes.Unavailable, |
| codes.Unknown, |
| }, gax.Backoff{ |
| Initial: 1000 * time.Millisecond, |
| Max: 60000 * time.Millisecond, |
| Multiplier: 1.30, |
| }) |
| }), |
| }, |
| UpdateDataRedactionSettings: []gax.CallOption{ |
| gax.WithTimeout(60000 * time.Millisecond), |
| gax.WithRetry(func() gax.Retryer { |
| return gax.OnCodes([]codes.Code{ |
| codes.Unavailable, |
| codes.Unknown, |
| }, gax.Backoff{ |
| Initial: 1000 * time.Millisecond, |
| Max: 60000 * time.Millisecond, |
| Multiplier: 1.30, |
| }) |
| }), |
| }, |
| GetDataRedactionSettings: []gax.CallOption{ |
| gax.WithTimeout(60000 * time.Millisecond), |
| gax.WithRetry(func() gax.Retryer { |
| return gax.OnCodes([]codes.Code{ |
| codes.Unavailable, |
| codes.Unknown, |
| }, gax.Backoff{ |
| Initial: 1000 * time.Millisecond, |
| Max: 60000 * time.Millisecond, |
| Multiplier: 1.30, |
| }) |
| }), |
| }, |
| GetCalculatedMetric: []gax.CallOption{ |
| gax.WithTimeout(60000 * time.Millisecond), |
| gax.WithRetry(func() gax.Retryer { |
| return gax.OnCodes([]codes.Code{ |
| codes.Unavailable, |
| codes.Unknown, |
| }, gax.Backoff{ |
| Initial: 1000 * time.Millisecond, |
| Max: 60000 * time.Millisecond, |
| Multiplier: 1.30, |
| }) |
| }), |
| }, |
| CreateCalculatedMetric: []gax.CallOption{ |
| gax.WithTimeout(60000 * time.Millisecond), |
| gax.WithRetry(func() gax.Retryer { |
| return gax.OnCodes([]codes.Code{ |
| codes.Unavailable, |
| codes.Unknown, |
| }, gax.Backoff{ |
| Initial: 1000 * time.Millisecond, |
| Max: 60000 * time.Millisecond, |
| Multiplier: 1.30, |
| }) |
| }), |
| }, |
| ListCalculatedMetrics: []gax.CallOption{ |
| gax.WithTimeout(60000 * time.Millisecond), |
| gax.WithRetry(func() gax.Retryer { |
| return gax.OnCodes([]codes.Code{ |
| codes.Unavailable, |
| codes.Unknown, |
| }, gax.Backoff{ |
| Initial: 1000 * time.Millisecond, |
| Max: 60000 * time.Millisecond, |
| Multiplier: 1.30, |
| }) |
| }), |
| }, |
| UpdateCalculatedMetric: []gax.CallOption{ |
| gax.WithTimeout(60000 * time.Millisecond), |
| gax.WithRetry(func() gax.Retryer { |
| return gax.OnCodes([]codes.Code{ |
| codes.Unavailable, |
| codes.Unknown, |
| }, gax.Backoff{ |
| Initial: 1000 * time.Millisecond, |
| Max: 60000 * time.Millisecond, |
| Multiplier: 1.30, |
| }) |
| }), |
| }, |
| DeleteCalculatedMetric: []gax.CallOption{ |
| gax.WithTimeout(60000 * time.Millisecond), |
| gax.WithRetry(func() gax.Retryer { |
| return gax.OnCodes([]codes.Code{ |
| codes.Unavailable, |
| codes.Unknown, |
| }, gax.Backoff{ |
| Initial: 1000 * time.Millisecond, |
| Max: 60000 * time.Millisecond, |
| Multiplier: 1.30, |
| }) |
| }), |
| }, |
| CreateRollupProperty: []gax.CallOption{ |
| gax.WithTimeout(60000 * time.Millisecond), |
| gax.WithRetry(func() gax.Retryer { |
| return gax.OnCodes([]codes.Code{ |
| codes.Unavailable, |
| codes.Unknown, |
| }, gax.Backoff{ |
| Initial: 1000 * time.Millisecond, |
| Max: 60000 * time.Millisecond, |
| Multiplier: 1.30, |
| }) |
| }), |
| }, |
| GetRollupPropertySourceLink: []gax.CallOption{ |
| gax.WithTimeout(60000 * time.Millisecond), |
| gax.WithRetry(func() gax.Retryer { |
| return gax.OnCodes([]codes.Code{ |
| codes.Unavailable, |
| codes.Unknown, |
| }, gax.Backoff{ |
| Initial: 1000 * time.Millisecond, |
| Max: 60000 * time.Millisecond, |
| Multiplier: 1.30, |
| }) |
| }), |
| }, |
| ListRollupPropertySourceLinks: []gax.CallOption{ |
| gax.WithTimeout(60000 * time.Millisecond), |
| gax.WithRetry(func() gax.Retryer { |
| return gax.OnCodes([]codes.Code{ |
| codes.Unavailable, |
| codes.Unknown, |
| }, gax.Backoff{ |
| Initial: 1000 * time.Millisecond, |
| Max: 60000 * time.Millisecond, |
| Multiplier: 1.30, |
| }) |
| }), |
| }, |
| CreateRollupPropertySourceLink: []gax.CallOption{ |
| gax.WithTimeout(60000 * time.Millisecond), |
| gax.WithRetry(func() gax.Retryer { |
| return gax.OnCodes([]codes.Code{ |
| codes.Unavailable, |
| codes.Unknown, |
| }, gax.Backoff{ |
| Initial: 1000 * time.Millisecond, |
| Max: 60000 * time.Millisecond, |
| Multiplier: 1.30, |
| }) |
| }), |
| }, |
| DeleteRollupPropertySourceLink: []gax.CallOption{ |
| gax.WithTimeout(60000 * time.Millisecond), |
| gax.WithRetry(func() gax.Retryer { |
| return gax.OnCodes([]codes.Code{ |
| codes.Unavailable, |
| codes.Unknown, |
| }, gax.Backoff{ |
| Initial: 1000 * time.Millisecond, |
| Max: 60000 * time.Millisecond, |
| Multiplier: 1.30, |
| }) |
| }), |
| }, |
| CreateSubproperty: []gax.CallOption{ |
| gax.WithTimeout(60000 * time.Millisecond), |
| gax.WithRetry(func() gax.Retryer { |
| return gax.OnCodes([]codes.Code{ |
| codes.Unavailable, |
| codes.Unknown, |
| }, gax.Backoff{ |
| Initial: 1000 * time.Millisecond, |
| Max: 60000 * time.Millisecond, |
| Multiplier: 1.30, |
| }) |
| }), |
| }, |
| CreateSubpropertyEventFilter: []gax.CallOption{ |
| gax.WithTimeout(60000 * time.Millisecond), |
| gax.WithRetry(func() gax.Retryer { |
| return gax.OnCodes([]codes.Code{ |
| codes.Unavailable, |
| codes.Unknown, |
| }, gax.Backoff{ |
| Initial: 1000 * time.Millisecond, |
| Max: 60000 * time.Millisecond, |
| Multiplier: 1.30, |
| }) |
| }), |
| }, |
| GetSubpropertyEventFilter: []gax.CallOption{ |
| gax.WithTimeout(60000 * time.Millisecond), |
| gax.WithRetry(func() gax.Retryer { |
| return gax.OnCodes([]codes.Code{ |
| codes.Unavailable, |
| codes.Unknown, |
| }, gax.Backoff{ |
| Initial: 1000 * time.Millisecond, |
| Max: 60000 * time.Millisecond, |
| Multiplier: 1.30, |
| }) |
| }), |
| }, |
| ListSubpropertyEventFilters: []gax.CallOption{ |
| gax.WithTimeout(60000 * time.Millisecond), |
| gax.WithRetry(func() gax.Retryer { |
| return gax.OnCodes([]codes.Code{ |
| codes.Unavailable, |
| codes.Unknown, |
| }, gax.Backoff{ |
| Initial: 1000 * time.Millisecond, |
| Max: 60000 * time.Millisecond, |
| Multiplier: 1.30, |
| }) |
| }), |
| }, |
| UpdateSubpropertyEventFilter: []gax.CallOption{ |
| gax.WithTimeout(60000 * time.Millisecond), |
| gax.WithRetry(func() gax.Retryer { |
| return gax.OnCodes([]codes.Code{ |
| codes.Unavailable, |
| codes.Unknown, |
| }, gax.Backoff{ |
| Initial: 1000 * time.Millisecond, |
| Max: 60000 * time.Millisecond, |
| Multiplier: 1.30, |
| }) |
| }), |
| }, |
| DeleteSubpropertyEventFilter: []gax.CallOption{ |
| gax.WithTimeout(60000 * time.Millisecond), |
| gax.WithRetry(func() gax.Retryer { |
| return gax.OnCodes([]codes.Code{ |
| codes.Unavailable, |
| codes.Unknown, |
| }, gax.Backoff{ |
| Initial: 1000 * time.Millisecond, |
| Max: 60000 * time.Millisecond, |
| Multiplier: 1.30, |
| }) |
| }), |
| }, |
| } |
| } |
| |
| func defaultAnalyticsAdminRESTCallOptions() *AnalyticsAdminCallOptions { |
| return &AnalyticsAdminCallOptions{ |
| GetAccount: []gax.CallOption{ |
| gax.WithTimeout(60000 * time.Millisecond), |
| }, |
| ListAccounts: []gax.CallOption{ |
| gax.WithTimeout(60000 * time.Millisecond), |
| }, |
| DeleteAccount: []gax.CallOption{ |
| gax.WithTimeout(60000 * time.Millisecond), |
| }, |
| UpdateAccount: []gax.CallOption{ |
| gax.WithTimeout(60000 * time.Millisecond), |
| }, |
| ProvisionAccountTicket: []gax.CallOption{ |
| gax.WithTimeout(60000 * time.Millisecond), |
| }, |
| ListAccountSummaries: []gax.CallOption{ |
| gax.WithTimeout(60000 * time.Millisecond), |
| gax.WithRetry(func() gax.Retryer { |
| return gax.OnHTTPCodes(gax.Backoff{ |
| Initial: 1000 * time.Millisecond, |
| Max: 60000 * time.Millisecond, |
| Multiplier: 1.30, |
| }, |
| http.StatusServiceUnavailable, |
| http.StatusInternalServerError) |
| }), |
| }, |
| GetProperty: []gax.CallOption{ |
| gax.WithTimeout(60000 * time.Millisecond), |
| }, |
| ListProperties: []gax.CallOption{ |
| gax.WithTimeout(60000 * time.Millisecond), |
| }, |
| CreateProperty: []gax.CallOption{ |
| gax.WithTimeout(60000 * time.Millisecond), |
| }, |
| DeleteProperty: []gax.CallOption{ |
| gax.WithTimeout(60000 * time.Millisecond), |
| }, |
| UpdateProperty: []gax.CallOption{ |
| gax.WithTimeout(60000 * time.Millisecond), |
| }, |
| CreateFirebaseLink: []gax.CallOption{ |
| gax.WithTimeout(60000 * time.Millisecond), |
| }, |
| DeleteFirebaseLink: []gax.CallOption{ |
| gax.WithTimeout(60000 * time.Millisecond), |
| }, |
| ListFirebaseLinks: []gax.CallOption{ |
| gax.WithTimeout(60000 * time.Millisecond), |
| }, |
| GetGlobalSiteTag: []gax.CallOption{ |
| gax.WithTimeout(60000 * time.Millisecond), |
| }, |
| CreateGoogleAdsLink: []gax.CallOption{ |
| gax.WithTimeout(60000 * time.Millisecond), |
| }, |
| UpdateGoogleAdsLink: []gax.CallOption{ |
| gax.WithTimeout(60000 * time.Millisecond), |
| }, |
| DeleteGoogleAdsLink: []gax.CallOption{ |
| gax.WithTimeout(60000 * time.Millisecond), |
| }, |
| ListGoogleAdsLinks: []gax.CallOption{ |
| gax.WithTimeout(60000 * time.Millisecond), |
| }, |
| GetDataSharingSettings: []gax.CallOption{ |
| gax.WithTimeout(60000 * time.Millisecond), |
| gax.WithRetry(func() gax.Retryer { |
| return gax.OnHTTPCodes(gax.Backoff{ |
| Initial: 1000 * time.Millisecond, |
| Max: 60000 * time.Millisecond, |
| Multiplier: 1.30, |
| }, |
| http.StatusServiceUnavailable, |
| http.StatusInternalServerError) |
| }), |
| }, |
| GetMeasurementProtocolSecret: []gax.CallOption{ |
| gax.WithTimeout(60000 * time.Millisecond), |
| gax.WithRetry(func() gax.Retryer { |
| return gax.OnHTTPCodes(gax.Backoff{ |
| Initial: 1000 * time.Millisecond, |
| Max: 60000 * time.Millisecond, |
| Multiplier: 1.30, |
| }, |
| http.StatusServiceUnavailable, |
| http.StatusInternalServerError) |
| }), |
| }, |
| ListMeasurementProtocolSecrets: []gax.CallOption{ |
| gax.WithTimeout(60000 * time.Millisecond), |
| gax.WithRetry(func() gax.Retryer { |
| return gax.OnHTTPCodes(gax.Backoff{ |
| Initial: 1000 * time.Millisecond, |
| Max: 60000 * time.Millisecond, |
| Multiplier: 1.30, |
| }, |
| http.StatusServiceUnavailable, |
| http.StatusInternalServerError) |
| }), |
| }, |
| CreateMeasurementProtocolSecret: []gax.CallOption{ |
| gax.WithTimeout(60000 * time.Millisecond), |
| gax.WithRetry(func() gax.Retryer { |
| return gax.OnHTTPCodes(gax.Backoff{ |
| Initial: 1000 * time.Millisecond, |
| Max: 60000 * time.Millisecond, |
| Multiplier: 1.30, |
| }, |
| http.StatusServiceUnavailable, |
| http.StatusInternalServerError) |
| }), |
| }, |
| DeleteMeasurementProtocolSecret: []gax.CallOption{ |
| gax.WithTimeout(60000 * time.Millisecond), |
| gax.WithRetry(func() gax.Retryer { |
| return gax.OnHTTPCodes(gax.Backoff{ |
| Initial: 1000 * time.Millisecond, |
| Max: 60000 * time.Millisecond, |
| Multiplier: 1.30, |
| }, |
| http.StatusServiceUnavailable, |
| http.StatusInternalServerError) |
| }), |
| }, |
| UpdateMeasurementProtocolSecret: []gax.CallOption{ |
| gax.WithTimeout(60000 * time.Millisecond), |
| gax.WithRetry(func() gax.Retryer { |
| return gax.OnHTTPCodes(gax.Backoff{ |
| Initial: 1000 * time.Millisecond, |
| Max: 60000 * time.Millisecond, |
| Multiplier: 1.30, |
| }, |
| http.StatusServiceUnavailable, |
| http.StatusInternalServerError) |
| }), |
| }, |
| AcknowledgeUserDataCollection: []gax.CallOption{ |
| gax.WithTimeout(60000 * time.Millisecond), |
| gax.WithRetry(func() gax.Retryer { |
| return gax.OnHTTPCodes(gax.Backoff{ |
| Initial: 1000 * time.Millisecond, |
| Max: 60000 * time.Millisecond, |
| Multiplier: 1.30, |
| }, |
| http.StatusServiceUnavailable, |
| http.StatusInternalServerError) |
| }), |
| }, |
| GetSKAdNetworkConversionValueSchema: []gax.CallOption{ |
| gax.WithTimeout(60000 * time.Millisecond), |
| gax.WithRetry(func() gax.Retryer { |
| return gax.OnHTTPCodes(gax.Backoff{ |
| Initial: 1000 * time.Millisecond, |
| Max: 60000 * time.Millisecond, |
| Multiplier: 1.30, |
| }, |
| http.StatusServiceUnavailable, |
| http.StatusInternalServerError) |
| }), |
| }, |
| CreateSKAdNetworkConversionValueSchema: []gax.CallOption{ |
| gax.WithTimeout(60000 * time.Millisecond), |
| gax.WithRetry(func() gax.Retryer { |
| return gax.OnHTTPCodes(gax.Backoff{ |
| Initial: 1000 * time.Millisecond, |
| Max: 60000 * time.Millisecond, |
| Multiplier: 1.30, |
| }, |
| http.StatusServiceUnavailable, |
| http.StatusInternalServerError) |
| }), |
| }, |
| DeleteSKAdNetworkConversionValueSchema: []gax.CallOption{ |
| gax.WithTimeout(60000 * time.Millisecond), |
| gax.WithRetry(func() gax.Retryer { |
| return gax.OnHTTPCodes(gax.Backoff{ |
| Initial: 1000 * time.Millisecond, |
| Max: 60000 * time.Millisecond, |
| Multiplier: 1.30, |
| }, |
| http.StatusServiceUnavailable, |
| http.StatusInternalServerError) |
| }), |
| }, |
| UpdateSKAdNetworkConversionValueSchema: []gax.CallOption{ |
| gax.WithTimeout(60000 * time.Millisecond), |
| gax.WithRetry(func() gax.Retryer { |
| return gax.OnHTTPCodes(gax.Backoff{ |
| Initial: 1000 * time.Millisecond, |
| Max: 60000 * time.Millisecond, |
| Multiplier: 1.30, |
| }, |
| http.StatusServiceUnavailable, |
| http.StatusInternalServerError) |
| }), |
| }, |
| ListSKAdNetworkConversionValueSchemas: []gax.CallOption{ |
| gax.WithTimeout(60000 * time.Millisecond), |
| gax.WithRetry(func() gax.Retryer { |
| return gax.OnHTTPCodes(gax.Backoff{ |
| Initial: 1000 * time.Millisecond, |
| Max: 60000 * time.Millisecond, |
| Multiplier: 1.30, |
| }, |
| http.StatusServiceUnavailable, |
| http.StatusInternalServerError) |
| }), |
| }, |
| SearchChangeHistoryEvents: []gax.CallOption{ |
| gax.WithTimeout(60000 * time.Millisecond), |
| gax.WithRetry(func() gax.Retryer { |
| return gax.OnHTTPCodes(gax.Backoff{ |
| Initial: 1000 * time.Millisecond, |
| Max: 60000 * time.Millisecond, |
| Multiplier: 1.30, |
| }, |
| http.StatusServiceUnavailable, |
| http.StatusInternalServerError) |
| }), |
| }, |
| GetGoogleSignalsSettings: []gax.CallOption{ |
| gax.WithTimeout(60000 * time.Millisecond), |
| gax.WithRetry(func() gax.Retryer { |
| return gax.OnHTTPCodes(gax.Backoff{ |
| Initial: 1000 * time.Millisecond, |
| Max: 60000 * time.Millisecond, |
| Multiplier: 1.30, |
| }, |
| http.StatusServiceUnavailable, |
| http.StatusInternalServerError) |
| }), |
| }, |
| UpdateGoogleSignalsSettings: []gax.CallOption{ |
| gax.WithTimeout(60000 * time.Millisecond), |
| gax.WithRetry(func() gax.Retryer { |
| return gax.OnHTTPCodes(gax.Backoff{ |
| Initial: 1000 * time.Millisecond, |
| Max: 60000 * time.Millisecond, |
| Multiplier: 1.30, |
| }, |
| http.StatusServiceUnavailable, |
| http.StatusInternalServerError) |
| }), |
| }, |
| CreateConversionEvent: []gax.CallOption{ |
| gax.WithTimeout(60000 * time.Millisecond), |
| gax.WithRetry(func() gax.Retryer { |
| return gax.OnHTTPCodes(gax.Backoff{ |
| Initial: 1000 * time.Millisecond, |
| Max: 60000 * time.Millisecond, |
| Multiplier: 1.30, |
| }, |
| http.StatusServiceUnavailable, |
| http.StatusInternalServerError) |
| }), |
| }, |
| UpdateConversionEvent: []gax.CallOption{ |
| gax.WithTimeout(60000 * time.Millisecond), |
| gax.WithRetry(func() gax.Retryer { |
| return gax.OnHTTPCodes(gax.Backoff{ |
| Initial: 1000 * time.Millisecond, |
| Max: 60000 * time.Millisecond, |
| Multiplier: 1.30, |
| }, |
| http.StatusServiceUnavailable, |
| http.StatusInternalServerError) |
| }), |
| }, |
| GetConversionEvent: []gax.CallOption{ |
| gax.WithTimeout(60000 * time.Millisecond), |
| gax.WithRetry(func() gax.Retryer { |
| return gax.OnHTTPCodes(gax.Backoff{ |
| Initial: 1000 * time.Millisecond, |
| Max: 60000 * time.Millisecond, |
| Multiplier: 1.30, |
| }, |
| http.StatusServiceUnavailable, |
| http.StatusInternalServerError) |
| }), |
| }, |
| DeleteConversionEvent: []gax.CallOption{ |
| gax.WithTimeout(60000 * time.Millisecond), |
| gax.WithRetry(func() gax.Retryer { |
| return gax.OnHTTPCodes(gax.Backoff{ |
| Initial: 1000 * time.Millisecond, |
| Max: 60000 * time.Millisecond, |
| Multiplier: 1.30, |
| }, |
| http.StatusServiceUnavailable, |
| http.StatusInternalServerError) |
| }), |
| }, |
| ListConversionEvents: []gax.CallOption{ |
| gax.WithTimeout(60000 * time.Millisecond), |
| gax.WithRetry(func() gax.Retryer { |
| return gax.OnHTTPCodes(gax.Backoff{ |
| Initial: 1000 * time.Millisecond, |
| Max: 60000 * time.Millisecond, |
| Multiplier: 1.30, |
| }, |
| http.StatusServiceUnavailable, |
| http.StatusInternalServerError) |
| }), |
| }, |
| GetDisplayVideo360AdvertiserLink: []gax.CallOption{ |
| gax.WithTimeout(60000 * time.Millisecond), |
| gax.WithRetry(func() gax.Retryer { |
| return gax.OnHTTPCodes(gax.Backoff{ |
| Initial: 1000 * time.Millisecond, |
| Max: 60000 * time.Millisecond, |
| Multiplier: 1.30, |
| }, |
| http.StatusServiceUnavailable, |
| http.StatusInternalServerError) |
| }), |
| }, |
| ListDisplayVideo360AdvertiserLinks: []gax.CallOption{ |
| gax.WithTimeout(60000 * time.Millisecond), |
| gax.WithRetry(func() gax.Retryer { |
| return gax.OnHTTPCodes(gax.Backoff{ |
| Initial: 1000 * time.Millisecond, |
| Max: 60000 * time.Millisecond, |
| Multiplier: 1.30, |
| }, |
| http.StatusServiceUnavailable, |
| http.StatusInternalServerError) |
| }), |
| }, |
| CreateDisplayVideo360AdvertiserLink: []gax.CallOption{ |
| gax.WithTimeout(60000 * time.Millisecond), |
| gax.WithRetry(func() gax.Retryer { |
| return gax.OnHTTPCodes(gax.Backoff{ |
| Initial: 1000 * time.Millisecond, |
| Max: 60000 * time.Millisecond, |
| Multiplier: 1.30, |
| }, |
| http.StatusServiceUnavailable, |
| http.StatusInternalServerError) |
| }), |
| }, |
| DeleteDisplayVideo360AdvertiserLink: []gax.CallOption{ |
| gax.WithTimeout(60000 * time.Millisecond), |
| gax.WithRetry(func() gax.Retryer { |
| return gax.OnHTTPCodes(gax.Backoff{ |
| Initial: 1000 * time.Millisecond, |
| Max: 60000 * time.Millisecond, |
| Multiplier: 1.30, |
| }, |
| http.StatusServiceUnavailable, |
| http.StatusInternalServerError) |
| }), |
| }, |
| UpdateDisplayVideo360AdvertiserLink: []gax.CallOption{ |
| gax.WithTimeout(60000 * time.Millisecond), |
| gax.WithRetry(func() gax.Retryer { |
| return gax.OnHTTPCodes(gax.Backoff{ |
| Initial: 1000 * time.Millisecond, |
| Max: 60000 * time.Millisecond, |
| Multiplier: 1.30, |
| }, |
| http.StatusServiceUnavailable, |
| http.StatusInternalServerError) |
| }), |
| }, |
| GetDisplayVideo360AdvertiserLinkProposal: []gax.CallOption{ |
| gax.WithTimeout(60000 * time.Millisecond), |
| gax.WithRetry(func() gax.Retryer { |
| return gax.OnHTTPCodes(gax.Backoff{ |
| Initial: 1000 * time.Millisecond, |
| Max: 60000 * time.Millisecond, |
| Multiplier: 1.30, |
| }, |
| http.StatusServiceUnavailable, |
| http.StatusInternalServerError) |
| }), |
| }, |
| ListDisplayVideo360AdvertiserLinkProposals: []gax.CallOption{ |
| gax.WithTimeout(60000 * time.Millisecond), |
| gax.WithRetry(func() gax.Retryer { |
| return gax.OnHTTPCodes(gax.Backoff{ |
| Initial: 1000 * time.Millisecond, |
| Max: 60000 * time.Millisecond, |
| Multiplier: 1.30, |
| }, |
| http.StatusServiceUnavailable, |
| http.StatusInternalServerError) |
| }), |
| }, |
| CreateDisplayVideo360AdvertiserLinkProposal: []gax.CallOption{ |
| gax.WithTimeout(60000 * time.Millisecond), |
| gax.WithRetry(func() gax.Retryer { |
| return gax.OnHTTPCodes(gax.Backoff{ |
| Initial: 1000 * time.Millisecond, |
| Max: 60000 * time.Millisecond, |
| Multiplier: 1.30, |
| }, |
| http.StatusServiceUnavailable, |
| http.StatusInternalServerError) |
| }), |
| }, |
| DeleteDisplayVideo360AdvertiserLinkProposal: []gax.CallOption{ |
| gax.WithTimeout(60000 * time.Millisecond), |
| gax.WithRetry(func() gax.Retryer { |
| return gax.OnHTTPCodes(gax.Backoff{ |
| Initial: 1000 * time.Millisecond, |
| Max: 60000 * time.Millisecond, |
| Multiplier: 1.30, |
| }, |
| http.StatusServiceUnavailable, |
| http.StatusInternalServerError) |
| }), |
| }, |
| ApproveDisplayVideo360AdvertiserLinkProposal: []gax.CallOption{ |
| gax.WithTimeout(60000 * time.Millisecond), |
| gax.WithRetry(func() gax.Retryer { |
| return gax.OnHTTPCodes(gax.Backoff{ |
| Initial: 1000 * time.Millisecond, |
| Max: 60000 * time.Millisecond, |
| Multiplier: 1.30, |
| }, |
| http.StatusServiceUnavailable, |
| http.StatusInternalServerError) |
| }), |
| }, |
| CancelDisplayVideo360AdvertiserLinkProposal: []gax.CallOption{ |
| gax.WithTimeout(60000 * time.Millisecond), |
| gax.WithRetry(func() gax.Retryer { |
| return gax.OnHTTPCodes(gax.Backoff{ |
| Initial: 1000 * time.Millisecond, |
| Max: 60000 * time.Millisecond, |
| Multiplier: 1.30, |
| }, |
| http.StatusServiceUnavailable, |
| http.StatusInternalServerError) |
| }), |
| }, |
| CreateCustomDimension: []gax.CallOption{ |
| gax.WithTimeout(60000 * time.Millisecond), |
| gax.WithRetry(func() gax.Retryer { |
| return gax.OnHTTPCodes(gax.Backoff{ |
| Initial: 1000 * time.Millisecond, |
| Max: 60000 * time.Millisecond, |
| Multiplier: 1.30, |
| }, |
| http.StatusServiceUnavailable, |
| http.StatusInternalServerError) |
| }), |
| }, |
| UpdateCustomDimension: []gax.CallOption{ |
| gax.WithTimeout(60000 * time.Millisecond), |
| gax.WithRetry(func() gax.Retryer { |
| return gax.OnHTTPCodes(gax.Backoff{ |
| Initial: 1000 * time.Millisecond, |
| Max: 60000 * time.Millisecond, |
| Multiplier: 1.30, |
| }, |
| http.StatusServiceUnavailable, |
| http.StatusInternalServerError) |
| }), |
| }, |
| ListCustomDimensions: []gax.CallOption{ |
| gax.WithTimeout(60000 * time.Millisecond), |
| gax.WithRetry(func() gax.Retryer { |
| return gax.OnHTTPCodes(gax.Backoff{ |
| Initial: 1000 * time.Millisecond, |
| Max: 60000 * time.Millisecond, |
| Multiplier: 1.30, |
| }, |
| http.StatusServiceUnavailable, |
| http.StatusInternalServerError) |
| }), |
| }, |
| ArchiveCustomDimension: []gax.CallOption{ |
| gax.WithTimeout(60000 * time.Millisecond), |
| gax.WithRetry(func() gax.Retryer { |
| return gax.OnHTTPCodes(gax.Backoff{ |
| Initial: 1000 * time.Millisecond, |
| Max: 60000 * time.Millisecond, |
| Multiplier: 1.30, |
| }, |
| http.StatusServiceUnavailable, |
| http.StatusInternalServerError) |
| }), |
| }, |
| GetCustomDimension: []gax.CallOption{ |
| gax.WithTimeout(60000 * time.Millisecond), |
| gax.WithRetry(func() gax.Retryer { |
| return gax.OnHTTPCodes(gax.Backoff{ |
| Initial: 1000 * time.Millisecond, |
| Max: 60000 * time.Millisecond, |
| Multiplier: 1.30, |
| }, |
| http.StatusServiceUnavailable, |
| http.StatusInternalServerError) |
| }), |
| }, |
| CreateCustomMetric: []gax.CallOption{ |
| gax.WithTimeout(60000 * time.Millisecond), |
| gax.WithRetry(func() gax.Retryer { |
| return gax.OnHTTPCodes(gax.Backoff{ |
| Initial: 1000 * time.Millisecond, |
| Max: 60000 * time.Millisecond, |
| Multiplier: 1.30, |
| }, |
| http.StatusServiceUnavailable, |
| http.StatusInternalServerError) |
| }), |
| }, |
| UpdateCustomMetric: []gax.CallOption{ |
| gax.WithTimeout(60000 * time.Millisecond), |
| gax.WithRetry(func() gax.Retryer { |
| return gax.OnHTTPCodes(gax.Backoff{ |
| Initial: 1000 * time.Millisecond, |
| Max: 60000 * time.Millisecond, |
| Multiplier: 1.30, |
| }, |
| http.StatusServiceUnavailable, |
| http.StatusInternalServerError) |
| }), |
| }, |
| ListCustomMetrics: []gax.CallOption{ |
| gax.WithTimeout(60000 * time.Millisecond), |
| gax.WithRetry(func() gax.Retryer { |
| return gax.OnHTTPCodes(gax.Backoff{ |
| Initial: 1000 * time.Millisecond, |
| Max: 60000 * time.Millisecond, |
| Multiplier: 1.30, |
| }, |
| http.StatusServiceUnavailable, |
| http.StatusInternalServerError) |
| }), |
| }, |
| ArchiveCustomMetric: []gax.CallOption{ |
| gax.WithTimeout(60000 * time.Millisecond), |
| gax.WithRetry(func() gax.Retryer { |
| return gax.OnHTTPCodes(gax.Backoff{ |
| Initial: 1000 * time.Millisecond, |
| Max: 60000 * time.Millisecond, |
| Multiplier: 1.30, |
| }, |
| http.StatusServiceUnavailable, |
| http.StatusInternalServerError) |
| }), |
| }, |
| GetCustomMetric: []gax.CallOption{ |
| gax.WithTimeout(60000 * time.Millisecond), |
| gax.WithRetry(func() gax.Retryer { |
| return gax.OnHTTPCodes(gax.Backoff{ |
| Initial: 1000 * time.Millisecond, |
| Max: 60000 * time.Millisecond, |
| Multiplier: 1.30, |
| }, |
| http.StatusServiceUnavailable, |
| http.StatusInternalServerError) |
| }), |
| }, |
| GetDataRetentionSettings: []gax.CallOption{ |
| gax.WithTimeout(60000 * time.Millisecond), |
| gax.WithRetry(func() gax.Retryer { |
| return gax.OnHTTPCodes(gax.Backoff{ |
| Initial: 1000 * time.Millisecond, |
| Max: 60000 * time.Millisecond, |
| Multiplier: 1.30, |
| }, |
| http.StatusServiceUnavailable, |
| http.StatusInternalServerError) |
| }), |
| }, |
| UpdateDataRetentionSettings: []gax.CallOption{ |
| gax.WithTimeout(60000 * time.Millisecond), |
| gax.WithRetry(func() gax.Retryer { |
| return gax.OnHTTPCodes(gax.Backoff{ |
| Initial: 1000 * time.Millisecond, |
| Max: 60000 * time.Millisecond, |
| Multiplier: 1.30, |
| }, |
| http.StatusServiceUnavailable, |
| http.StatusInternalServerError) |
| }), |
| }, |
| CreateDataStream: []gax.CallOption{ |
| gax.WithTimeout(60000 * time.Millisecond), |
| gax.WithRetry(func() gax.Retryer { |
| return gax.OnHTTPCodes(gax.Backoff{ |
| Initial: 1000 * time.Millisecond, |
| Max: 60000 * time.Millisecond, |
| Multiplier: 1.30, |
| }, |
| http.StatusServiceUnavailable, |
| http.StatusInternalServerError) |
| }), |
| }, |
| DeleteDataStream: []gax.CallOption{ |
| gax.WithTimeout(60000 * time.Millisecond), |
| gax.WithRetry(func() gax.Retryer { |
| return gax.OnHTTPCodes(gax.Backoff{ |
| Initial: 1000 * time.Millisecond, |
| Max: 60000 * time.Millisecond, |
| Multiplier: 1.30, |
| }, |
| http.StatusServiceUnavailable, |
| http.StatusInternalServerError) |
| }), |
| }, |
| UpdateDataStream: []gax.CallOption{ |
| gax.WithTimeout(60000 * time.Millisecond), |
| gax.WithRetry(func() gax.Retryer { |
| return gax.OnHTTPCodes(gax.Backoff{ |
| Initial: 1000 * time.Millisecond, |
| Max: 60000 * time.Millisecond, |
| Multiplier: 1.30, |
| }, |
| http.StatusServiceUnavailable, |
| http.StatusInternalServerError) |
| }), |
| }, |
| ListDataStreams: []gax.CallOption{ |
| gax.WithTimeout(60000 * time.Millisecond), |
| gax.WithRetry(func() gax.Retryer { |
| return gax.OnHTTPCodes(gax.Backoff{ |
| Initial: 1000 * time.Millisecond, |
| Max: 60000 * time.Millisecond, |
| Multiplier: 1.30, |
| }, |
| http.StatusServiceUnavailable, |
| http.StatusInternalServerError) |
| }), |
| }, |
| GetDataStream: []gax.CallOption{ |
| gax.WithTimeout(60000 * time.Millisecond), |
| gax.WithRetry(func() gax.Retryer { |
| return gax.OnHTTPCodes(gax.Backoff{ |
| Initial: 1000 * time.Millisecond, |
| Max: 60000 * time.Millisecond, |
| Multiplier: 1.30, |
| }, |
| http.StatusServiceUnavailable, |
| http.StatusInternalServerError) |
| }), |
| }, |
| GetAudience: []gax.CallOption{ |
| gax.WithTimeout(60000 * time.Millisecond), |
| gax.WithRetry(func() gax.Retryer { |
| return gax.OnHTTPCodes(gax.Backoff{ |
| Initial: 1000 * time.Millisecond, |
| Max: 60000 * time.Millisecond, |
| Multiplier: 1.30, |
| }, |
| http.StatusServiceUnavailable, |
| http.StatusInternalServerError) |
| }), |
| }, |
| ListAudiences: []gax.CallOption{ |
| gax.WithTimeout(60000 * time.Millisecond), |
| gax.WithRetry(func() gax.Retryer { |
| return gax.OnHTTPCodes(gax.Backoff{ |
| Initial: 1000 * time.Millisecond, |
| Max: 60000 * time.Millisecond, |
| Multiplier: 1.30, |
| }, |
| http.StatusServiceUnavailable, |
| http.StatusInternalServerError) |
| }), |
| }, |
| CreateAudience: []gax.CallOption{ |
| gax.WithTimeout(60000 * time.Millisecond), |
| gax.WithRetry(func() gax.Retryer { |
| return gax.OnHTTPCodes(gax.Backoff{ |
| Initial: 1000 * time.Millisecond, |
| Max: 60000 * time.Millisecond, |
| Multiplier: 1.30, |
| }, |
| http.StatusServiceUnavailable, |
| http.StatusInternalServerError) |
| }), |
| }, |
| UpdateAudience: []gax.CallOption{ |
| gax.WithTimeout(60000 * time.Millisecond), |
| gax.WithRetry(func() gax.Retryer { |
| return gax.OnHTTPCodes(gax.Backoff{ |
| Initial: 1000 * time.Millisecond, |
| Max: 60000 * time.Millisecond, |
| Multiplier: 1.30, |
| }, |
| http.StatusServiceUnavailable, |
| http.StatusInternalServerError) |
| }), |
| }, |
| ArchiveAudience: []gax.CallOption{ |
| gax.WithTimeout(60000 * time.Millisecond), |
| gax.WithRetry(func() gax.Retryer { |
| return gax.OnHTTPCodes(gax.Backoff{ |
| Initial: 1000 * time.Millisecond, |
| Max: 60000 * time.Millisecond, |
| Multiplier: 1.30, |
| }, |
| http.StatusServiceUnavailable, |
| http.StatusInternalServerError) |
| }), |
| }, |
| GetSearchAds360Link: []gax.CallOption{ |
| gax.WithTimeout(60000 * time.Millisecond), |
| gax.WithRetry(func() gax.Retryer { |
| return gax.OnHTTPCodes(gax.Backoff{ |
| Initial: 1000 * time.Millisecond, |
| Max: 60000 * time.Millisecond, |
| Multiplier: 1.30, |
| }, |
| http.StatusServiceUnavailable, |
| http.StatusInternalServerError) |
| }), |
| }, |
| ListSearchAds360Links: []gax.CallOption{ |
| gax.WithTimeout(60000 * time.Millisecond), |
| gax.WithRetry(func() gax.Retryer { |
| return gax.OnHTTPCodes(gax.Backoff{ |
| Initial: 1000 * time.Millisecond, |
| Max: 60000 * time.Millisecond, |
| Multiplier: 1.30, |
| }, |
| http.StatusServiceUnavailable, |
| http.StatusInternalServerError) |
| }), |
| }, |
| CreateSearchAds360Link: []gax.CallOption{ |
| gax.WithTimeout(60000 * time.Millisecond), |
| gax.WithRetry(func() gax.Retryer { |
| return gax.OnHTTPCodes(gax.Backoff{ |
| Initial: 1000 * time.Millisecond, |
| Max: 60000 * time.Millisecond, |
| Multiplier: 1.30, |
| }, |
| http.StatusServiceUnavailable, |
| http.StatusInternalServerError) |
| }), |
| }, |
| DeleteSearchAds360Link: []gax.CallOption{ |
| gax.WithTimeout(60000 * time.Millisecond), |
| gax.WithRetry(func() gax.Retryer { |
| return gax.OnHTTPCodes(gax.Backoff{ |
| Initial: 1000 * time.Millisecond, |
| Max: 60000 * time.Millisecond, |
| Multiplier: 1.30, |
| }, |
| http.StatusServiceUnavailable, |
| http.StatusInternalServerError) |
| }), |
| }, |
| UpdateSearchAds360Link: []gax.CallOption{ |
| gax.WithTimeout(60000 * time.Millisecond), |
| gax.WithRetry(func() gax.Retryer { |
| return gax.OnHTTPCodes(gax.Backoff{ |
| Initial: 1000 * time.Millisecond, |
| Max: 60000 * time.Millisecond, |
| Multiplier: 1.30, |
| }, |
| http.StatusServiceUnavailable, |
| http.StatusInternalServerError) |
| }), |
| }, |
| GetAttributionSettings: []gax.CallOption{ |
| gax.WithTimeout(60000 * time.Millisecond), |
| gax.WithRetry(func() gax.Retryer { |
| return gax.OnHTTPCodes(gax.Backoff{ |
| Initial: 1000 * time.Millisecond, |
| Max: 60000 * time.Millisecond, |
| Multiplier: 1.30, |
| }, |
| http.StatusServiceUnavailable, |
| http.StatusInternalServerError) |
| }), |
| }, |
| UpdateAttributionSettings: []gax.CallOption{ |
| gax.WithTimeout(60000 * time.Millisecond), |
| gax.WithRetry(func() gax.Retryer { |
| return gax.OnHTTPCodes(gax.Backoff{ |
| Initial: 1000 * time.Millisecond, |
| Max: 60000 * time.Millisecond, |
| Multiplier: 1.30, |
| }, |
| http.StatusServiceUnavailable, |
| http.StatusInternalServerError) |
| }), |
| }, |
| RunAccessReport: []gax.CallOption{ |
| gax.WithTimeout(60000 * time.Millisecond), |
| gax.WithRetry(func() gax.Retryer { |
| return gax.OnHTTPCodes(gax.Backoff{ |
| Initial: 1000 * time.Millisecond, |
| Max: 60000 * time.Millisecond, |
| Multiplier: 1.30, |
| }, |
| http.StatusServiceUnavailable, |
| http.StatusInternalServerError) |
| }), |
| }, |
| CreateAccessBinding: []gax.CallOption{ |
| gax.WithTimeout(60000 * time.Millisecond), |
| gax.WithRetry(func() gax.Retryer { |
| return gax.OnHTTPCodes(gax.Backoff{ |
| Initial: 1000 * time.Millisecond, |
| Max: 60000 * time.Millisecond, |
| Multiplier: 1.30, |
| }, |
| http.StatusServiceUnavailable, |
| http.StatusInternalServerError) |
| }), |
| }, |
| GetAccessBinding: []gax.CallOption{ |
| gax.WithTimeout(60000 * time.Millisecond), |
| gax.WithRetry(func() gax.Retryer { |
| return gax.OnHTTPCodes(gax.Backoff{ |
| Initial: 1000 * time.Millisecond, |
| Max: 60000 * time.Millisecond, |
| Multiplier: 1.30, |
| }, |
| http.StatusServiceUnavailable, |
| http.StatusInternalServerError) |
| }), |
| }, |
| UpdateAccessBinding: []gax.CallOption{ |
| gax.WithTimeout(60000 * time.Millisecond), |
| gax.WithRetry(func() gax.Retryer { |
| return gax.OnHTTPCodes(gax.Backoff{ |
| Initial: 1000 * time.Millisecond, |
| Max: 60000 * time.Millisecond, |
| Multiplier: 1.30, |
| }, |
| http.StatusServiceUnavailable, |
| http.StatusInternalServerError) |
| }), |
| }, |
| DeleteAccessBinding: []gax.CallOption{ |
| gax.WithTimeout(60000 * time.Millisecond), |
| gax.WithRetry(func() gax.Retryer { |
| return gax.OnHTTPCodes(gax.Backoff{ |
| Initial: 1000 * time.Millisecond, |
| Max: 60000 * time.Millisecond, |
| Multiplier: 1.30, |
| }, |
| http.StatusServiceUnavailable, |
| http.StatusInternalServerError) |
| }), |
| }, |
| ListAccessBindings: []gax.CallOption{ |
| gax.WithTimeout(60000 * time.Millisecond), |
| gax.WithRetry(func() gax.Retryer { |
| return gax.OnHTTPCodes(gax.Backoff{ |
| Initial: 1000 * time.Millisecond, |
| Max: 60000 * time.Millisecond, |
| Multiplier: 1.30, |
| }, |
| http.StatusServiceUnavailable, |
| http.StatusInternalServerError) |
| }), |
| }, |
| BatchCreateAccessBindings: []gax.CallOption{ |
| gax.WithTimeout(60000 * time.Millisecond), |
| gax.WithRetry(func() gax.Retryer { |
| return gax.OnHTTPCodes(gax.Backoff{ |
| Initial: 1000 * time.Millisecond, |
| Max: 60000 * time.Millisecond, |
| Multiplier: 1.30, |
| }, |
| http.StatusServiceUnavailable, |
| http.StatusInternalServerError) |
| }), |
| }, |
| BatchGetAccessBindings: []gax.CallOption{ |
| gax.WithTimeout(60000 * time.Millisecond), |
| gax.WithRetry(func() gax.Retryer { |
| return gax.OnHTTPCodes(gax.Backoff{ |
| Initial: 1000 * time.Millisecond, |
| Max: 60000 * time.Millisecond, |
| Multiplier: 1.30, |
| }, |
| http.StatusServiceUnavailable, |
| http.StatusInternalServerError) |
| }), |
| }, |
| BatchUpdateAccessBindings: []gax.CallOption{ |
| gax.WithTimeout(60000 * time.Millisecond), |
| gax.WithRetry(func() gax.Retryer { |
| return gax.OnHTTPCodes(gax.Backoff{ |
| Initial: 1000 * time.Millisecond, |
| Max: 60000 * time.Millisecond, |
| Multiplier: 1.30, |
| }, |
| http.StatusServiceUnavailable, |
| http.StatusInternalServerError) |
| }), |
| }, |
| BatchDeleteAccessBindings: []gax.CallOption{ |
| gax.WithTimeout(60000 * time.Millisecond), |
| gax.WithRetry(func() gax.Retryer { |
| return gax.OnHTTPCodes(gax.Backoff{ |
| Initial: 1000 * time.Millisecond, |
| Max: 60000 * time.Millisecond, |
| Multiplier: 1.30, |
| }, |
| http.StatusServiceUnavailable, |
| http.StatusInternalServerError) |
| }), |
| }, |
| GetExpandedDataSet: []gax.CallOption{ |
| gax.WithTimeout(60000 * time.Millisecond), |
| gax.WithRetry(func() gax.Retryer { |
| return gax.OnHTTPCodes(gax.Backoff{ |
| Initial: 1000 * time.Millisecond, |
| Max: 60000 * time.Millisecond, |
| Multiplier: 1.30, |
| }, |
| http.StatusServiceUnavailable, |
| http.StatusInternalServerError) |
| }), |
| }, |
| ListExpandedDataSets: []gax.CallOption{ |
| gax.WithTimeout(60000 * time.Millisecond), |
| gax.WithRetry(func() gax.Retryer { |
| return gax.OnHTTPCodes(gax.Backoff{ |
| Initial: 1000 * time.Millisecond, |
| Max: 60000 * time.Millisecond, |
| Multiplier: 1.30, |
| }, |
| http.StatusServiceUnavailable, |
| http.StatusInternalServerError) |
| }), |
| }, |
| CreateExpandedDataSet: []gax.CallOption{ |
| gax.WithTimeout(60000 * time.Millisecond), |
| gax.WithRetry(func() gax.Retryer { |
| return gax.OnHTTPCodes(gax.Backoff{ |
| Initial: 1000 * time.Millisecond, |
| Max: 60000 * time.Millisecond, |
| Multiplier: 1.30, |
| }, |
| http.StatusServiceUnavailable, |
| http.StatusInternalServerError) |
| }), |
| }, |
| UpdateExpandedDataSet: []gax.CallOption{ |
| gax.WithTimeout(60000 * time.Millisecond), |
| gax.WithRetry(func() gax.Retryer { |
| return gax.OnHTTPCodes(gax.Backoff{ |
| Initial: 1000 * time.Millisecond, |
| Max: 60000 * time.Millisecond, |
| Multiplier: 1.30, |
| }, |
| http.StatusServiceUnavailable, |
| http.StatusInternalServerError) |
| }), |
| }, |
| DeleteExpandedDataSet: []gax.CallOption{ |
| gax.WithTimeout(60000 * time.Millisecond), |
| gax.WithRetry(func() gax.Retryer { |
| return gax.OnHTTPCodes(gax.Backoff{ |
| Initial: 1000 * time.Millisecond, |
| Max: 60000 * time.Millisecond, |
| Multiplier: 1.30, |
| }, |
| http.StatusServiceUnavailable, |
| http.StatusInternalServerError) |
| }), |
| }, |
| GetChannelGroup: []gax.CallOption{ |
| gax.WithTimeout(60000 * time.Millisecond), |
| gax.WithRetry(func() gax.Retryer { |
| return gax.OnHTTPCodes(gax.Backoff{ |
| Initial: 1000 * time.Millisecond, |
| Max: 60000 * time.Millisecond, |
| Multiplier: 1.30, |
| }, |
| http.StatusServiceUnavailable, |
| http.StatusInternalServerError) |
| }), |
| }, |
| ListChannelGroups: []gax.CallOption{ |
| gax.WithTimeout(60000 * time.Millisecond), |
| gax.WithRetry(func() gax.Retryer { |
| return gax.OnHTTPCodes(gax.Backoff{ |
| Initial: 1000 * time.Millisecond, |
| Max: 60000 * time.Millisecond, |
| Multiplier: 1.30, |
| }, |
| http.StatusServiceUnavailable, |
| http.StatusInternalServerError) |
| }), |
| }, |
| CreateChannelGroup: []gax.CallOption{ |
| gax.WithTimeout(60000 * time.Millisecond), |
| gax.WithRetry(func() gax.Retryer { |
| return gax.OnHTTPCodes(gax.Backoff{ |
| Initial: 1000 * time.Millisecond, |
| Max: 60000 * time.Millisecond, |
| Multiplier: 1.30, |
| }, |
| http.StatusServiceUnavailable, |
| http.StatusInternalServerError) |
| }), |
| }, |
| UpdateChannelGroup: []gax.CallOption{ |
| gax.WithTimeout(60000 * time.Millisecond), |
| gax.WithRetry(func() gax.Retryer { |
| return gax.OnHTTPCodes(gax.Backoff{ |
| Initial: 1000 * time.Millisecond, |
| Max: 60000 * time.Millisecond, |
| Multiplier: 1.30, |
| }, |
| http.StatusServiceUnavailable, |
| http.StatusInternalServerError) |
| }), |
| }, |
| DeleteChannelGroup: []gax.CallOption{ |
| gax.WithTimeout(60000 * time.Millisecond), |
| gax.WithRetry(func() gax.Retryer { |
| return gax.OnHTTPCodes(gax.Backoff{ |
| Initial: 1000 * time.Millisecond, |
| Max: 60000 * time.Millisecond, |
| Multiplier: 1.30, |
| }, |
| http.StatusServiceUnavailable, |
| http.StatusInternalServerError) |
| }), |
| }, |
| SetAutomatedGa4ConfigurationOptOut: []gax.CallOption{ |
| gax.WithTimeout(60000 * time.Millisecond), |
| gax.WithRetry(func() gax.Retryer { |
| return gax.OnHTTPCodes(gax.Backoff{ |
| Initial: 1000 * time.Millisecond, |
| Max: 60000 * time.Millisecond, |
| Multiplier: 1.30, |
| }, |
| http.StatusServiceUnavailable, |
| http.StatusInternalServerError) |
| }), |
| }, |
| FetchAutomatedGa4ConfigurationOptOut: []gax.CallOption{ |
| gax.WithTimeout(60000 * time.Millisecond), |
| gax.WithRetry(func() gax.Retryer { |
| return gax.OnHTTPCodes(gax.Backoff{ |
| Initial: 1000 * time.Millisecond, |
| Max: 60000 * time.Millisecond, |
| Multiplier: 1.30, |
| }, |
| http.StatusServiceUnavailable, |
| http.StatusInternalServerError) |
| }), |
| }, |
| GetBigQueryLink: []gax.CallOption{ |
| gax.WithTimeout(60000 * time.Millisecond), |
| gax.WithRetry(func() gax.Retryer { |
| return gax.OnHTTPCodes(gax.Backoff{ |
| Initial: 1000 * time.Millisecond, |
| Max: 60000 * time.Millisecond, |
| Multiplier: 1.30, |
| }, |
| http.StatusServiceUnavailable, |
| http.StatusInternalServerError) |
| }), |
| }, |
| ListBigQueryLinks: []gax.CallOption{ |
| gax.WithTimeout(60000 * time.Millisecond), |
| gax.WithRetry(func() gax.Retryer { |
| return gax.OnHTTPCodes(gax.Backoff{ |
| Initial: 1000 * time.Millisecond, |
| Max: 60000 * time.Millisecond, |
| Multiplier: 1.30, |
| }, |
| http.StatusServiceUnavailable, |
| http.StatusInternalServerError) |
| }), |
| }, |
| GetEnhancedMeasurementSettings: []gax.CallOption{ |
| gax.WithTimeout(60000 * time.Millisecond), |
| }, |
| UpdateEnhancedMeasurementSettings: []gax.CallOption{ |
| gax.WithTimeout(60000 * time.Millisecond), |
| }, |
| CreateConnectedSiteTag: []gax.CallOption{ |
| gax.WithTimeout(60000 * time.Millisecond), |
| gax.WithRetry(func() gax.Retryer { |
| return gax.OnHTTPCodes(gax.Backoff{ |
| Initial: 1000 * time.Millisecond, |
| Max: 60000 * time.Millisecond, |
| Multiplier: 1.30, |
| }, |
| http.StatusServiceUnavailable, |
| http.StatusInternalServerError) |
| }), |
| }, |
| DeleteConnectedSiteTag: []gax.CallOption{ |
| gax.WithTimeout(60000 * time.Millisecond), |
| gax.WithRetry(func() gax.Retryer { |
| return gax.OnHTTPCodes(gax.Backoff{ |
| Initial: 1000 * time.Millisecond, |
| Max: 60000 * time.Millisecond, |
| Multiplier: 1.30, |
| }, |
| http.StatusServiceUnavailable, |
| http.StatusInternalServerError) |
| }), |
| }, |
| ListConnectedSiteTags: []gax.CallOption{ |
| gax.WithTimeout(60000 * time.Millisecond), |
| gax.WithRetry(func() gax.Retryer { |
| return gax.OnHTTPCodes(gax.Backoff{ |
| Initial: 1000 * time.Millisecond, |
| Max: 60000 * time.Millisecond, |
| Multiplier: 1.30, |
| }, |
| http.StatusServiceUnavailable, |
| http.StatusInternalServerError) |
| }), |
| }, |
| FetchConnectedGa4Property: []gax.CallOption{ |
| gax.WithTimeout(60000 * time.Millisecond), |
| gax.WithRetry(func() gax.Retryer { |
| return gax.OnHTTPCodes(gax.Backoff{ |
| Initial: 1000 * time.Millisecond, |
| Max: 60000 * time.Millisecond, |
| Multiplier: 1.30, |
| }, |
| http.StatusServiceUnavailable, |
| http.StatusInternalServerError) |
| }), |
| }, |
| GetAdSenseLink: []gax.CallOption{ |
| gax.WithTimeout(60000 * time.Millisecond), |
| gax.WithRetry(func() gax.Retryer { |
| return gax.OnHTTPCodes(gax.Backoff{ |
| Initial: 1000 * time.Millisecond, |
| Max: 60000 * time.Millisecond, |
| Multiplier: 1.30, |
| }, |
| http.StatusServiceUnavailable, |
| http.StatusInternalServerError) |
| }), |
| }, |
| CreateAdSenseLink: []gax.CallOption{ |
| gax.WithTimeout(60000 * time.Millisecond), |
| gax.WithRetry(func() gax.Retryer { |
| return gax.OnHTTPCodes(gax.Backoff{ |
| Initial: 1000 * time.Millisecond, |
| Max: 60000 * time.Millisecond, |
| Multiplier: 1.30, |
| }, |
| http.StatusServiceUnavailable, |
| http.StatusInternalServerError) |
| }), |
| }, |
| DeleteAdSenseLink: []gax.CallOption{ |
| gax.WithTimeout(60000 * time.Millisecond), |
| gax.WithRetry(func() gax.Retryer { |
| return gax.OnHTTPCodes(gax.Backoff{ |
| Initial: 1000 * time.Millisecond, |
| Max: 60000 * time.Millisecond, |
| Multiplier: 1.30, |
| }, |
| http.StatusServiceUnavailable, |
| http.StatusInternalServerError) |
| }), |
| }, |
| ListAdSenseLinks: []gax.CallOption{ |
| gax.WithTimeout(60000 * time.Millisecond), |
| gax.WithRetry(func() gax.Retryer { |
| return gax.OnHTTPCodes(gax.Backoff{ |
| Initial: 1000 * time.Millisecond, |
| Max: 60000 * time.Millisecond, |
| Multiplier: 1.30, |
| }, |
| http.StatusServiceUnavailable, |
| http.StatusInternalServerError) |
| }), |
| }, |
| GetEventCreateRule: []gax.CallOption{ |
| gax.WithTimeout(60000 * time.Millisecond), |
| gax.WithRetry(func() gax.Retryer { |
| return gax.OnHTTPCodes(gax.Backoff{ |
| Initial: 1000 * time.Millisecond, |
| Max: 60000 * time.Millisecond, |
| Multiplier: 1.30, |
| }, |
| http.StatusServiceUnavailable, |
| http.StatusInternalServerError) |
| }), |
| }, |
| ListEventCreateRules: []gax.CallOption{ |
| gax.WithTimeout(60000 * time.Millisecond), |
| gax.WithRetry(func() gax.Retryer { |
| return gax.OnHTTPCodes(gax.Backoff{ |
| Initial: 1000 * time.Millisecond, |
| Max: 60000 * time.Millisecond, |
| Multiplier: 1.30, |
| }, |
| http.StatusServiceUnavailable, |
| http.StatusInternalServerError) |
| }), |
| }, |
| CreateEventCreateRule: []gax.CallOption{ |
| gax.WithTimeout(60000 * time.Millisecond), |
| gax.WithRetry(func() gax.Retryer { |
| return gax.OnHTTPCodes(gax.Backoff{ |
| Initial: 1000 * time.Millisecond, |
| Max: 60000 * time.Millisecond, |
| Multiplier: 1.30, |
| }, |
| http.StatusServiceUnavailable, |
| http.StatusInternalServerError) |
| }), |
| }, |
| UpdateEventCreateRule: []gax.CallOption{ |
| gax.WithTimeout(60000 * time.Millisecond), |
| gax.WithRetry(func() gax.Retryer { |
| return gax.OnHTTPCodes(gax.Backoff{ |
| Initial: 1000 * time.Millisecond, |
| Max: 60000 * time.Millisecond, |
| Multiplier: 1.30, |
| }, |
| http.StatusServiceUnavailable, |
| http.StatusInternalServerError) |
| }), |
| }, |
| DeleteEventCreateRule: []gax.CallOption{ |
| gax.WithTimeout(60000 * time.Millisecond), |
| gax.WithRetry(func() gax.Retryer { |
| return gax.OnHTTPCodes(gax.Backoff{ |
| Initial: 1000 * time.Millisecond, |
| Max: 60000 * time.Millisecond, |
| Multiplier: 1.30, |
| }, |
| http.StatusServiceUnavailable, |
| http.StatusInternalServerError) |
| }), |
| }, |
| UpdateDataRedactionSettings: []gax.CallOption{ |
| gax.WithTimeout(60000 * time.Millisecond), |
| gax.WithRetry(func() gax.Retryer { |
| return gax.OnHTTPCodes(gax.Backoff{ |
| Initial: 1000 * time.Millisecond, |
| Max: 60000 * time.Millisecond, |
| Multiplier: 1.30, |
| }, |
| http.StatusServiceUnavailable, |
| http.StatusInternalServerError) |
| }), |
| }, |
| GetDataRedactionSettings: []gax.CallOption{ |
| gax.WithTimeout(60000 * time.Millisecond), |
| gax.WithRetry(func() gax.Retryer { |
| return gax.OnHTTPCodes(gax.Backoff{ |
| Initial: 1000 * time.Millisecond, |
| Max: 60000 * time.Millisecond, |
| Multiplier: 1.30, |
| }, |
| http.StatusServiceUnavailable, |
| http.StatusInternalServerError) |
| }), |
| }, |
| GetCalculatedMetric: []gax.CallOption{ |
| gax.WithTimeout(60000 * time.Millisecond), |
| gax.WithRetry(func() gax.Retryer { |
| return gax.OnHTTPCodes(gax.Backoff{ |
| Initial: 1000 * time.Millisecond, |
| Max: 60000 * time.Millisecond, |
| Multiplier: 1.30, |
| }, |
| http.StatusServiceUnavailable, |
| http.StatusInternalServerError) |
| }), |
| }, |
| CreateCalculatedMetric: []gax.CallOption{ |
| gax.WithTimeout(60000 * time.Millisecond), |
| gax.WithRetry(func() gax.Retryer { |
| return gax.OnHTTPCodes(gax.Backoff{ |
| Initial: 1000 * time.Millisecond, |
| Max: 60000 * time.Millisecond, |
| Multiplier: 1.30, |
| }, |
| http.StatusServiceUnavailable, |
| http.StatusInternalServerError) |
| }), |
| }, |
| ListCalculatedMetrics: []gax.CallOption{ |
| gax.WithTimeout(60000 * time.Millisecond), |
| gax.WithRetry(func() gax.Retryer { |
| return gax.OnHTTPCodes(gax.Backoff{ |
| Initial: 1000 * time.Millisecond, |
| Max: 60000 * time.Millisecond, |
| Multiplier: 1.30, |
| }, |
| http.StatusServiceUnavailable, |
| http.StatusInternalServerError) |
| }), |
| }, |
| UpdateCalculatedMetric: []gax.CallOption{ |
| gax.WithTimeout(60000 * time.Millisecond), |
| gax.WithRetry(func() gax.Retryer { |
| return gax.OnHTTPCodes(gax.Backoff{ |
| Initial: 1000 * time.Millisecond, |
| Max: 60000 * time.Millisecond, |
| Multiplier: 1.30, |
| }, |
| http.StatusServiceUnavailable, |
| http.StatusInternalServerError) |
| }), |
| }, |
| DeleteCalculatedMetric: []gax.CallOption{ |
| gax.WithTimeout(60000 * time.Millisecond), |
| gax.WithRetry(func() gax.Retryer { |
| return gax.OnHTTPCodes(gax.Backoff{ |
| Initial: 1000 * time.Millisecond, |
| Max: 60000 * time.Millisecond, |
| Multiplier: 1.30, |
| }, |
| http.StatusServiceUnavailable, |
| http.StatusInternalServerError) |
| }), |
| }, |
| CreateRollupProperty: []gax.CallOption{ |
| gax.WithTimeout(60000 * time.Millisecond), |
| gax.WithRetry(func() gax.Retryer { |
| return gax.OnHTTPCodes(gax.Backoff{ |
| Initial: 1000 * time.Millisecond, |
| Max: 60000 * time.Millisecond, |
| Multiplier: 1.30, |
| }, |
| http.StatusServiceUnavailable, |
| http.StatusInternalServerError) |
| }), |
| }, |
| GetRollupPropertySourceLink: []gax.CallOption{ |
| gax.WithTimeout(60000 * time.Millisecond), |
| gax.WithRetry(func() gax.Retryer { |
| return gax.OnHTTPCodes(gax.Backoff{ |
| Initial: 1000 * time.Millisecond, |
| Max: 60000 * time.Millisecond, |
| Multiplier: 1.30, |
| }, |
| http.StatusServiceUnavailable, |
| http.StatusInternalServerError) |
| }), |
| }, |
| ListRollupPropertySourceLinks: []gax.CallOption{ |
| gax.WithTimeout(60000 * time.Millisecond), |
| gax.WithRetry(func() gax.Retryer { |
| return gax.OnHTTPCodes(gax.Backoff{ |
| Initial: 1000 * time.Millisecond, |
| Max: 60000 * time.Millisecond, |
| Multiplier: 1.30, |
| }, |
| http.StatusServiceUnavailable, |
| http.StatusInternalServerError) |
| }), |
| }, |
| CreateRollupPropertySourceLink: []gax.CallOption{ |
| gax.WithTimeout(60000 * time.Millisecond), |
| gax.WithRetry(func() gax.Retryer { |
| return gax.OnHTTPCodes(gax.Backoff{ |
| Initial: 1000 * time.Millisecond, |
| Max: 60000 * time.Millisecond, |
| Multiplier: 1.30, |
| }, |
| http.StatusServiceUnavailable, |
| http.StatusInternalServerError) |
| }), |
| }, |
| DeleteRollupPropertySourceLink: []gax.CallOption{ |
| gax.WithTimeout(60000 * time.Millisecond), |
| gax.WithRetry(func() gax.Retryer { |
| return gax.OnHTTPCodes(gax.Backoff{ |
| Initial: 1000 * time.Millisecond, |
| Max: 60000 * time.Millisecond, |
| Multiplier: 1.30, |
| }, |
| http.StatusServiceUnavailable, |
| http.StatusInternalServerError) |
| }), |
| }, |
| CreateSubproperty: []gax.CallOption{ |
| gax.WithTimeout(60000 * time.Millisecond), |
| gax.WithRetry(func() gax.Retryer { |
| return gax.OnHTTPCodes(gax.Backoff{ |
| Initial: 1000 * time.Millisecond, |
| Max: 60000 * time.Millisecond, |
| Multiplier: 1.30, |
| }, |
| http.StatusServiceUnavailable, |
| http.StatusInternalServerError) |
| }), |
| }, |
| CreateSubpropertyEventFilter: []gax.CallOption{ |
| gax.WithTimeout(60000 * time.Millisecond), |
| gax.WithRetry(func() gax.Retryer { |
| return gax.OnHTTPCodes(gax.Backoff{ |
| Initial: 1000 * time.Millisecond, |
| Max: 60000 * time.Millisecond, |
| Multiplier: 1.30, |
| }, |
| http.StatusServiceUnavailable, |
| http.StatusInternalServerError) |
| }), |
| }, |
| GetSubpropertyEventFilter: []gax.CallOption{ |
| gax.WithTimeout(60000 * time.Millisecond), |
| gax.WithRetry(func() gax.Retryer { |
| return gax.OnHTTPCodes(gax.Backoff{ |
| Initial: 1000 * time.Millisecond, |
| Max: 60000 * time.Millisecond, |
| Multiplier: 1.30, |
| }, |
| http.StatusServiceUnavailable, |
| http.StatusInternalServerError) |
| }), |
| }, |
| ListSubpropertyEventFilters: []gax.CallOption{ |
| gax.WithTimeout(60000 * time.Millisecond), |
| gax.WithRetry(func() gax.Retryer { |
| return gax.OnHTTPCodes(gax.Backoff{ |
| Initial: 1000 * time.Millisecond, |
| Max: 60000 * time.Millisecond, |
| Multiplier: 1.30, |
| }, |
| http.StatusServiceUnavailable, |
| http.StatusInternalServerError) |
| }), |
| }, |
| UpdateSubpropertyEventFilter: []gax.CallOption{ |
| gax.WithTimeout(60000 * time.Millisecond), |
| gax.WithRetry(func() gax.Retryer { |
| return gax.OnHTTPCodes(gax.Backoff{ |
| Initial: 1000 * time.Millisecond, |
| Max: 60000 * time.Millisecond, |
| Multiplier: 1.30, |
| }, |
| http.StatusServiceUnavailable, |
| http.StatusInternalServerError) |
| }), |
| }, |
| DeleteSubpropertyEventFilter: []gax.CallOption{ |
| gax.WithTimeout(60000 * time.Millisecond), |
| gax.WithRetry(func() gax.Retryer { |
| return gax.OnHTTPCodes(gax.Backoff{ |
| Initial: 1000 * time.Millisecond, |
| Max: 60000 * time.Millisecond, |
| Multiplier: 1.30, |
| }, |
| http.StatusServiceUnavailable, |
| http.StatusInternalServerError) |
| }), |
| }, |
| } |
| } |
| |
| // internalAnalyticsAdminClient is an interface that defines the methods available from Google Analytics Admin API. |
| type internalAnalyticsAdminClient interface { |
| Close() error |
| setGoogleClientInfo(...string) |
| Connection() *grpc.ClientConn |
| GetAccount(context.Context, *adminpb.GetAccountRequest, ...gax.CallOption) (*adminpb.Account, error) |
| ListAccounts(context.Context, *adminpb.ListAccountsRequest, ...gax.CallOption) *AccountIterator |
| DeleteAccount(context.Context, *adminpb.DeleteAccountRequest, ...gax.CallOption) error |
| UpdateAccount(context.Context, *adminpb.UpdateAccountRequest, ...gax.CallOption) (*adminpb.Account, error) |
| ProvisionAccountTicket(context.Context, *adminpb.ProvisionAccountTicketRequest, ...gax.CallOption) (*adminpb.ProvisionAccountTicketResponse, error) |
| ListAccountSummaries(context.Context, *adminpb.ListAccountSummariesRequest, ...gax.CallOption) *AccountSummaryIterator |
| GetProperty(context.Context, *adminpb.GetPropertyRequest, ...gax.CallOption) (*adminpb.Property, error) |
| ListProperties(context.Context, *adminpb.ListPropertiesRequest, ...gax.CallOption) *PropertyIterator |
| CreateProperty(context.Context, *adminpb.CreatePropertyRequest, ...gax.CallOption) (*adminpb.Property, error) |
| DeleteProperty(context.Context, *adminpb.DeletePropertyRequest, ...gax.CallOption) (*adminpb.Property, error) |
| UpdateProperty(context.Context, *adminpb.UpdatePropertyRequest, ...gax.CallOption) (*adminpb.Property, error) |
| CreateFirebaseLink(context.Context, *adminpb.CreateFirebaseLinkRequest, ...gax.CallOption) (*adminpb.FirebaseLink, error) |
| DeleteFirebaseLink(context.Context, *adminpb.DeleteFirebaseLinkRequest, ...gax.CallOption) error |
| ListFirebaseLinks(context.Context, *adminpb.ListFirebaseLinksRequest, ...gax.CallOption) *FirebaseLinkIterator |
| GetGlobalSiteTag(context.Context, *adminpb.GetGlobalSiteTagRequest, ...gax.CallOption) (*adminpb.GlobalSiteTag, error) |
| CreateGoogleAdsLink(context.Context, *adminpb.CreateGoogleAdsLinkRequest, ...gax.CallOption) (*adminpb.GoogleAdsLink, error) |
| UpdateGoogleAdsLink(context.Context, *adminpb.UpdateGoogleAdsLinkRequest, ...gax.CallOption) (*adminpb.GoogleAdsLink, error) |
| DeleteGoogleAdsLink(context.Context, *adminpb.DeleteGoogleAdsLinkRequest, ...gax.CallOption) error |
| ListGoogleAdsLinks(context.Context, *adminpb.ListGoogleAdsLinksRequest, ...gax.CallOption) *GoogleAdsLinkIterator |
| GetDataSharingSettings(context.Context, *adminpb.GetDataSharingSettingsRequest, ...gax.CallOption) (*adminpb.DataSharingSettings, error) |
| GetMeasurementProtocolSecret(context.Context, *adminpb.GetMeasurementProtocolSecretRequest, ...gax.CallOption) (*adminpb.MeasurementProtocolSecret, error) |
| ListMeasurementProtocolSecrets(context.Context, *adminpb.ListMeasurementProtocolSecretsRequest, ...gax.CallOption) *MeasurementProtocolSecretIterator |
| CreateMeasurementProtocolSecret(context.Context, *adminpb.CreateMeasurementProtocolSecretRequest, ...gax.CallOption) (*adminpb.MeasurementProtocolSecret, error) |
| DeleteMeasurementProtocolSecret(context.Context, *adminpb.DeleteMeasurementProtocolSecretRequest, ...gax.CallOption) error |
| UpdateMeasurementProtocolSecret(context.Context, *adminpb.UpdateMeasurementProtocolSecretRequest, ...gax.CallOption) (*adminpb.MeasurementProtocolSecret, error) |
| AcknowledgeUserDataCollection(context.Context, *adminpb.AcknowledgeUserDataCollectionRequest, ...gax.CallOption) (*adminpb.AcknowledgeUserDataCollectionResponse, error) |
| GetSKAdNetworkConversionValueSchema(context.Context, *adminpb.GetSKAdNetworkConversionValueSchemaRequest, ...gax.CallOption) (*adminpb.SKAdNetworkConversionValueSchema, error) |
| CreateSKAdNetworkConversionValueSchema(context.Context, *adminpb.CreateSKAdNetworkConversionValueSchemaRequest, ...gax.CallOption) (*adminpb.SKAdNetworkConversionValueSchema, error) |
| DeleteSKAdNetworkConversionValueSchema(context.Context, *adminpb.DeleteSKAdNetworkConversionValueSchemaRequest, ...gax.CallOption) error |
| UpdateSKAdNetworkConversionValueSchema(context.Context, *adminpb.UpdateSKAdNetworkConversionValueSchemaRequest, ...gax.CallOption) (*adminpb.SKAdNetworkConversionValueSchema, error) |
| ListSKAdNetworkConversionValueSchemas(context.Context, *adminpb.ListSKAdNetworkConversionValueSchemasRequest, ...gax.CallOption) *SKAdNetworkConversionValueSchemaIterator |
| SearchChangeHistoryEvents(context.Context, *adminpb.SearchChangeHistoryEventsRequest, ...gax.CallOption) *ChangeHistoryEventIterator |
| GetGoogleSignalsSettings(context.Context, *adminpb.GetGoogleSignalsSettingsRequest, ...gax.CallOption) (*adminpb.GoogleSignalsSettings, error) |
| UpdateGoogleSignalsSettings(context.Context, *adminpb.UpdateGoogleSignalsSettingsRequest, ...gax.CallOption) (*adminpb.GoogleSignalsSettings, error) |
| CreateConversionEvent(context.Context, *adminpb.CreateConversionEventRequest, ...gax.CallOption) (*adminpb.ConversionEvent, error) |
| UpdateConversionEvent(context.Context, *adminpb.UpdateConversionEventRequest, ...gax.CallOption) (*adminpb.ConversionEvent, error) |
| GetConversionEvent(context.Context, *adminpb.GetConversionEventRequest, ...gax.CallOption) (*adminpb.ConversionEvent, error) |
| DeleteConversionEvent(context.Context, *adminpb.DeleteConversionEventRequest, ...gax.CallOption) error |
| ListConversionEvents(context.Context, *adminpb.ListConversionEventsRequest, ...gax.CallOption) *ConversionEventIterator |
| GetDisplayVideo360AdvertiserLink(context.Context, *adminpb.GetDisplayVideo360AdvertiserLinkRequest, ...gax.CallOption) (*adminpb.DisplayVideo360AdvertiserLink, error) |
| ListDisplayVideo360AdvertiserLinks(context.Context, *adminpb.ListDisplayVideo360AdvertiserLinksRequest, ...gax.CallOption) *DisplayVideo360AdvertiserLinkIterator |
| CreateDisplayVideo360AdvertiserLink(context.Context, *adminpb.CreateDisplayVideo360AdvertiserLinkRequest, ...gax.CallOption) (*adminpb.DisplayVideo360AdvertiserLink, error) |
| DeleteDisplayVideo360AdvertiserLink(context.Context, *adminpb.DeleteDisplayVideo360AdvertiserLinkRequest, ...gax.CallOption) error |
| UpdateDisplayVideo360AdvertiserLink(context.Context, *adminpb.UpdateDisplayVideo360AdvertiserLinkRequest, ...gax.CallOption) (*adminpb.DisplayVideo360AdvertiserLink, error) |
| GetDisplayVideo360AdvertiserLinkProposal(context.Context, *adminpb.GetDisplayVideo360AdvertiserLinkProposalRequest, ...gax.CallOption) (*adminpb.DisplayVideo360AdvertiserLinkProposal, error) |
| ListDisplayVideo360AdvertiserLinkProposals(context.Context, *adminpb.ListDisplayVideo360AdvertiserLinkProposalsRequest, ...gax.CallOption) *DisplayVideo360AdvertiserLinkProposalIterator |
| CreateDisplayVideo360AdvertiserLinkProposal(context.Context, *adminpb.CreateDisplayVideo360AdvertiserLinkProposalRequest, ...gax.CallOption) (*adminpb.DisplayVideo360AdvertiserLinkProposal, error) |
| DeleteDisplayVideo360AdvertiserLinkProposal(context.Context, *adminpb.DeleteDisplayVideo360AdvertiserLinkProposalRequest, ...gax.CallOption) error |
| ApproveDisplayVideo360AdvertiserLinkProposal(context.Context, *adminpb.ApproveDisplayVideo360AdvertiserLinkProposalRequest, ...gax.CallOption) (*adminpb.ApproveDisplayVideo360AdvertiserLinkProposalResponse, error) |
| CancelDisplayVideo360AdvertiserLinkProposal(context.Context, *adminpb.CancelDisplayVideo360AdvertiserLinkProposalRequest, ...gax.CallOption) (*adminpb.DisplayVideo360AdvertiserLinkProposal, error) |
| CreateCustomDimension(context.Context, *adminpb.CreateCustomDimensionRequest, ...gax.CallOption) (*adminpb.CustomDimension, error) |
| UpdateCustomDimension(context.Context, *adminpb.UpdateCustomDimensionRequest, ...gax.CallOption) (*adminpb.CustomDimension, error) |
| ListCustomDimensions(context.Context, *adminpb.ListCustomDimensionsRequest, ...gax.CallOption) *CustomDimensionIterator |
| ArchiveCustomDimension(context.Context, *adminpb.ArchiveCustomDimensionRequest, ...gax.CallOption) error |
| GetCustomDimension(context.Context, *adminpb.GetCustomDimensionRequest, ...gax.CallOption) (*adminpb.CustomDimension, error) |
| CreateCustomMetric(context.Context, *adminpb.CreateCustomMetricRequest, ...gax.CallOption) (*adminpb.CustomMetric, error) |
| UpdateCustomMetric(context.Context, *adminpb.UpdateCustomMetricRequest, ...gax.CallOption) (*adminpb.CustomMetric, error) |
| ListCustomMetrics(context.Context, *adminpb.ListCustomMetricsRequest, ...gax.CallOption) *CustomMetricIterator |
| ArchiveCustomMetric(context.Context, *adminpb.ArchiveCustomMetricRequest, ...gax.CallOption) error |
| GetCustomMetric(context.Context, *adminpb.GetCustomMetricRequest, ...gax.CallOption) (*adminpb.CustomMetric, error) |
| GetDataRetentionSettings(context.Context, *adminpb.GetDataRetentionSettingsRequest, ...gax.CallOption) (*adminpb.DataRetentionSettings, error) |
| UpdateDataRetentionSettings(context.Context, *adminpb.UpdateDataRetentionSettingsRequest, ...gax.CallOption) (*adminpb.DataRetentionSettings, error) |
| CreateDataStream(context.Context, *adminpb.CreateDataStreamRequest, ...gax.CallOption) (*adminpb.DataStream, error) |
| DeleteDataStream(context.Context, *adminpb.DeleteDataStreamRequest, ...gax.CallOption) error |
| UpdateDataStream(context.Context, *adminpb.UpdateDataStreamRequest, ...gax.CallOption) (*adminpb.DataStream, error) |
| ListDataStreams(context.Context, *adminpb.ListDataStreamsRequest, ...gax.CallOption) *DataStreamIterator |
| GetDataStream(context.Context, *adminpb.GetDataStreamRequest, ...gax.CallOption) (*adminpb.DataStream, error) |
| GetAudience(context.Context, *adminpb.GetAudienceRequest, ...gax.CallOption) (*adminpb.Audience, error) |
| ListAudiences(context.Context, *adminpb.ListAudiencesRequest, ...gax.CallOption) *AudienceIterator |
| CreateAudience(context.Context, *adminpb.CreateAudienceRequest, ...gax.CallOption) (*adminpb.Audience, error) |
| UpdateAudience(context.Context, *adminpb.UpdateAudienceRequest, ...gax.CallOption) (*adminpb.Audience, error) |
| ArchiveAudience(context.Context, *adminpb.ArchiveAudienceRequest, ...gax.CallOption) error |
| GetSearchAds360Link(context.Context, *adminpb.GetSearchAds360LinkRequest, ...gax.CallOption) (*adminpb.SearchAds360Link, error) |
| ListSearchAds360Links(context.Context, *adminpb.ListSearchAds360LinksRequest, ...gax.CallOption) *SearchAds360LinkIterator |
| CreateSearchAds360Link(context.Context, *adminpb.CreateSearchAds360LinkRequest, ...gax.CallOption) (*adminpb.SearchAds360Link, error) |
| DeleteSearchAds360Link(context.Context, *adminpb.DeleteSearchAds360LinkRequest, ...gax.CallOption) error |
| UpdateSearchAds360Link(context.Context, *adminpb.UpdateSearchAds360LinkRequest, ...gax.CallOption) (*adminpb.SearchAds360Link, error) |
| GetAttributionSettings(context.Context, *adminpb.GetAttributionSettingsRequest, ...gax.CallOption) (*adminpb.AttributionSettings, error) |
| UpdateAttributionSettings(context.Context, *adminpb.UpdateAttributionSettingsRequest, ...gax.CallOption) (*adminpb.AttributionSettings, error) |
| RunAccessReport(context.Context, *adminpb.RunAccessReportRequest, ...gax.CallOption) (*adminpb.RunAccessReportResponse, error) |
| CreateAccessBinding(context.Context, *adminpb.CreateAccessBindingRequest, ...gax.CallOption) (*adminpb.AccessBinding, error) |
| GetAccessBinding(context.Context, *adminpb.GetAccessBindingRequest, ...gax.CallOption) (*adminpb.AccessBinding, error) |
| UpdateAccessBinding(context.Context, *adminpb.UpdateAccessBindingRequest, ...gax.CallOption) (*adminpb.AccessBinding, error) |
| DeleteAccessBinding(context.Context, *adminpb.DeleteAccessBindingRequest, ...gax.CallOption) error |
| ListAccessBindings(context.Context, *adminpb.ListAccessBindingsRequest, ...gax.CallOption) *AccessBindingIterator |
| BatchCreateAccessBindings(context.Context, *adminpb.BatchCreateAccessBindingsRequest, ...gax.CallOption) (*adminpb.BatchCreateAccessBindingsResponse, error) |
| BatchGetAccessBindings(context.Context, *adminpb.BatchGetAccessBindingsRequest, ...gax.CallOption) (*adminpb.BatchGetAccessBindingsResponse, error) |
| BatchUpdateAccessBindings(context.Context, *adminpb.BatchUpdateAccessBindingsRequest, ...gax.CallOption) (*adminpb.BatchUpdateAccessBindingsResponse, error) |
| BatchDeleteAccessBindings(context.Context, *adminpb.BatchDeleteAccessBindingsRequest, ...gax.CallOption) error |
| GetExpandedDataSet(context.Context, *adminpb.GetExpandedDataSetRequest, ...gax.CallOption) (*adminpb.ExpandedDataSet, error) |
| ListExpandedDataSets(context.Context, *adminpb.ListExpandedDataSetsRequest, ...gax.CallOption) *ExpandedDataSetIterator |
| CreateExpandedDataSet(context.Context, *adminpb.CreateExpandedDataSetRequest, ...gax.CallOption) (*adminpb.ExpandedDataSet, error) |
| UpdateExpandedDataSet(context.Context, *adminpb.UpdateExpandedDataSetRequest, ...gax.CallOption) (*adminpb.ExpandedDataSet, error) |
| DeleteExpandedDataSet(context.Context, *adminpb.DeleteExpandedDataSetRequest, ...gax.CallOption) error |
| GetChannelGroup(context.Context, *adminpb.GetChannelGroupRequest, ...gax.CallOption) (*adminpb.ChannelGroup, error) |
| ListChannelGroups(context.Context, *adminpb.ListChannelGroupsRequest, ...gax.CallOption) *ChannelGroupIterator |
| CreateChannelGroup(context.Context, *adminpb.CreateChannelGroupRequest, ...gax.CallOption) (*adminpb.ChannelGroup, error) |
| UpdateChannelGroup(context.Context, *adminpb.UpdateChannelGroupRequest, ...gax.CallOption) (*adminpb.ChannelGroup, error) |
| DeleteChannelGroup(context.Context, *adminpb.DeleteChannelGroupRequest, ...gax.CallOption) error |
| SetAutomatedGa4ConfigurationOptOut(context.Context, *adminpb.SetAutomatedGa4ConfigurationOptOutRequest, ...gax.CallOption) (*adminpb.SetAutomatedGa4ConfigurationOptOutResponse, error) |
| FetchAutomatedGa4ConfigurationOptOut(context.Context, *adminpb.FetchAutomatedGa4ConfigurationOptOutRequest, ...gax.CallOption) (*adminpb.FetchAutomatedGa4ConfigurationOptOutResponse, error) |
| GetBigQueryLink(context.Context, *adminpb.GetBigQueryLinkRequest, ...gax.CallOption) (*adminpb.BigQueryLink, error) |
| ListBigQueryLinks(context.Context, *adminpb.ListBigQueryLinksRequest, ...gax.CallOption) *BigQueryLinkIterator |
| GetEnhancedMeasurementSettings(context.Context, *adminpb.GetEnhancedMeasurementSettingsRequest, ...gax.CallOption) (*adminpb.EnhancedMeasurementSettings, error) |
| UpdateEnhancedMeasurementSettings(context.Context, *adminpb.UpdateEnhancedMeasurementSettingsRequest, ...gax.CallOption) (*adminpb.EnhancedMeasurementSettings, error) |
| CreateConnectedSiteTag(context.Context, *adminpb.CreateConnectedSiteTagRequest, ...gax.CallOption) (*adminpb.CreateConnectedSiteTagResponse, error) |
| DeleteConnectedSiteTag(context.Context, *adminpb.DeleteConnectedSiteTagRequest, ...gax.CallOption) error |
| ListConnectedSiteTags(context.Context, *adminpb.ListConnectedSiteTagsRequest, ...gax.CallOption) (*adminpb.ListConnectedSiteTagsResponse, error) |
| FetchConnectedGa4Property(context.Context, *adminpb.FetchConnectedGa4PropertyRequest, ...gax.CallOption) (*adminpb.FetchConnectedGa4PropertyResponse, error) |
| GetAdSenseLink(context.Context, *adminpb.GetAdSenseLinkRequest, ...gax.CallOption) (*adminpb.AdSenseLink, error) |
| CreateAdSenseLink(context.Context, *adminpb.CreateAdSenseLinkRequest, ...gax.CallOption) (*adminpb.AdSenseLink, error) |
| DeleteAdSenseLink(context.Context, *adminpb.DeleteAdSenseLinkRequest, ...gax.CallOption) error |
| ListAdSenseLinks(context.Context, *adminpb.ListAdSenseLinksRequest, ...gax.CallOption) *AdSenseLinkIterator |
| GetEventCreateRule(context.Context, *adminpb.GetEventCreateRuleRequest, ...gax.CallOption) (*adminpb.EventCreateRule, error) |
| ListEventCreateRules(context.Context, *adminpb.ListEventCreateRulesRequest, ...gax.CallOption) *EventCreateRuleIterator |
| CreateEventCreateRule(context.Context, *adminpb.CreateEventCreateRuleRequest, ...gax.CallOption) (*adminpb.EventCreateRule, error) |
| UpdateEventCreateRule(context.Context, *adminpb.UpdateEventCreateRuleRequest, ...gax.CallOption) (*adminpb.EventCreateRule, error) |
| DeleteEventCreateRule(context.Context, *adminpb.DeleteEventCreateRuleRequest, ...gax.CallOption) error |
| UpdateDataRedactionSettings(context.Context, *adminpb.UpdateDataRedactionSettingsRequest, ...gax.CallOption) (*adminpb.DataRedactionSettings, error) |
| GetDataRedactionSettings(context.Context, *adminpb.GetDataRedactionSettingsRequest, ...gax.CallOption) (*adminpb.DataRedactionSettings, error) |
| GetCalculatedMetric(context.Context, *adminpb.GetCalculatedMetricRequest, ...gax.CallOption) (*adminpb.CalculatedMetric, error) |
| CreateCalculatedMetric(context.Context, *adminpb.CreateCalculatedMetricRequest, ...gax.CallOption) (*adminpb.CalculatedMetric, error) |
| ListCalculatedMetrics(context.Context, *adminpb.ListCalculatedMetricsRequest, ...gax.CallOption) *CalculatedMetricIterator |
| UpdateCalculatedMetric(context.Context, *adminpb.UpdateCalculatedMetricRequest, ...gax.CallOption) (*adminpb.CalculatedMetric, error) |
| DeleteCalculatedMetric(context.Context, *adminpb.DeleteCalculatedMetricRequest, ...gax.CallOption) error |
| CreateRollupProperty(context.Context, *adminpb.CreateRollupPropertyRequest, ...gax.CallOption) (*adminpb.CreateRollupPropertyResponse, error) |
| GetRollupPropertySourceLink(context.Context, *adminpb.GetRollupPropertySourceLinkRequest, ...gax.CallOption) (*adminpb.RollupPropertySourceLink, error) |
| ListRollupPropertySourceLinks(context.Context, *adminpb.ListRollupPropertySourceLinksRequest, ...gax.CallOption) *RollupPropertySourceLinkIterator |
| CreateRollupPropertySourceLink(context.Context, *adminpb.CreateRollupPropertySourceLinkRequest, ...gax.CallOption) (*adminpb.RollupPropertySourceLink, error) |
| DeleteRollupPropertySourceLink(context.Context, *adminpb.DeleteRollupPropertySourceLinkRequest, ...gax.CallOption) error |
| CreateSubproperty(context.Context, *adminpb.CreateSubpropertyRequest, ...gax.CallOption) (*adminpb.CreateSubpropertyResponse, error) |
| CreateSubpropertyEventFilter(context.Context, *adminpb.CreateSubpropertyEventFilterRequest, ...gax.CallOption) (*adminpb.SubpropertyEventFilter, error) |
| GetSubpropertyEventFilter(context.Context, *adminpb.GetSubpropertyEventFilterRequest, ...gax.CallOption) (*adminpb.SubpropertyEventFilter, error) |
| ListSubpropertyEventFilters(context.Context, *adminpb.ListSubpropertyEventFiltersRequest, ...gax.CallOption) *SubpropertyEventFilterIterator |
| UpdateSubpropertyEventFilter(context.Context, *adminpb.UpdateSubpropertyEventFilterRequest, ...gax.CallOption) (*adminpb.SubpropertyEventFilter, error) |
| DeleteSubpropertyEventFilter(context.Context, *adminpb.DeleteSubpropertyEventFilterRequest, ...gax.CallOption) error |
| } |
| |
| // AnalyticsAdminClient is a client for interacting with Google Analytics Admin API. |
| // Methods, except Close, may be called concurrently. However, fields must not be modified concurrently with method calls. |
| // |
| // Service Interface for the Analytics Admin API (GA4). |
| type AnalyticsAdminClient struct { |
| // The internal transport-dependent client. |
| internalClient internalAnalyticsAdminClient |
| |
| // The call options for this service. |
| CallOptions *AnalyticsAdminCallOptions |
| } |
| |
| // 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 *AnalyticsAdminClient) 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 *AnalyticsAdminClient) 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 *AnalyticsAdminClient) Connection() *grpc.ClientConn { |
| return c.internalClient.Connection() |
| } |
| |
| // GetAccount lookup for a single Account. |
| func (c *AnalyticsAdminClient) GetAccount(ctx context.Context, req *adminpb.GetAccountRequest, opts ...gax.CallOption) (*adminpb.Account, error) { |
| return c.internalClient.GetAccount(ctx, req, opts...) |
| } |
| |
| // ListAccounts returns all accounts accessible by the caller. |
| // |
| // Note that these accounts might not currently have GA4 properties. |
| // Soft-deleted (ie: “trashed”) accounts are excluded by default. |
| // Returns an empty list if no relevant accounts are found. |
| func (c *AnalyticsAdminClient) ListAccounts(ctx context.Context, req *adminpb.ListAccountsRequest, opts ...gax.CallOption) *AccountIterator { |
| return c.internalClient.ListAccounts(ctx, req, opts...) |
| } |
| |
| // DeleteAccount marks target Account as soft-deleted (ie: “trashed”) and returns it. |
| // |
| // This API does not have a method to restore soft-deleted accounts. |
| // However, they can be restored using the Trash Can UI. |
| // |
| // If the accounts are not restored before the expiration time, the account |
| // and all child resources (eg: Properties, GoogleAdsLinks, Streams, |
| // AccessBindings) will be permanently purged. |
| // https://support.google.com/analytics/answer/6154772 (at https://support.google.com/analytics/answer/6154772) |
| // |
| // Returns an error if the target is not found. |
| func (c *AnalyticsAdminClient) DeleteAccount(ctx context.Context, req *adminpb.DeleteAccountRequest, opts ...gax.CallOption) error { |
| return c.internalClient.DeleteAccount(ctx, req, opts...) |
| } |
| |
| // UpdateAccount updates an account. |
| func (c *AnalyticsAdminClient) UpdateAccount(ctx context.Context, req *adminpb.UpdateAccountRequest, opts ...gax.CallOption) (*adminpb.Account, error) { |
| return c.internalClient.UpdateAccount(ctx, req, opts...) |
| } |
| |
| // ProvisionAccountTicket requests a ticket for creating an account. |
| func (c *AnalyticsAdminClient) ProvisionAccountTicket(ctx context.Context, req *adminpb.ProvisionAccountTicketRequest, opts ...gax.CallOption) (*adminpb.ProvisionAccountTicketResponse, error) { |
| return c.internalClient.ProvisionAccountTicket(ctx, req, opts...) |
| } |
| |
| // ListAccountSummaries returns summaries of all accounts accessible by the caller. |
| func (c *AnalyticsAdminClient) ListAccountSummaries(ctx context.Context, req *adminpb.ListAccountSummariesRequest, opts ...gax.CallOption) *AccountSummaryIterator { |
| return c.internalClient.ListAccountSummaries(ctx, req, opts...) |
| } |
| |
| // GetProperty lookup for a single “GA4” Property. |
| func (c *AnalyticsAdminClient) GetProperty(ctx context.Context, req *adminpb.GetPropertyRequest, opts ...gax.CallOption) (*adminpb.Property, error) { |
| return c.internalClient.GetProperty(ctx, req, opts...) |
| } |
| |
| // ListProperties returns child Properties under the specified parent Account. |
| // |
| // Only “GA4” properties will be returned. |
| // Properties will be excluded if the caller does not have access. |
| // Soft-deleted (ie: “trashed”) properties are excluded by default. |
| // Returns an empty list if no relevant properties are found. |
| func (c *AnalyticsAdminClient) ListProperties(ctx context.Context, req *adminpb.ListPropertiesRequest, opts ...gax.CallOption) *PropertyIterator { |
| return c.internalClient.ListProperties(ctx, req, opts...) |
| } |
| |
| // CreateProperty creates an “GA4” property with the specified location and attributes. |
| func (c *AnalyticsAdminClient) CreateProperty(ctx context.Context, req *adminpb.CreatePropertyRequest, opts ...gax.CallOption) (*adminpb.Property, error) { |
| return c.internalClient.CreateProperty(ctx, req, opts...) |
| } |
| |
| // DeleteProperty marks target Property as soft-deleted (ie: “trashed”) and returns it. |
| // |
| // This API does not have a method to restore soft-deleted properties. |
| // However, they can be restored using the Trash Can UI. |
| // |
| // If the properties are not restored before the expiration time, the Property |
| // and all child resources (eg: GoogleAdsLinks, Streams, AccessBindings) |
| // will be permanently purged. |
| // https://support.google.com/analytics/answer/6154772 (at https://support.google.com/analytics/answer/6154772) |
| // |
| // Returns an error if the target is not found, or is not a GA4 Property. |
| func (c *AnalyticsAdminClient) DeleteProperty(ctx context.Context, req *adminpb.DeletePropertyRequest, opts ...gax.CallOption) (*adminpb.Property, error) { |
| return c.internalClient.DeleteProperty(ctx, req, opts...) |
| } |
| |
| // UpdateProperty updates a property. |
| func (c *AnalyticsAdminClient) UpdateProperty(ctx context.Context, req *adminpb.UpdatePropertyRequest, opts ...gax.CallOption) (*adminpb.Property, error) { |
| return c.internalClient.UpdateProperty(ctx, req, opts...) |
| } |
| |
| // CreateFirebaseLink creates a FirebaseLink. |
| // |
| // Properties can have at most one FirebaseLink. |
| func (c *AnalyticsAdminClient) CreateFirebaseLink(ctx context.Context, req *adminpb.CreateFirebaseLinkRequest, opts ...gax.CallOption) (*adminpb.FirebaseLink, error) { |
| return c.internalClient.CreateFirebaseLink(ctx, req, opts...) |
| } |
| |
| // DeleteFirebaseLink deletes a FirebaseLink on a property |
| func (c *AnalyticsAdminClient) DeleteFirebaseLink(ctx context.Context, req *adminpb.DeleteFirebaseLinkRequest, opts ...gax.CallOption) error { |
| return c.internalClient.DeleteFirebaseLink(ctx, req, opts...) |
| } |
| |
| // ListFirebaseLinks lists FirebaseLinks on a property. |
| // Properties can have at most one FirebaseLink. |
| func (c *AnalyticsAdminClient) ListFirebaseLinks(ctx context.Context, req *adminpb.ListFirebaseLinksRequest, opts ...gax.CallOption) *FirebaseLinkIterator { |
| return c.internalClient.ListFirebaseLinks(ctx, req, opts...) |
| } |
| |
| // GetGlobalSiteTag returns the Site Tag for the specified web stream. |
| // Site Tags are immutable singletons. |
| func (c *AnalyticsAdminClient) GetGlobalSiteTag(ctx context.Context, req *adminpb.GetGlobalSiteTagRequest, opts ...gax.CallOption) (*adminpb.GlobalSiteTag, error) { |
| return c.internalClient.GetGlobalSiteTag(ctx, req, opts...) |
| } |
| |
| // CreateGoogleAdsLink creates a GoogleAdsLink. |
| func (c *AnalyticsAdminClient) CreateGoogleAdsLink(ctx context.Context, req *adminpb.CreateGoogleAdsLinkRequest, opts ...gax.CallOption) (*adminpb.GoogleAdsLink, error) { |
| return c.internalClient.CreateGoogleAdsLink(ctx, req, opts...) |
| } |
| |
| // UpdateGoogleAdsLink updates a GoogleAdsLink on a property |
| func (c *AnalyticsAdminClient) UpdateGoogleAdsLink(ctx context.Context, req *adminpb.UpdateGoogleAdsLinkRequest, opts ...gax.CallOption) (*adminpb.GoogleAdsLink, error) { |
| return c.internalClient.UpdateGoogleAdsLink(ctx, req, opts...) |
| } |
| |
| // DeleteGoogleAdsLink deletes a GoogleAdsLink on a property |
| func (c *AnalyticsAdminClient) DeleteGoogleAdsLink(ctx context.Context, req *adminpb.DeleteGoogleAdsLinkRequest, opts ...gax.CallOption) error { |
| return c.internalClient.DeleteGoogleAdsLink(ctx, req, opts...) |
| } |
| |
| // ListGoogleAdsLinks lists GoogleAdsLinks on a property. |
| func (c *AnalyticsAdminClient) ListGoogleAdsLinks(ctx context.Context, req *adminpb.ListGoogleAdsLinksRequest, opts ...gax.CallOption) *GoogleAdsLinkIterator { |
| return c.internalClient.ListGoogleAdsLinks(ctx, req, opts...) |
| } |
| |
| // GetDataSharingSettings get data sharing settings on an account. |
| // Data sharing settings are singletons. |
| func (c *AnalyticsAdminClient) GetDataSharingSettings(ctx context.Context, req *adminpb.GetDataSharingSettingsRequest, opts ...gax.CallOption) (*adminpb.DataSharingSettings, error) { |
| return c.internalClient.GetDataSharingSettings(ctx, req, opts...) |
| } |
| |
| // GetMeasurementProtocolSecret lookup for a single “GA4” MeasurementProtocolSecret. |
| func (c *AnalyticsAdminClient) GetMeasurementProtocolSecret(ctx context.Context, req *adminpb.GetMeasurementProtocolSecretRequest, opts ...gax.CallOption) (*adminpb.MeasurementProtocolSecret, error) { |
| return c.internalClient.GetMeasurementProtocolSecret(ctx, req, opts...) |
| } |
| |
| // ListMeasurementProtocolSecrets returns child MeasurementProtocolSecrets under the specified parent |
| // Property. |
| func (c *AnalyticsAdminClient) ListMeasurementProtocolSecrets(ctx context.Context, req *adminpb.ListMeasurementProtocolSecretsRequest, opts ...gax.CallOption) *MeasurementProtocolSecretIterator { |
| return c.internalClient.ListMeasurementProtocolSecrets(ctx, req, opts...) |
| } |
| |
| // CreateMeasurementProtocolSecret creates a measurement protocol secret. |
| func (c *AnalyticsAdminClient) CreateMeasurementProtocolSecret(ctx context.Context, req *adminpb.CreateMeasurementProtocolSecretRequest, opts ...gax.CallOption) (*adminpb.MeasurementProtocolSecret, error) { |
| return c.internalClient.CreateMeasurementProtocolSecret(ctx, req, opts...) |
| } |
| |
| // DeleteMeasurementProtocolSecret deletes target MeasurementProtocolSecret. |
| func (c *AnalyticsAdminClient) DeleteMeasurementProtocolSecret(ctx context.Context, req *adminpb.DeleteMeasurementProtocolSecretRequest, opts ...gax.CallOption) error { |
| return c.internalClient.DeleteMeasurementProtocolSecret(ctx, req, opts...) |
| } |
| |
| // UpdateMeasurementProtocolSecret updates a measurement protocol secret. |
| func (c *AnalyticsAdminClient) UpdateMeasurementProtocolSecret(ctx context.Context, req *adminpb.UpdateMeasurementProtocolSecretRequest, opts ...gax.CallOption) (*adminpb.MeasurementProtocolSecret, error) { |
| return c.internalClient.UpdateMeasurementProtocolSecret(ctx, req, opts...) |
| } |
| |
| // AcknowledgeUserDataCollection acknowledges the terms of user data collection for the specified property. |
| // |
| // This acknowledgement must be completed (either in the Google Analytics UI |
| // or through this API) before MeasurementProtocolSecret resources may be |
| // created. |
| func (c *AnalyticsAdminClient) AcknowledgeUserDataCollection(ctx context.Context, req *adminpb.AcknowledgeUserDataCollectionRequest, opts ...gax.CallOption) (*adminpb.AcknowledgeUserDataCollectionResponse, error) { |
| return c.internalClient.AcknowledgeUserDataCollection(ctx, req, opts...) |
| } |
| |
| // GetSKAdNetworkConversionValueSchema looks up a single SKAdNetworkConversionValueSchema. |
| func (c *AnalyticsAdminClient) GetSKAdNetworkConversionValueSchema(ctx context.Context, req *adminpb.GetSKAdNetworkConversionValueSchemaRequest, opts ...gax.CallOption) (*adminpb.SKAdNetworkConversionValueSchema, error) { |
| return c.internalClient.GetSKAdNetworkConversionValueSchema(ctx, req, opts...) |
| } |
| |
| // CreateSKAdNetworkConversionValueSchema creates a SKAdNetworkConversionValueSchema. |
| func (c *AnalyticsAdminClient) CreateSKAdNetworkConversionValueSchema(ctx context.Context, req *adminpb.CreateSKAdNetworkConversionValueSchemaRequest, opts ...gax.CallOption) (*adminpb.SKAdNetworkConversionValueSchema, error) { |
| return c.internalClient.CreateSKAdNetworkConversionValueSchema(ctx, req, opts...) |
| } |
| |
| // DeleteSKAdNetworkConversionValueSchema deletes target SKAdNetworkConversionValueSchema. |
| func (c *AnalyticsAdminClient) DeleteSKAdNetworkConversionValueSchema(ctx context.Context, req *adminpb.DeleteSKAdNetworkConversionValueSchemaRequest, opts ...gax.CallOption) error { |
| return c.internalClient.DeleteSKAdNetworkConversionValueSchema(ctx, req, opts...) |
| } |
| |
| // UpdateSKAdNetworkConversionValueSchema updates a SKAdNetworkConversionValueSchema. |
| func (c *AnalyticsAdminClient) UpdateSKAdNetworkConversionValueSchema(ctx context.Context, req *adminpb.UpdateSKAdNetworkConversionValueSchemaRequest, opts ...gax.CallOption) (*adminpb.SKAdNetworkConversionValueSchema, error) { |
| return c.internalClient.UpdateSKAdNetworkConversionValueSchema(ctx, req, opts...) |
| } |
| |
| // ListSKAdNetworkConversionValueSchemas lists SKAdNetworkConversionValueSchema on a stream. |
| // Properties can have at most one SKAdNetworkConversionValueSchema. |
| func (c *AnalyticsAdminClient) ListSKAdNetworkConversionValueSchemas(ctx context.Context, req *adminpb.ListSKAdNetworkConversionValueSchemasRequest, opts ...gax.CallOption) *SKAdNetworkConversionValueSchemaIterator { |
| return c.internalClient.ListSKAdNetworkConversionValueSchemas(ctx, req, opts...) |
| } |
| |
| // SearchChangeHistoryEvents searches through all changes to an account or its children given the |
| // specified set of filters. |
| func (c *AnalyticsAdminClient) SearchChangeHistoryEvents(ctx context.Context, req *adminpb.SearchChangeHistoryEventsRequest, opts ...gax.CallOption) *ChangeHistoryEventIterator { |
| return c.internalClient.SearchChangeHistoryEvents(ctx, req, opts...) |
| } |
| |
| // GetGoogleSignalsSettings lookup for Google Signals settings for a property. |
| func (c *AnalyticsAdminClient) GetGoogleSignalsSettings(ctx context.Context, req *adminpb.GetGoogleSignalsSettingsRequest, opts ...gax.CallOption) (*adminpb.GoogleSignalsSettings, error) { |
| return c.internalClient.GetGoogleSignalsSettings(ctx, req, opts...) |
| } |
| |
| // UpdateGoogleSignalsSettings updates Google Signals settings for a property. |
| func (c *AnalyticsAdminClient) UpdateGoogleSignalsSettings(ctx context.Context, req *adminpb.UpdateGoogleSignalsSettingsRequest, opts ...gax.CallOption) (*adminpb.GoogleSignalsSettings, error) { |
| return c.internalClient.UpdateGoogleSignalsSettings(ctx, req, opts...) |
| } |
| |
| // CreateConversionEvent creates a conversion event with the specified attributes. |
| func (c *AnalyticsAdminClient) CreateConversionEvent(ctx context.Context, req *adminpb.CreateConversionEventRequest, opts ...gax.CallOption) (*adminpb.ConversionEvent, error) { |
| return c.internalClient.CreateConversionEvent(ctx, req, opts...) |
| } |
| |
| // UpdateConversionEvent updates a conversion event with the specified attributes. |
| func (c *AnalyticsAdminClient) UpdateConversionEvent(ctx context.Context, req *adminpb.UpdateConversionEventRequest, opts ...gax.CallOption) (*adminpb.ConversionEvent, error) { |
| return c.internalClient.UpdateConversionEvent(ctx, req, opts...) |
| } |
| |
| // GetConversionEvent retrieve a single conversion event. |
| func (c *AnalyticsAdminClient) GetConversionEvent(ctx context.Context, req *adminpb.GetConversionEventRequest, opts ...gax.CallOption) (*adminpb.ConversionEvent, error) { |
| return c.internalClient.GetConversionEvent(ctx, req, opts...) |
| } |
| |
| // DeleteConversionEvent deletes a conversion event in a property. |
| func (c *AnalyticsAdminClient) DeleteConversionEvent(ctx context.Context, req *adminpb.DeleteConversionEventRequest, opts ...gax.CallOption) error { |
| return c.internalClient.DeleteConversionEvent(ctx, req, opts...) |
| } |
| |
| // ListConversionEvents returns a list of conversion events in the specified parent property. |
| // |
| // Returns an empty list if no conversion events are found. |
| func (c *AnalyticsAdminClient) ListConversionEvents(ctx context.Context, req *adminpb.ListConversionEventsRequest, opts ...gax.CallOption) *ConversionEventIterator { |
| return c.internalClient.ListConversionEvents(ctx, req, opts...) |
| } |
| |
| // GetDisplayVideo360AdvertiserLink look up a single DisplayVideo360AdvertiserLink |
| func (c *AnalyticsAdminClient) GetDisplayVideo360AdvertiserLink(ctx context.Context, req *adminpb.GetDisplayVideo360AdvertiserLinkRequest, opts ...gax.CallOption) (*adminpb.DisplayVideo360AdvertiserLink, error) { |
| return c.internalClient.GetDisplayVideo360AdvertiserLink(ctx, req, opts...) |
| } |
| |
| // ListDisplayVideo360AdvertiserLinks lists all DisplayVideo360AdvertiserLinks on a property. |
| func (c *AnalyticsAdminClient) ListDisplayVideo360AdvertiserLinks(ctx context.Context, req *adminpb.ListDisplayVideo360AdvertiserLinksRequest, opts ...gax.CallOption) *DisplayVideo360AdvertiserLinkIterator { |
| return c.internalClient.ListDisplayVideo360AdvertiserLinks(ctx, req, opts...) |
| } |
| |
| // CreateDisplayVideo360AdvertiserLink creates a DisplayVideo360AdvertiserLink. |
| // This can only be utilized by users who have proper authorization both on |
| // the Google Analytics property and on the Display & Video 360 advertiser. |
| // Users who do not have access to the Display & Video 360 advertiser should |
| // instead seek to create a DisplayVideo360LinkProposal. |
| func (c *AnalyticsAdminClient) CreateDisplayVideo360AdvertiserLink(ctx context.Context, req *adminpb.CreateDisplayVideo360AdvertiserLinkRequest, opts ...gax.CallOption) (*adminpb.DisplayVideo360AdvertiserLink, error) { |
| return c.internalClient.CreateDisplayVideo360AdvertiserLink(ctx, req, opts...) |
| } |
| |
| // DeleteDisplayVideo360AdvertiserLink deletes a DisplayVideo360AdvertiserLink on a property. |
| func (c *AnalyticsAdminClient) DeleteDisplayVideo360AdvertiserLink(ctx context.Context, req *adminpb.DeleteDisplayVideo360AdvertiserLinkRequest, opts ...gax.CallOption) error { |
| return c.internalClient.DeleteDisplayVideo360AdvertiserLink(ctx, req, opts...) |
| } |
| |
| // UpdateDisplayVideo360AdvertiserLink updates a DisplayVideo360AdvertiserLink on a property. |
| func (c *AnalyticsAdminClient) UpdateDisplayVideo360AdvertiserLink(ctx context.Context, req *adminpb.UpdateDisplayVideo360AdvertiserLinkRequest, opts ...gax.CallOption) (*adminpb.DisplayVideo360AdvertiserLink, error) { |
| return c.internalClient.UpdateDisplayVideo360AdvertiserLink(ctx, req, opts...) |
| } |
| |
| // GetDisplayVideo360AdvertiserLinkProposal lookup for a single DisplayVideo360AdvertiserLinkProposal. |
| func (c *AnalyticsAdminClient) GetDisplayVideo360AdvertiserLinkProposal(ctx context.Context, req *adminpb.GetDisplayVideo360AdvertiserLinkProposalRequest, opts ...gax.CallOption) (*adminpb.DisplayVideo360AdvertiserLinkProposal, error) { |
| return c.internalClient.GetDisplayVideo360AdvertiserLinkProposal(ctx, req, opts...) |
| } |
| |
| // ListDisplayVideo360AdvertiserLinkProposals lists DisplayVideo360AdvertiserLinkProposals on a property. |
| func (c *AnalyticsAdminClient) ListDisplayVideo360AdvertiserLinkProposals(ctx context.Context, req *adminpb.ListDisplayVideo360AdvertiserLinkProposalsRequest, opts ...gax.CallOption) *DisplayVideo360AdvertiserLinkProposalIterator { |
| return c.internalClient.ListDisplayVideo360AdvertiserLinkProposals(ctx, req, opts...) |
| } |
| |
| // CreateDisplayVideo360AdvertiserLinkProposal creates a DisplayVideo360AdvertiserLinkProposal. |
| func (c *AnalyticsAdminClient) CreateDisplayVideo360AdvertiserLinkProposal(ctx context.Context, req *adminpb.CreateDisplayVideo360AdvertiserLinkProposalRequest, opts ...gax.CallOption) (*adminpb.DisplayVideo360AdvertiserLinkProposal, error) { |
| return c.internalClient.CreateDisplayVideo360AdvertiserLinkProposal(ctx, req, opts...) |
| } |
| |
| // DeleteDisplayVideo360AdvertiserLinkProposal deletes a DisplayVideo360AdvertiserLinkProposal on a property. |
| // This can only be used on cancelled proposals. |
| func (c *AnalyticsAdminClient) DeleteDisplayVideo360AdvertiserLinkProposal(ctx context.Context, req *adminpb.DeleteDisplayVideo360AdvertiserLinkProposalRequest, opts ...gax.CallOption) error { |
| return c.internalClient.DeleteDisplayVideo360AdvertiserLinkProposal(ctx, req, opts...) |
| } |
| |
| // ApproveDisplayVideo360AdvertiserLinkProposal approves a DisplayVideo360AdvertiserLinkProposal. |
| // The DisplayVideo360AdvertiserLinkProposal will be deleted and a new |
| // DisplayVideo360AdvertiserLink will be created. |
| func (c *AnalyticsAdminClient) ApproveDisplayVideo360AdvertiserLinkProposal(ctx context.Context, req *adminpb.ApproveDisplayVideo360AdvertiserLinkProposalRequest, opts ...gax.CallOption) (*adminpb.ApproveDisplayVideo360AdvertiserLinkProposalResponse, error) { |
| return c.internalClient.ApproveDisplayVideo360AdvertiserLinkProposal(ctx, req, opts...) |
| } |
| |
| // CancelDisplayVideo360AdvertiserLinkProposal cancels a DisplayVideo360AdvertiserLinkProposal. |
| // Cancelling can mean either: |
| // |
| // Declining a proposal initiated from Display & Video 360 |
| // |
| // Withdrawing a proposal initiated from Google Analytics |
| // After being cancelled, a proposal will eventually be deleted automatically. |
| func (c *AnalyticsAdminClient) CancelDisplayVideo360AdvertiserLinkProposal(ctx context.Context, req *adminpb.CancelDisplayVideo360AdvertiserLinkProposalRequest, opts ...gax.CallOption) (*adminpb.DisplayVideo360AdvertiserLinkProposal, error) { |
| return c.internalClient.CancelDisplayVideo360AdvertiserLinkProposal(ctx, req, opts...) |
| } |
| |
| // CreateCustomDimension creates a CustomDimension. |
| func (c *AnalyticsAdminClient) CreateCustomDimension(ctx context.Context, req *adminpb.CreateCustomDimensionRequest, opts ...gax.CallOption) (*adminpb.CustomDimension, error) { |
| return c.internalClient.CreateCustomDimension(ctx, req, opts...) |
| } |
| |
| // UpdateCustomDimension updates a CustomDimension on a property. |
| func (c *AnalyticsAdminClient) UpdateCustomDimension(ctx context.Context, req *adminpb.UpdateCustomDimensionRequest, opts ...gax.CallOption) (*adminpb.CustomDimension, error) { |
| return c.internalClient.UpdateCustomDimension(ctx, req, opts...) |
| } |
| |
| // ListCustomDimensions lists CustomDimensions on a property. |
| func (c *AnalyticsAdminClient) ListCustomDimensions(ctx context.Context, req *adminpb.ListCustomDimensionsRequest, opts ...gax.CallOption) *CustomDimensionIterator { |
| return c.internalClient.ListCustomDimensions(ctx, req, opts...) |
| } |
| |
| // ArchiveCustomDimension archives a CustomDimension on a property. |
| func (c *AnalyticsAdminClient) ArchiveCustomDimension(ctx context.Context, req *adminpb.ArchiveCustomDimensionRequest, opts ...gax.CallOption) error { |
| return c.internalClient.ArchiveCustomDimension(ctx, req, opts...) |
| } |
| |
| // GetCustomDimension lookup for a single CustomDimension. |
| func (c *AnalyticsAdminClient) GetCustomDimension(ctx context.Context, req *adminpb.GetCustomDimensionRequest, opts ...gax.CallOption) (*adminpb.CustomDimension, error) { |
| return c.internalClient.GetCustomDimension(ctx, req, opts...) |
| } |
| |
| // CreateCustomMetric creates a CustomMetric. |
| func (c *AnalyticsAdminClient) CreateCustomMetric(ctx context.Context, req *adminpb.CreateCustomMetricRequest, opts ...gax.CallOption) (*adminpb.CustomMetric, error) { |
| return c.internalClient.CreateCustomMetric(ctx, req, opts...) |
| } |
| |
| // UpdateCustomMetric updates a CustomMetric on a property. |
| func (c *AnalyticsAdminClient) UpdateCustomMetric(ctx context.Context, req *adminpb.UpdateCustomMetricRequest, opts ...gax.CallOption) (*adminpb.CustomMetric, error) { |
| return c.internalClient.UpdateCustomMetric(ctx, req, opts...) |
| } |
| |
| // ListCustomMetrics lists CustomMetrics on a property. |
| func (c *AnalyticsAdminClient) ListCustomMetrics(ctx context.Context, req *adminpb.ListCustomMetricsRequest, opts ...gax.CallOption) *CustomMetricIterator { |
| return c.internalClient.ListCustomMetrics(ctx, req, opts...) |
| } |
| |
| // ArchiveCustomMetric archives a CustomMetric on a property. |
| func (c *AnalyticsAdminClient) ArchiveCustomMetric(ctx context.Context, req *adminpb.ArchiveCustomMetricRequest, opts ...gax.CallOption) error { |
| return c.internalClient.ArchiveCustomMetric(ctx, req, opts...) |
| } |
| |
| // GetCustomMetric lookup for a single CustomMetric. |
| func (c *AnalyticsAdminClient) GetCustomMetric(ctx context.Context, req *adminpb.GetCustomMetricRequest, opts ...gax.CallOption) (*adminpb.CustomMetric, error) { |
| return c.internalClient.GetCustomMetric(ctx, req, opts...) |
| } |
| |
| // GetDataRetentionSettings returns the singleton data retention settings for this property. |
| func (c *AnalyticsAdminClient) GetDataRetentionSettings(ctx context.Context, req *adminpb.GetDataRetentionSettingsRequest, opts ...gax.CallOption) (*adminpb.DataRetentionSettings, error) { |
| return c.internalClient.GetDataRetentionSettings(ctx, req, opts...) |
| } |
| |
| // UpdateDataRetentionSettings updates the singleton data retention settings for this property. |
| func (c *AnalyticsAdminClient) UpdateDataRetentionSettings(ctx context.Context, req *adminpb.UpdateDataRetentionSettingsRequest, opts ...gax.CallOption) (*adminpb.DataRetentionSettings, error) { |
| return c.internalClient.UpdateDataRetentionSettings(ctx, req, opts...) |
| } |
| |
| // CreateDataStream creates a DataStream. |
| func (c *AnalyticsAdminClient) CreateDataStream(ctx context.Context, req *adminpb.CreateDataStreamRequest, opts ...gax.CallOption) (*adminpb.DataStream, error) { |
| return c.internalClient.CreateDataStream(ctx, req, opts...) |
| } |
| |
| // DeleteDataStream deletes a DataStream on a property. |
| func (c *AnalyticsAdminClient) DeleteDataStream(ctx context.Context, req *adminpb.DeleteDataStreamRequest, opts ...gax.CallOption) error { |
| return c.internalClient.DeleteDataStream(ctx, req, opts...) |
| } |
| |
| // UpdateDataStream updates a DataStream on a property. |
| func (c *AnalyticsAdminClient) UpdateDataStream(ctx context.Context, req *adminpb.UpdateDataStreamRequest, opts ...gax.CallOption) (*adminpb.DataStream, error) { |
| return c.internalClient.UpdateDataStream(ctx, req, opts...) |
| } |
| |
| // ListDataStreams lists DataStreams on a property. |
| func (c *AnalyticsAdminClient) ListDataStreams(ctx context.Context, req *adminpb.ListDataStreamsRequest, opts ...gax.CallOption) *DataStreamIterator { |
| return c.internalClient.ListDataStreams(ctx, req, opts...) |
| } |
| |
| // GetDataStream lookup for a single DataStream. |
| func (c *AnalyticsAdminClient) GetDataStream(ctx context.Context, req *adminpb.GetDataStreamRequest, opts ...gax.CallOption) (*adminpb.DataStream, error) { |
| return c.internalClient.GetDataStream(ctx, req, opts...) |
| } |
| |
| // GetAudience lookup for a single Audience. |
| // Audiences created before 2020 may not be supported. |
| // Default audiences will not show filter definitions. |
| func (c *AnalyticsAdminClient) GetAudience(ctx context.Context, req *adminpb.GetAudienceRequest, opts ...gax.CallOption) (*adminpb.Audience, error) { |
| return c.internalClient.GetAudience(ctx, req, opts...) |
| } |
| |
| // ListAudiences lists Audiences on a property. |
| // Audiences created before 2020 may not be supported. |
| // Default audiences will not show filter definitions. |
| func (c *AnalyticsAdminClient) ListAudiences(ctx context.Context, req *adminpb.ListAudiencesRequest, opts ...gax.CallOption) *AudienceIterator { |
| return c.internalClient.ListAudiences(ctx, req, opts...) |
| } |
| |
| // CreateAudience creates an Audience. |
| func (c *AnalyticsAdminClient) CreateAudience(ctx context.Context, req *adminpb.CreateAudienceRequest, opts ...gax.CallOption) (*adminpb.Audience, error) { |
| return c.internalClient.CreateAudience(ctx, req, opts...) |
| } |
| |
| // UpdateAudience updates an Audience on a property. |
| func (c *AnalyticsAdminClient) UpdateAudience(ctx context.Context, req *adminpb.UpdateAudienceRequest, opts ...gax.CallOption) (*adminpb.Audience, error) { |
| return c.internalClient.UpdateAudience(ctx, req, opts...) |
| } |
| |
| // ArchiveAudience archives an Audience on a property. |
| func (c *AnalyticsAdminClient) ArchiveAudience(ctx context.Context, req *adminpb.ArchiveAudienceRequest, opts ...gax.CallOption) error { |
| return c.internalClient.ArchiveAudience(ctx, req, opts...) |
| } |
| |
| // GetSearchAds360Link look up a single SearchAds360Link |
| func (c *AnalyticsAdminClient) GetSearchAds360Link(ctx context.Context, req *adminpb.GetSearchAds360LinkRequest, opts ...gax.CallOption) (*adminpb.SearchAds360Link, error) { |
| return c.internalClient.GetSearchAds360Link(ctx, req, opts...) |
| } |
| |
| // ListSearchAds360Links lists all SearchAds360Links on a property. |
| func (c *AnalyticsAdminClient) ListSearchAds360Links(ctx context.Context, req *adminpb.ListSearchAds360LinksRequest, opts ...gax.CallOption) *SearchAds360LinkIterator { |
| return c.internalClient.ListSearchAds360Links(ctx, req, opts...) |
| } |
| |
| // CreateSearchAds360Link creates a SearchAds360Link. |
| func (c *AnalyticsAdminClient) CreateSearchAds360Link(ctx context.Context, req *adminpb.CreateSearchAds360LinkRequest, opts ...gax.CallOption) (*adminpb.SearchAds360Link, error) { |
| return c.internalClient.CreateSearchAds360Link(ctx, req, opts...) |
| } |
| |
| // DeleteSearchAds360Link deletes a SearchAds360Link on a property. |
| func (c *AnalyticsAdminClient) DeleteSearchAds360Link(ctx context.Context, req *adminpb.DeleteSearchAds360LinkRequest, opts ...gax.CallOption) error { |
| return c.internalClient.DeleteSearchAds360Link(ctx, req, opts...) |
| } |
| |
| // UpdateSearchAds360Link updates a SearchAds360Link on a property. |
| func (c *AnalyticsAdminClient) UpdateSearchAds360Link(ctx context.Context, req *adminpb.UpdateSearchAds360LinkRequest, opts ...gax.CallOption) (*adminpb.SearchAds360Link, error) { |
| return c.internalClient.UpdateSearchAds360Link(ctx, req, opts...) |
| } |
| |
| // GetAttributionSettings lookup for a AttributionSettings singleton. |
| func (c *AnalyticsAdminClient) GetAttributionSettings(ctx context.Context, req *adminpb.GetAttributionSettingsRequest, opts ...gax.CallOption) (*adminpb.AttributionSettings, error) { |
| return c.internalClient.GetAttributionSettings(ctx, req, opts...) |
| } |
| |
| // UpdateAttributionSettings updates attribution settings on a property. |
| func (c *AnalyticsAdminClient) UpdateAttributionSettings(ctx context.Context, req *adminpb.UpdateAttributionSettingsRequest, opts ...gax.CallOption) (*adminpb.AttributionSettings, error) { |
| return c.internalClient.UpdateAttributionSettings(ctx, req, opts...) |
| } |
| |
| // RunAccessReport returns a customized report of data access records. The report provides |
| // records of each time a user reads Google Analytics reporting data. Access |
| // records are retained for up to 2 years. |
| // |
| // Data Access Reports can be requested for a property. Reports may be |
| // requested for any property, but dimensions that aren’t related to quota can |
| // only be requested on Google Analytics 360 properties. This method is only |
| // available to Administrators. |
| // |
| // These data access records include GA4 UI Reporting, GA4 UI Explorations, |
| // GA4 Data API, and other products like Firebase & Admob that can retrieve |
| // data from Google Analytics through a linkage. These records don’t include |
| // property configuration changes like adding a stream or changing a |
| // property’s time zone. For configuration change history, see |
| // searchChangeHistoryEvents (at https://developers.google.com/analytics/devguides/config/admin/v1/rest/v1alpha/accounts/searchChangeHistoryEvents). |
| func (c *AnalyticsAdminClient) RunAccessReport(ctx context.Context, req *adminpb.RunAccessReportRequest, opts ...gax.CallOption) (*adminpb.RunAccessReportResponse, error) { |
| return c.internalClient.RunAccessReport(ctx, req, opts...) |
| } |
| |
| // CreateAccessBinding creates an access binding on an account or property. |
| func (c *AnalyticsAdminClient) CreateAccessBinding(ctx context.Context, req *adminpb.CreateAccessBindingRequest, opts ...gax.CallOption) (*adminpb.AccessBinding, error) { |
| return c.internalClient.CreateAccessBinding(ctx, req, opts...) |
| } |
| |
| // GetAccessBinding gets information about an access binding. |
| func (c *AnalyticsAdminClient) GetAccessBinding(ctx context.Context, req *adminpb.GetAccessBindingRequest, opts ...gax.CallOption) (*adminpb.AccessBinding, error) { |
| return c.internalClient.GetAccessBinding(ctx, req, opts...) |
| } |
| |
| // UpdateAccessBinding updates an access binding on an account or property. |
| func (c *AnalyticsAdminClient) UpdateAccessBinding(ctx context.Context, req *adminpb.UpdateAccessBindingRequest, opts ...gax.CallOption) (*adminpb.AccessBinding, error) { |
| return c.internalClient.UpdateAccessBinding(ctx, req, opts...) |
| } |
| |
| // DeleteAccessBinding deletes an access binding on an account or property. |
| func (c *AnalyticsAdminClient) DeleteAccessBinding(ctx context.Context, req *adminpb.DeleteAccessBindingRequest, opts ...gax.CallOption) error { |
| return c.internalClient.DeleteAccessBinding(ctx, req, opts...) |
| } |
| |
| // ListAccessBindings lists all access bindings on an account or property. |
| func (c *AnalyticsAdminClient) ListAccessBindings(ctx context.Context, req *adminpb.ListAccessBindingsRequest, opts ...gax.CallOption) *AccessBindingIterator { |
| return c.internalClient.ListAccessBindings(ctx, req, opts...) |
| } |
| |
| // BatchCreateAccessBindings creates information about multiple access bindings to an account or |
| // property. |
| // |
| // This method is transactional. If any AccessBinding cannot be created, none |
| // of the AccessBindings will be created. |
| func (c *AnalyticsAdminClient) BatchCreateAccessBindings(ctx context.Context, req *adminpb.BatchCreateAccessBindingsRequest, opts ...gax.CallOption) (*adminpb.BatchCreateAccessBindingsResponse, error) { |
| return c.internalClient.BatchCreateAccessBindings(ctx, req, opts...) |
| } |
| |
| // BatchGetAccessBindings gets information about multiple access bindings to an account or property. |
| func (c *AnalyticsAdminClient) BatchGetAccessBindings(ctx context.Context, req *adminpb.BatchGetAccessBindingsRequest, opts ...gax.CallOption) (*adminpb.BatchGetAccessBindingsResponse, error) { |
| return c.internalClient.BatchGetAccessBindings(ctx, req, opts...) |
| } |
| |
| // BatchUpdateAccessBindings updates information about multiple access bindings to an account or |
| // property. |
| func (c *AnalyticsAdminClient) BatchUpdateAccessBindings(ctx context.Context, req *adminpb.BatchUpdateAccessBindingsRequest, opts ...gax.CallOption) (*adminpb.BatchUpdateAccessBindingsResponse, error) { |
| return c.internalClient.BatchUpdateAccessBindings(ctx, req, opts...) |
| } |
| |
| // BatchDeleteAccessBindings deletes information about multiple users’ links to an account or property. |
| func (c *AnalyticsAdminClient) BatchDeleteAccessBindings(ctx context.Context, req *adminpb.BatchDeleteAccessBindingsRequest, opts ...gax.CallOption) error { |
| return c.internalClient.BatchDeleteAccessBindings(ctx, req, opts...) |
| } |
| |
| // GetExpandedDataSet lookup for a single ExpandedDataSet. |
| func (c *AnalyticsAdminClient) GetExpandedDataSet(ctx context.Context, req *adminpb.GetExpandedDataSetRequest, opts ...gax.CallOption) (*adminpb.ExpandedDataSet, error) { |
| return c.internalClient.GetExpandedDataSet(ctx, req, opts...) |
| } |
| |
| // ListExpandedDataSets lists ExpandedDataSets on a property. |
| func (c *AnalyticsAdminClient) ListExpandedDataSets(ctx context.Context, req *adminpb.ListExpandedDataSetsRequest, opts ...gax.CallOption) *ExpandedDataSetIterator { |
| return c.internalClient.ListExpandedDataSets(ctx, req, opts...) |
| } |
| |
| // CreateExpandedDataSet creates a ExpandedDataSet. |
| func (c *AnalyticsAdminClient) CreateExpandedDataSet(ctx context.Context, req *adminpb.CreateExpandedDataSetRequest, opts ...gax.CallOption) (*adminpb.ExpandedDataSet, error) { |
| return c.internalClient.CreateExpandedDataSet(ctx, req, opts...) |
| } |
| |
| // UpdateExpandedDataSet updates a ExpandedDataSet on a property. |
| func (c *AnalyticsAdminClient) UpdateExpandedDataSet(ctx context.Context, req *adminpb.UpdateExpandedDataSetRequest, opts ...gax.CallOption) (*adminpb.ExpandedDataSet, error) { |
| return c.internalClient.UpdateExpandedDataSet(ctx, req, opts...) |
| } |
| |
| // DeleteExpandedDataSet deletes a ExpandedDataSet on a property. |
| func (c *AnalyticsAdminClient) DeleteExpandedDataSet(ctx context.Context, req *adminpb.DeleteExpandedDataSetRequest, opts ...gax.CallOption) error { |
| return c.internalClient.DeleteExpandedDataSet(ctx, req, opts...) |
| } |
| |
| // GetChannelGroup lookup for a single ChannelGroup. |
| func (c *AnalyticsAdminClient) GetChannelGroup(ctx context.Context, req *adminpb.GetChannelGroupRequest, opts ...gax.CallOption) (*adminpb.ChannelGroup, error) { |
| return c.internalClient.GetChannelGroup(ctx, req, opts...) |
| } |
| |
| // ListChannelGroups lists ChannelGroups on a property. |
| func (c *AnalyticsAdminClient) ListChannelGroups(ctx context.Context, req *adminpb.ListChannelGroupsRequest, opts ...gax.CallOption) *ChannelGroupIterator { |
| return c.internalClient.ListChannelGroups(ctx, req, opts...) |
| } |
| |
| // CreateChannelGroup creates a ChannelGroup. |
| func (c *AnalyticsAdminClient) CreateChannelGroup(ctx context.Context, req *adminpb.CreateChannelGroupRequest, opts ...gax.CallOption) (*adminpb.ChannelGroup, error) { |
| return c.internalClient.CreateChannelGroup(ctx, req, opts...) |
| } |
| |
| // UpdateChannelGroup updates a ChannelGroup. |
| func (c *AnalyticsAdminClient) UpdateChannelGroup(ctx context.Context, req *adminpb.UpdateChannelGroupRequest, opts ...gax.CallOption) (*adminpb.ChannelGroup, error) { |
| return c.internalClient.UpdateChannelGroup(ctx, req, opts...) |
| } |
| |
| // DeleteChannelGroup deletes a ChannelGroup on a property. |
| func (c *AnalyticsAdminClient) DeleteChannelGroup(ctx context.Context, req *adminpb.DeleteChannelGroupRequest, opts ...gax.CallOption) error { |
| return c.internalClient.DeleteChannelGroup(ctx, req, opts...) |
| } |
| |
| // SetAutomatedGa4ConfigurationOptOut sets the opt out status for the automated GA4 setup process for a UA |
| // property. |
| // Note: this has no effect on GA4 property. |
| func (c *AnalyticsAdminClient) SetAutomatedGa4ConfigurationOptOut(ctx context.Context, req *adminpb.SetAutomatedGa4ConfigurationOptOutRequest, opts ...gax.CallOption) (*adminpb.SetAutomatedGa4ConfigurationOptOutResponse, error) { |
| return c.internalClient.SetAutomatedGa4ConfigurationOptOut(ctx, req, opts...) |
| } |
| |
| // FetchAutomatedGa4ConfigurationOptOut fetches the opt out status for the automated GA4 setup process for a UA |
| // property. |
| // Note: this has no effect on GA4 property. |
| func (c *AnalyticsAdminClient) FetchAutomatedGa4ConfigurationOptOut(ctx context.Context, req *adminpb.FetchAutomatedGa4ConfigurationOptOutRequest, opts ...gax.CallOption) (*adminpb.FetchAutomatedGa4ConfigurationOptOutResponse, error) { |
| return c.internalClient.FetchAutomatedGa4ConfigurationOptOut(ctx, req, opts...) |
| } |
| |
| // GetBigQueryLink lookup for a single BigQuery Link. |
| func (c *AnalyticsAdminClient) GetBigQueryLink(ctx context.Context, req *adminpb.GetBigQueryLinkRequest, opts ...gax.CallOption) (*adminpb.BigQueryLink, error) { |
| return c.internalClient.GetBigQueryLink(ctx, req, opts...) |
| } |
| |
| // ListBigQueryLinks lists BigQuery Links on a property. |
| func (c *AnalyticsAdminClient) ListBigQueryLinks(ctx context.Context, req *adminpb.ListBigQueryLinksRequest, opts ...gax.CallOption) *BigQueryLinkIterator { |
| return c.internalClient.ListBigQueryLinks(ctx, req, opts...) |
| } |
| |
| // GetEnhancedMeasurementSettings returns the enhanced measurement settings for this data stream. |
| // Note that the stream must enable enhanced measurement for these settings to |
| // take effect. |
| func (c *AnalyticsAdminClient) GetEnhancedMeasurementSettings(ctx context.Context, req *adminpb.GetEnhancedMeasurementSettingsRequest, opts ...gax.CallOption) (*adminpb.EnhancedMeasurementSettings, error) { |
| return c.internalClient.GetEnhancedMeasurementSettings(ctx, req, opts...) |
| } |
| |
| // UpdateEnhancedMeasurementSettings updates the enhanced measurement settings for this data stream. |
| // Note that the stream must enable enhanced measurement for these settings to |
| // take effect. |
| func (c *AnalyticsAdminClient) UpdateEnhancedMeasurementSettings(ctx context.Context, req *adminpb.UpdateEnhancedMeasurementSettingsRequest, opts ...gax.CallOption) (*adminpb.EnhancedMeasurementSettings, error) { |
| return c.internalClient.UpdateEnhancedMeasurementSettings(ctx, req, opts...) |
| } |
| |
| // CreateConnectedSiteTag creates a connected site tag for a Universal Analytics property. You can |
| // create a maximum of 20 connected site tags per property. |
| // Note: This API cannot be used on GA4 properties. |
| func (c *AnalyticsAdminClient) CreateConnectedSiteTag(ctx context.Context, req *adminpb.CreateConnectedSiteTagRequest, opts ...gax.CallOption) (*adminpb.CreateConnectedSiteTagResponse, error) { |
| return c.internalClient.CreateConnectedSiteTag(ctx, req, opts...) |
| } |
| |
| // DeleteConnectedSiteTag deletes a connected site tag for a Universal Analytics property. |
| // Note: this has no effect on GA4 properties. |
| func (c *AnalyticsAdminClient) DeleteConnectedSiteTag(ctx context.Context, req *adminpb.DeleteConnectedSiteTagRequest, opts ...gax.CallOption) error { |
| return c.internalClient.DeleteConnectedSiteTag(ctx, req, opts...) |
| } |
| |
| // ListConnectedSiteTags lists the connected site tags for a Universal Analytics property. A maximum |
| // of 20 connected site tags will be returned. Note: this has no effect on GA4 |
| // property. |
| func (c *AnalyticsAdminClient) ListConnectedSiteTags(ctx context.Context, req *adminpb.ListConnectedSiteTagsRequest, opts ...gax.CallOption) (*adminpb.ListConnectedSiteTagsResponse, error) { |
| return c.internalClient.ListConnectedSiteTags(ctx, req, opts...) |
| } |
| |
| // FetchConnectedGa4Property given a specified UA property, looks up the GA4 property connected to it. |
| // Note: this cannot be used with GA4 properties. |
| func (c *AnalyticsAdminClient) FetchConnectedGa4Property(ctx context.Context, req *adminpb.FetchConnectedGa4PropertyRequest, opts ...gax.CallOption) (*adminpb.FetchConnectedGa4PropertyResponse, error) { |
| return c.internalClient.FetchConnectedGa4Property(ctx, req, opts...) |
| } |
| |
| // GetAdSenseLink looks up a single AdSenseLink. |
| func (c *AnalyticsAdminClient) GetAdSenseLink(ctx context.Context, req *adminpb.GetAdSenseLinkRequest, opts ...gax.CallOption) (*adminpb.AdSenseLink, error) { |
| return c.internalClient.GetAdSenseLink(ctx, req, opts...) |
| } |
| |
| // CreateAdSenseLink creates an AdSenseLink. |
| func (c *AnalyticsAdminClient) CreateAdSenseLink(ctx context.Context, req *adminpb.CreateAdSenseLinkRequest, opts ...gax.CallOption) (*adminpb.AdSenseLink, error) { |
| return c.internalClient.CreateAdSenseLink(ctx, req, opts...) |
| } |
| |
| // DeleteAdSenseLink deletes an AdSenseLink. |
| func (c *AnalyticsAdminClient) DeleteAdSenseLink(ctx context.Context, req *adminpb.DeleteAdSenseLinkRequest, opts ...gax.CallOption) error { |
| return c.internalClient.DeleteAdSenseLink(ctx, req, opts...) |
| } |
| |
| // ListAdSenseLinks lists AdSenseLinks on a property. |
| func (c *AnalyticsAdminClient) ListAdSenseLinks(ctx context.Context, req *adminpb.ListAdSenseLinksRequest, opts ...gax.CallOption) *AdSenseLinkIterator { |
| return c.internalClient.ListAdSenseLinks(ctx, req, opts...) |
| } |
| |
| // GetEventCreateRule lookup for a single EventCreateRule. |
| func (c *AnalyticsAdminClient) GetEventCreateRule(ctx context.Context, req *adminpb.GetEventCreateRuleRequest, opts ...gax.CallOption) (*adminpb.EventCreateRule, error) { |
| return c.internalClient.GetEventCreateRule(ctx, req, opts...) |
| } |
| |
| // ListEventCreateRules lists EventCreateRules on a web data stream. |
| func (c *AnalyticsAdminClient) ListEventCreateRules(ctx context.Context, req *adminpb.ListEventCreateRulesRequest, opts ...gax.CallOption) *EventCreateRuleIterator { |
| return c.internalClient.ListEventCreateRules(ctx, req, opts...) |
| } |
| |
| // CreateEventCreateRule creates an EventCreateRule. |
| func (c *AnalyticsAdminClient) CreateEventCreateRule(ctx context.Context, req *adminpb.CreateEventCreateRuleRequest, opts ...gax.CallOption) (*adminpb.EventCreateRule, error) { |
| return c.internalClient.CreateEventCreateRule(ctx, req, opts...) |
| } |
| |
| // UpdateEventCreateRule updates an EventCreateRule. |
| func (c *AnalyticsAdminClient) UpdateEventCreateRule(ctx context.Context, req *adminpb.UpdateEventCreateRuleRequest, opts ...gax.CallOption) (*adminpb.EventCreateRule, error) { |
| return c.internalClient.UpdateEventCreateRule(ctx, req, opts...) |
| } |
| |
| // DeleteEventCreateRule deletes an EventCreateRule. |
| func (c *AnalyticsAdminClient) DeleteEventCreateRule(ctx context.Context, req *adminpb.DeleteEventCreateRuleRequest, opts ...gax.CallOption) error { |
| return c.internalClient.DeleteEventCreateRule(ctx, req, opts...) |
| } |
| |
| // UpdateDataRedactionSettings updates a DataRedactionSettings on a property. |
| func (c *AnalyticsAdminClient) UpdateDataRedactionSettings(ctx context.Context, req *adminpb.UpdateDataRedactionSettingsRequest, opts ...gax.CallOption) (*adminpb.DataRedactionSettings, error) { |
| return c.internalClient.UpdateDataRedactionSettings(ctx, req, opts...) |
| } |
| |
| // GetDataRedactionSettings lookup for a single DataRedactionSettings. |
| func (c *AnalyticsAdminClient) GetDataRedactionSettings(ctx context.Context, req *adminpb.GetDataRedactionSettingsRequest, opts ...gax.CallOption) (*adminpb.DataRedactionSettings, error) { |
| return c.internalClient.GetDataRedactionSettings(ctx, req, opts...) |
| } |
| |
| // GetCalculatedMetric lookup for a single CalculatedMetric. |
| func (c *AnalyticsAdminClient) GetCalculatedMetric(ctx context.Context, req *adminpb.GetCalculatedMetricRequest, opts ...gax.CallOption) (*adminpb.CalculatedMetric, error) { |
| return c.internalClient.GetCalculatedMetric(ctx, req, opts...) |
| } |
| |
| // CreateCalculatedMetric creates a CalculatedMetric. |
| func (c *AnalyticsAdminClient) CreateCalculatedMetric(ctx context.Context, req *adminpb.CreateCalculatedMetricRequest, opts ...gax.CallOption) (*adminpb.CalculatedMetric, error) { |
| return c.internalClient.CreateCalculatedMetric(ctx, req, opts...) |
| } |
| |
| // ListCalculatedMetrics lists CalculatedMetrics on a property. |
| func (c *AnalyticsAdminClient) ListCalculatedMetrics(ctx context.Context, req *adminpb.ListCalculatedMetricsRequest, opts ...gax.CallOption) *CalculatedMetricIterator { |
| return c.internalClient.ListCalculatedMetrics(ctx, req, opts...) |
| } |
| |
| // UpdateCalculatedMetric updates a CalculatedMetric on a property. |
| func (c *AnalyticsAdminClient) UpdateCalculatedMetric(ctx context.Context, req *adminpb.UpdateCalculatedMetricRequest, opts ...gax.CallOption) (*adminpb.CalculatedMetric, error) { |
| return c.internalClient.UpdateCalculatedMetric(ctx, req, opts...) |
| } |
| |
| // DeleteCalculatedMetric deletes a CalculatedMetric on a property. |
| func (c *AnalyticsAdminClient) DeleteCalculatedMetric(ctx context.Context, req *adminpb.DeleteCalculatedMetricRequest, opts ...gax.CallOption) error { |
| return c.internalClient.DeleteCalculatedMetric(ctx, req, opts...) |
| } |
| |
| // CreateRollupProperty create a roll-up property and all roll-up property source links. |
| func (c *AnalyticsAdminClient) CreateRollupProperty(ctx context.Context, req *adminpb.CreateRollupPropertyRequest, opts ...gax.CallOption) (*adminpb.CreateRollupPropertyResponse, error) { |
| return c.internalClient.CreateRollupProperty(ctx, req, opts...) |
| } |
| |
| // GetRollupPropertySourceLink lookup for a single roll-up property source Link. |
| // Only roll-up properties can have source links, so this method will throw an |
| // error if used on other types of properties. |
| func (c *AnalyticsAdminClient) GetRollupPropertySourceLink(ctx context.Context, req *adminpb.GetRollupPropertySourceLinkRequest, opts ...gax.CallOption) (*adminpb.RollupPropertySourceLink, error) { |
| return c.internalClient.GetRollupPropertySourceLink(ctx, req, opts...) |
| } |
| |
| // ListRollupPropertySourceLinks lists roll-up property source Links on a property. |
| // Only roll-up properties can have source links, so this method will throw an |
| // error if used on other types of properties. |
| func (c *AnalyticsAdminClient) ListRollupPropertySourceLinks(ctx context.Context, req *adminpb.ListRollupPropertySourceLinksRequest, opts ...gax.CallOption) *RollupPropertySourceLinkIterator { |
| return c.internalClient.ListRollupPropertySourceLinks(ctx, req, opts...) |
| } |
| |
| // CreateRollupPropertySourceLink creates a roll-up property source link. |
| // Only roll-up properties can have source links, so this method will throw an |
| // error if used on other types of properties. |
| func (c *AnalyticsAdminClient) CreateRollupPropertySourceLink(ctx context.Context, req *adminpb.CreateRollupPropertySourceLinkRequest, opts ...gax.CallOption) (*adminpb.RollupPropertySourceLink, error) { |
| return c.internalClient.CreateRollupPropertySourceLink(ctx, req, opts...) |
| } |
| |
| // DeleteRollupPropertySourceLink deletes a roll-up property source link. |
| // Only roll-up properties can have source links, so this method will throw an |
| // error if used on other types of properties. |
| func (c *AnalyticsAdminClient) DeleteRollupPropertySourceLink(ctx context.Context, req *adminpb.DeleteRollupPropertySourceLinkRequest, opts ...gax.CallOption) error { |
| return c.internalClient.DeleteRollupPropertySourceLink(ctx, req, opts...) |
| } |
| |
| // CreateSubproperty create a subproperty and a subproperty event filter that applies to the |
| // created subproperty. |
| func (c *AnalyticsAdminClient) CreateSubproperty(ctx context.Context, req *adminpb.CreateSubpropertyRequest, opts ...gax.CallOption) (*adminpb.CreateSubpropertyResponse, error) { |
| return c.internalClient.CreateSubproperty(ctx, req, opts...) |
| } |
| |
| // CreateSubpropertyEventFilter creates a subproperty Event Filter. |
| func (c *AnalyticsAdminClient) CreateSubpropertyEventFilter(ctx context.Context, req *adminpb.CreateSubpropertyEventFilterRequest, opts ...gax.CallOption) (*adminpb.SubpropertyEventFilter, error) { |
| return c.internalClient.CreateSubpropertyEventFilter(ctx, req, opts...) |
| } |
| |
| // GetSubpropertyEventFilter lookup for a single subproperty Event Filter. |
| func (c *AnalyticsAdminClient) GetSubpropertyEventFilter(ctx context.Context, req *adminpb.GetSubpropertyEventFilterRequest, opts ...gax.CallOption) (*adminpb.SubpropertyEventFilter, error) { |
| return c.internalClient.GetSubpropertyEventFilter(ctx, req, opts...) |
| } |
| |
| // ListSubpropertyEventFilters list all subproperty Event Filters on a property. |
| func (c *AnalyticsAdminClient) ListSubpropertyEventFilters(ctx context.Context, req *adminpb.ListSubpropertyEventFiltersRequest, opts ...gax.CallOption) *SubpropertyEventFilterIterator { |
| return c.internalClient.ListSubpropertyEventFilters(ctx, req, opts...) |
| } |
| |
| // UpdateSubpropertyEventFilter updates a subproperty Event Filter. |
| func (c *AnalyticsAdminClient) UpdateSubpropertyEventFilter(ctx context.Context, req *adminpb.UpdateSubpropertyEventFilterRequest, opts ...gax.CallOption) (*adminpb.SubpropertyEventFilter, error) { |
| return c.internalClient.UpdateSubpropertyEventFilter(ctx, req, opts...) |
| } |
| |
| // DeleteSubpropertyEventFilter deletes a subproperty event filter. |
| func (c *AnalyticsAdminClient) DeleteSubpropertyEventFilter(ctx context.Context, req *adminpb.DeleteSubpropertyEventFilterRequest, opts ...gax.CallOption) error { |
| return c.internalClient.DeleteSubpropertyEventFilter(ctx, req, opts...) |
| } |
| |
| // analyticsAdminGRPCClient is a client for interacting with Google Analytics Admin API over gRPC transport. |
| // |
| // Methods, except Close, may be called concurrently. However, fields must not be modified concurrently with method calls. |
| type analyticsAdminGRPCClient struct { |
| // Connection pool of gRPC connections to the service. |
| connPool gtransport.ConnPool |
| |
| // Points back to the CallOptions field of the containing AnalyticsAdminClient |
| CallOptions **AnalyticsAdminCallOptions |
| |
| // The gRPC API client. |
| analyticsAdminClient adminpb.AnalyticsAdminServiceClient |
| |
| // The x-goog-* metadata to be sent with each request. |
| xGoogHeaders []string |
| } |
| |
| // NewAnalyticsAdminClient creates a new analytics admin service client based on gRPC. |
| // The returned client must be Closed when it is done being used to clean up its underlying connections. |
| // |
| // Service Interface for the Analytics Admin API (GA4). |
| func NewAnalyticsAdminClient(ctx context.Context, opts ...option.ClientOption) (*AnalyticsAdminClient, error) { |
| clientOpts := defaultAnalyticsAdminGRPCClientOptions() |
| if newAnalyticsAdminClientHook != nil { |
| hookOpts, err := newAnalyticsAdminClientHook(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 := AnalyticsAdminClient{CallOptions: defaultAnalyticsAdminCallOptions()} |
| |
| c := &analyticsAdminGRPCClient{ |
| connPool: connPool, |
| analyticsAdminClient: adminpb.NewAnalyticsAdminServiceClient(connPool), |
| CallOptions: &client.CallOptions, |
| } |
| c.setGoogleClientInfo() |
| |
| client.internalClient = c |
| |
| 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 *analyticsAdminGRPCClient) 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 *analyticsAdminGRPCClient) setGoogleClientInfo(keyval ...string) { |
| kv := append([]string{"gl-go", gax.GoVersion}, keyval...) |
| kv = append(kv, "gapic", getVersionClient(), "gax", gax.Version, "grpc", grpc.Version) |
| 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 *analyticsAdminGRPCClient) Close() error { |
| return c.connPool.Close() |
| } |
| |
| // Methods, except Close, may be called concurrently. However, fields must not be modified concurrently with method calls. |
| type analyticsAdminRESTClient struct { |
| // The http endpoint to connect to. |
| endpoint string |
| |
| // The http client. |
| httpClient *http.Client |
| |
| // The x-goog-* headers to be sent with each request. |
| xGoogHeaders []string |
| |
| // Points back to the CallOptions field of the containing AnalyticsAdminClient |
| CallOptions **AnalyticsAdminCallOptions |
| } |
| |
| // NewAnalyticsAdminRESTClient creates a new analytics admin service rest client. |
| // |
| // Service Interface for the Analytics Admin API (GA4). |
| func NewAnalyticsAdminRESTClient(ctx context.Context, opts ...option.ClientOption) (*AnalyticsAdminClient, error) { |
| clientOpts := append(defaultAnalyticsAdminRESTClientOptions(), opts...) |
| httpClient, endpoint, err := httptransport.NewClient(ctx, clientOpts...) |
| if err != nil { |
| return nil, err |
| } |
| |
| callOpts := defaultAnalyticsAdminRESTCallOptions() |
| c := &analyticsAdminRESTClient{ |
| endpoint: endpoint, |
| httpClient: httpClient, |
| CallOptions: &callOpts, |
| } |
| c.setGoogleClientInfo() |
| |
| return &AnalyticsAdminClient{internalClient: c, CallOptions: callOpts}, nil |
| } |
| |
| func defaultAnalyticsAdminRESTClientOptions() []option.ClientOption { |
| return []option.ClientOption{ |
| internaloption.WithDefaultEndpoint("https://analyticsadmin.googleapis.com"), |
| internaloption.WithDefaultEndpointTemplate("https://analyticsadmin.UNIVERSE_DOMAIN"), |
| internaloption.WithDefaultMTLSEndpoint("https://analyticsadmin.mtls.googleapis.com"), |
| internaloption.WithDefaultUniverseDomain("googleapis.com"), |
| internaloption.WithDefaultAudience("https://analyticsadmin.googleapis.com/"), |
| internaloption.WithDefaultScopes(DefaultAuthScopes()...), |
| } |
| } |
| |
| // 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 *analyticsAdminRESTClient) setGoogleClientInfo(keyval ...string) { |
| kv := append([]string{"gl-go", gax.GoVersion}, keyval...) |
| kv = append(kv, "gapic", getVersionClient(), "gax", gax.Version, "rest", "UNKNOWN") |
| 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 *analyticsAdminRESTClient) 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 *analyticsAdminRESTClient) Connection() *grpc.ClientConn { |
| return nil |
| } |
| func (c *analyticsAdminGRPCClient) GetAccount(ctx context.Context, req *adminpb.GetAccountRequest, opts ...gax.CallOption) (*adminpb.Account, 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).GetAccount[0:len((*c.CallOptions).GetAccount):len((*c.CallOptions).GetAccount)], opts...) |
| var resp *adminpb.Account |
| err := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error { |
| var err error |
| resp, err = c.analyticsAdminClient.GetAccount(ctx, req, settings.GRPC...) |
| return err |
| }, opts...) |
| if err != nil { |
| return nil, err |
| } |
| return resp, nil |
| } |
| |
| func (c *analyticsAdminGRPCClient) ListAccounts(ctx context.Context, req *adminpb.ListAccountsRequest, opts ...gax.CallOption) *AccountIterator { |
| ctx = gax.InsertMetadataIntoOutgoingContext(ctx, c.xGoogHeaders...) |
| opts = append((*c.CallOptions).ListAccounts[0:len((*c.CallOptions).ListAccounts):len((*c.CallOptions).ListAccounts)], opts...) |
| it := &AccountIterator{} |
| req = proto.Clone(req).(*adminpb.ListAccountsRequest) |
| it.InternalFetch = func(pageSize int, pageToken string) ([]*adminpb.Account, string, error) { |
| resp := &adminpb.ListAccountsResponse{} |
| 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 = c.analyticsAdminClient.ListAccounts(ctx, req, settings.GRPC...) |
| return err |
| }, opts...) |
| if err != nil { |
| return nil, "", err |
| } |
| |
| it.Response = resp |
| return resp.GetAccounts(), 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 *analyticsAdminGRPCClient) DeleteAccount(ctx context.Context, req *adminpb.DeleteAccountRequest, 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).DeleteAccount[0:len((*c.CallOptions).DeleteAccount):len((*c.CallOptions).DeleteAccount)], opts...) |
| err := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error { |
| var err error |
| _, err = c.analyticsAdminClient.DeleteAccount(ctx, req, settings.GRPC...) |
| return err |
| }, opts...) |
| return err |
| } |
| |
| func (c *analyticsAdminGRPCClient) UpdateAccount(ctx context.Context, req *adminpb.UpdateAccountRequest, opts ...gax.CallOption) (*adminpb.Account, error) { |
| hds := []string{"x-goog-request-params", fmt.Sprintf("%s=%v", "account.name", url.QueryEscape(req.GetAccount().GetName()))} |
| |
| hds = append(c.xGoogHeaders, hds...) |
| ctx = gax.InsertMetadataIntoOutgoingContext(ctx, hds...) |
| opts = append((*c.CallOptions).UpdateAccount[0:len((*c.CallOptions).UpdateAccount):len((*c.CallOptions).UpdateAccount)], opts...) |
| var resp *adminpb.Account |
| err := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error { |
| var err error |
| resp, err = c.analyticsAdminClient.UpdateAccount(ctx, req, settings.GRPC...) |
| return err |
| }, opts...) |
| if err != nil { |
| return nil, err |
| } |
| return resp, nil |
| } |
| |
| func (c *analyticsAdminGRPCClient) ProvisionAccountTicket(ctx context.Context, req *adminpb.ProvisionAccountTicketRequest, opts ...gax.CallOption) (*adminpb.ProvisionAccountTicketResponse, error) { |
| ctx = gax.InsertMetadataIntoOutgoingContext(ctx, c.xGoogHeaders...) |
| opts = append((*c.CallOptions).ProvisionAccountTicket[0:len((*c.CallOptions).ProvisionAccountTicket):len((*c.CallOptions).ProvisionAccountTicket)], opts...) |
| var resp *adminpb.ProvisionAccountTicketResponse |
| err := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error { |
| var err error |
| resp, err = c.analyticsAdminClient.ProvisionAccountTicket(ctx, req, settings.GRPC...) |
| return err |
| }, opts...) |
| if err != nil { |
| return nil, err |
| } |
| return resp, nil |
| } |
| |
| func (c *analyticsAdminGRPCClient) ListAccountSummaries(ctx context.Context, req *adminpb.ListAccountSummariesRequest, opts ...gax.CallOption) *AccountSummaryIterator { |
| ctx = gax.InsertMetadataIntoOutgoingContext(ctx, c.xGoogHeaders...) |
| opts = append((*c.CallOptions).ListAccountSummaries[0:len((*c.CallOptions).ListAccountSummaries):len((*c.CallOptions).ListAccountSummaries)], opts...) |
| it := &AccountSummaryIterator{} |
| req = proto.Clone(req).(*adminpb.ListAccountSummariesRequest) |
| it.InternalFetch = func(pageSize int, pageToken string) ([]*adminpb.AccountSummary, string, error) { |
| resp := &adminpb.ListAccountSummariesResponse{} |
| 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 = c.analyticsAdminClient.ListAccountSummaries(ctx, req, settings.GRPC...) |
| return err |
| }, opts...) |
| if err != nil { |
| return nil, "", err |
| } |
| |
| it.Response = resp |
| return resp.GetAccountSummaries(), 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 *analyticsAdminGRPCClient) GetProperty(ctx context.Context, req *adminpb.GetPropertyRequest, opts ...gax.CallOption) (*adminpb.Property, 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).GetProperty[0:len((*c.CallOptions).GetProperty):len((*c.CallOptions).GetProperty)], opts...) |
| var resp *adminpb.Property |
| err := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error { |
| var err error |
| resp, err = c.analyticsAdminClient.GetProperty(ctx, req, settings.GRPC...) |
| return err |
| }, opts...) |
| if err != nil { |
| return nil, err |
| } |
| return resp, nil |
| } |
| |
| func (c *analyticsAdminGRPCClient) ListProperties(ctx context.Context, req *adminpb.ListPropertiesRequest, opts ...gax.CallOption) *PropertyIterator { |
| ctx = gax.InsertMetadataIntoOutgoingContext(ctx, c.xGoogHeaders...) |
| opts = append((*c.CallOptions).ListProperties[0:len((*c.CallOptions).ListProperties):len((*c.CallOptions).ListProperties)], opts...) |
| it := &PropertyIterator{} |
| req = proto.Clone(req).(*adminpb.ListPropertiesRequest) |
| it.InternalFetch = func(pageSize int, pageToken string) ([]*adminpb.Property, string, error) { |
| resp := &adminpb.ListPropertiesResponse{} |
| 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 = c.analyticsAdminClient.ListProperties(ctx, req, settings.GRPC...) |
| return err |
| }, opts...) |
| if err != nil { |
| return nil, "", err |
| } |
| |
| it.Response = resp |
| return resp.GetProperties(), 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 *analyticsAdminGRPCClient) CreateProperty(ctx context.Context, req *adminpb.CreatePropertyRequest, opts ...gax.CallOption) (*adminpb.Property, error) { |
| ctx = gax.InsertMetadataIntoOutgoingContext(ctx, c.xGoogHeaders...) |
| opts = append((*c.CallOptions).CreateProperty[0:len((*c.CallOptions).CreateProperty):len((*c.CallOptions).CreateProperty)], opts...) |
| var resp *adminpb.Property |
| err := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error { |
| var err error |
| resp, err = c.analyticsAdminClient.CreateProperty(ctx, req, settings.GRPC...) |
| return err |
| }, opts...) |
| if err != nil { |
| return nil, err |
| } |
| return resp, nil |
| } |
| |
| func (c *analyticsAdminGRPCClient) DeleteProperty(ctx context.Context, req *adminpb.DeletePropertyRequest, opts ...gax.CallOption) (*adminpb.Property, 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).DeleteProperty[0:len((*c.CallOptions).DeleteProperty):len((*c.CallOptions).DeleteProperty)], opts...) |
| var resp *adminpb.Property |
| err := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error { |
| var err error |
| resp, err = c.analyticsAdminClient.DeleteProperty(ctx, req, settings.GRPC...) |
| return err |
| }, opts...) |
| if err != nil { |
| return nil, err |
| } |
| return resp, nil |
| } |
| |
| func (c *analyticsAdminGRPCClient) UpdateProperty(ctx context.Context, req *adminpb.UpdatePropertyRequest, opts ...gax.CallOption) (*adminpb.Property, error) { |
| hds := []string{"x-goog-request-params", fmt.Sprintf("%s=%v", "property.name", url.QueryEscape(req.GetProperty().GetName()))} |
| |
| hds = append(c.xGoogHeaders, hds...) |
| ctx = gax.InsertMetadataIntoOutgoingContext(ctx, hds...) |
| opts = append((*c.CallOptions).UpdateProperty[0:len((*c.CallOptions).UpdateProperty):len((*c.CallOptions).UpdateProperty)], opts...) |
| var resp *adminpb.Property |
| err := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error { |
| var err error |
| resp, err = c.analyticsAdminClient.UpdateProperty(ctx, req, settings.GRPC...) |
| return err |
| }, opts...) |
| if err != nil { |
| return nil, err |
| } |
| return resp, nil |
| } |
| |
| func (c *analyticsAdminGRPCClient) CreateFirebaseLink(ctx context.Context, req *adminpb.CreateFirebaseLinkRequest, opts ...gax.CallOption) (*adminpb.FirebaseLink, 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).CreateFirebaseLink[0:len((*c.CallOptions).CreateFirebaseLink):len((*c.CallOptions).CreateFirebaseLink)], opts...) |
| var resp *adminpb.FirebaseLink |
| err := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error { |
| var err error |
| resp, err = c.analyticsAdminClient.CreateFirebaseLink(ctx, req, settings.GRPC...) |
| return err |
| }, opts...) |
| if err != nil { |
| return nil, err |
| } |
| return resp, nil |
| } |
| |
| func (c *analyticsAdminGRPCClient) DeleteFirebaseLink(ctx context.Context, req *adminpb.DeleteFirebaseLinkRequest, 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).DeleteFirebaseLink[0:len((*c.CallOptions).DeleteFirebaseLink):len((*c.CallOptions).DeleteFirebaseLink)], opts...) |
| err := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error { |
| var err error |
| _, err = c.analyticsAdminClient.DeleteFirebaseLink(ctx, req, settings.GRPC...) |
| return err |
| }, opts...) |
| return err |
| } |
| |
| func (c *analyticsAdminGRPCClient) ListFirebaseLinks(ctx context.Context, req *adminpb.ListFirebaseLinksRequest, opts ...gax.CallOption) *FirebaseLinkIterator { |
| 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).ListFirebaseLinks[0:len((*c.CallOptions).ListFirebaseLinks):len((*c.CallOptions).ListFirebaseLinks)], opts...) |
| it := &FirebaseLinkIterator{} |
| req = proto.Clone(req).(*adminpb.ListFirebaseLinksRequest) |
| it.InternalFetch = func(pageSize int, pageToken string) ([]*adminpb.FirebaseLink, string, error) { |
| resp := &adminpb.ListFirebaseLinksResponse{} |
| 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 = c.analyticsAdminClient.ListFirebaseLinks(ctx, req, settings.GRPC...) |
| return err |
| }, opts...) |
| if err != nil { |
| return nil, "", err |
| } |
| |
| it.Response = resp |
| return resp.GetFirebaseLinks(), 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 *analyticsAdminGRPCClient) GetGlobalSiteTag(ctx context.Context, req *adminpb.GetGlobalSiteTagRequest, opts ...gax.CallOption) (*adminpb.GlobalSiteTag, 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).GetGlobalSiteTag[0:len((*c.CallOptions).GetGlobalSiteTag):len((*c.CallOptions).GetGlobalSiteTag)], opts...) |
| var resp *adminpb.GlobalSiteTag |
| err := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error { |
| var err error |
| resp, err = c.analyticsAdminClient.GetGlobalSiteTag(ctx, req, settings.GRPC...) |
| return err |
| }, opts...) |
| if err != nil { |
| return nil, err |
| } |
| return resp, nil |
| } |
| |
| func (c *analyticsAdminGRPCClient) CreateGoogleAdsLink(ctx context.Context, req *adminpb.CreateGoogleAdsLinkRequest, opts ...gax.CallOption) (*adminpb.GoogleAdsLink, 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).CreateGoogleAdsLink[0:len((*c.CallOptions).CreateGoogleAdsLink):len((*c.CallOptions).CreateGoogleAdsLink)], opts...) |
| var resp *adminpb.GoogleAdsLink |
| err := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error { |
| var err error |
| resp, err = c.analyticsAdminClient.CreateGoogleAdsLink(ctx, req, settings.GRPC...) |
| return err |
| }, opts...) |
| if err != nil { |
| return nil, err |
| } |
| return resp, nil |
| } |
| |
| func (c *analyticsAdminGRPCClient) UpdateGoogleAdsLink(ctx context.Context, req *adminpb.UpdateGoogleAdsLinkRequest, opts ...gax.CallOption) (*adminpb.GoogleAdsLink, error) { |
| hds := []string{"x-goog-request-params", fmt.Sprintf("%s=%v", "google_ads_link.name", url.QueryEscape(req.GetGoogleAdsLink().GetName()))} |
| |
| hds = append(c.xGoogHeaders, hds...) |
| ctx = gax.InsertMetadataIntoOutgoingContext(ctx, hds...) |
| opts = append((*c.CallOptions).UpdateGoogleAdsLink[0:len((*c.CallOptions).UpdateGoogleAdsLink):len((*c.CallOptions).UpdateGoogleAdsLink)], opts...) |
| var resp *adminpb.GoogleAdsLink |
| err := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error { |
| var err error |
| resp, err = c.analyticsAdminClient.UpdateGoogleAdsLink(ctx, req, settings.GRPC...) |
| return err |
| }, opts...) |
| if err != nil { |
| return nil, err |
| } |
| return resp, nil |
| } |
| |
| func (c *analyticsAdminGRPCClient) DeleteGoogleAdsLink(ctx context.Context, req *adminpb.DeleteGoogleAdsLinkRequest, 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).DeleteGoogleAdsLink[0:len((*c.CallOptions).DeleteGoogleAdsLink):len((*c.CallOptions).DeleteGoogleAdsLink)], opts...) |
| err := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error { |
| var err error |
| _, err = c.analyticsAdminClient.DeleteGoogleAdsLink(ctx, req, settings.GRPC...) |
| return err |
| }, opts...) |
| return err |
| } |
| |
| func (c *analyticsAdminGRPCClient) ListGoogleAdsLinks(ctx context.Context, req *adminpb.ListGoogleAdsLinksRequest, opts ...gax.CallOption) *GoogleAdsLinkIterator { |
| 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).ListGoogleAdsLinks[0:len((*c.CallOptions).ListGoogleAdsLinks):len((*c.CallOptions).ListGoogleAdsLinks)], opts...) |
| it := &GoogleAdsLinkIterator{} |
| req = proto.Clone(req).(*adminpb.ListGoogleAdsLinksRequest) |
| it.InternalFetch = func(pageSize int, pageToken string) ([]*adminpb.GoogleAdsLink, string, error) { |
| resp := &adminpb.ListGoogleAdsLinksResponse{} |
| 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 = c.analyticsAdminClient.ListGoogleAdsLinks(ctx, req, settings.GRPC...) |
| return err |
| }, opts...) |
| if err != nil { |
| return nil, "", err |
| } |
| |
| it.Response = resp |
| return resp.GetGoogleAdsLinks(), 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 *analyticsAdminGRPCClient) GetDataSharingSettings(ctx context.Context, req *adminpb.GetDataSharingSettingsRequest, opts ...gax.CallOption) (*adminpb.DataSharingSettings, 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).GetDataSharingSettings[0:len((*c.CallOptions).GetDataSharingSettings):len((*c.CallOptions).GetDataSharingSettings)], opts...) |
| var resp *adminpb.DataSharingSettings |
| err := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error { |
| var err error |
| resp, err = c.analyticsAdminClient.GetDataSharingSettings(ctx, req, settings.GRPC...) |
| return err |
| }, opts...) |
| if err != nil { |
| return nil, err |
| } |
| return resp, nil |
| } |
| |
| func (c *analyticsAdminGRPCClient) GetMeasurementProtocolSecret(ctx context.Context, req *adminpb.GetMeasurementProtocolSecretRequest, opts ...gax.CallOption) (*adminpb.MeasurementProtocolSecret, 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).GetMeasurementProtocolSecret[0:len((*c.CallOptions).GetMeasurementProtocolSecret):len((*c.CallOptions).GetMeasurementProtocolSecret)], opts...) |
| var resp *adminpb.MeasurementProtocolSecret |
| err := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error { |
| var err error |
| resp, err = c.analyticsAdminClient.GetMeasurementProtocolSecret(ctx, req, settings.GRPC...) |
| return err |
| }, opts...) |
| if err != nil { |
| return nil, err |
| } |
| return resp, nil |
| } |
| |
| func (c *analyticsAdminGRPCClient) ListMeasurementProtocolSecrets(ctx context.Context, req *adminpb.ListMeasurementProtocolSecretsRequest, opts ...gax.CallOption) *MeasurementProtocolSecretIterator { |
| 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).ListMeasurementProtocolSecrets[0:len((*c.CallOptions).ListMeasurementProtocolSecrets):len((*c.CallOptions).ListMeasurementProtocolSecrets)], opts...) |
| it := &MeasurementProtocolSecretIterator{} |
| req = proto.Clone(req).(*adminpb.ListMeasurementProtocolSecretsRequest) |
| it.InternalFetch = func(pageSize int, pageToken string) ([]*adminpb.MeasurementProtocolSecret, string, error) { |
| resp := &adminpb.ListMeasurementProtocolSecretsResponse{} |
| 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 = c.analyticsAdminClient.ListMeasurementProtocolSecrets(ctx, req, settings.GRPC...) |
| return err |
| }, opts...) |
| if err != nil { |
| return nil, "", err |
| } |
| |
| it.Response = resp |
| return resp.GetMeasurementProtocolSecrets(), 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 *analyticsAdminGRPCClient) CreateMeasurementProtocolSecret(ctx context.Context, req *adminpb.CreateMeasurementProtocolSecretRequest, opts ...gax.CallOption) (*adminpb.MeasurementProtocolSecret, 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).CreateMeasurementProtocolSecret[0:len((*c.CallOptions).CreateMeasurementProtocolSecret):len((*c.CallOptions).CreateMeasurementProtocolSecret)], opts...) |
| var resp *adminpb.MeasurementProtocolSecret |
| err := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error { |
| var err error |
| resp, err = c.analyticsAdminClient.CreateMeasurementProtocolSecret(ctx, req, settings.GRPC...) |
| return err |
| }, opts...) |
| if err != nil { |
| return nil, err |
| } |
| return resp, nil |
| } |
| |
| func (c *analyticsAdminGRPCClient) DeleteMeasurementProtocolSecret(ctx context.Context, req *adminpb.DeleteMeasurementProtocolSecretRequest, 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).DeleteMeasurementProtocolSecret[0:len((*c.CallOptions).DeleteMeasurementProtocolSecret):len((*c.CallOptions).DeleteMeasurementProtocolSecret)], opts...) |
| err := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error { |
| var err error |
| _, err = c.analyticsAdminClient.DeleteMeasurementProtocolSecret(ctx, req, settings.GRPC...) |
| return err |
| }, opts...) |
| return err |
| } |
| |
| func (c *analyticsAdminGRPCClient) UpdateMeasurementProtocolSecret(ctx context.Context, req *adminpb.UpdateMeasurementProtocolSecretRequest, opts ...gax.CallOption) (*adminpb.MeasurementProtocolSecret, error) { |
| hds := []string{"x-goog-request-params", fmt.Sprintf("%s=%v", "measurement_protocol_secret.name", url.QueryEscape(req.GetMeasurementProtocolSecret().GetName()))} |
| |
| hds = append(c.xGoogHeaders, hds...) |
| ctx = gax.InsertMetadataIntoOutgoingContext(ctx, hds...) |
| opts = append((*c.CallOptions).UpdateMeasurementProtocolSecret[0:len((*c.CallOptions).UpdateMeasurementProtocolSecret):len((*c.CallOptions).UpdateMeasurementProtocolSecret)], opts...) |
| var resp *adminpb.MeasurementProtocolSecret |
| err := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error { |
| var err error |
| resp, err = c.analyticsAdminClient.UpdateMeasurementProtocolSecret(ctx, req, settings.GRPC...) |
| return err |
| }, opts...) |
| if err != nil { |
| return nil, err |
| } |
| return resp, nil |
| } |
| |
| func (c *analyticsAdminGRPCClient) AcknowledgeUserDataCollection(ctx context.Context, req *adminpb.AcknowledgeUserDataCollectionRequest, opts ...gax.CallOption) (*adminpb.AcknowledgeUserDataCollectionResponse, error) { |
| hds := []string{"x-goog-request-params", fmt.Sprintf("%s=%v", "property", url.QueryEscape(req.GetProperty()))} |
| |
| hds = append(c.xGoogHeaders, hds...) |
| ctx = gax.InsertMetadataIntoOutgoingContext(ctx, hds...) |
| opts = append((*c.CallOptions).AcknowledgeUserDataCollection[0:len((*c.CallOptions).AcknowledgeUserDataCollection):len((*c.CallOptions).AcknowledgeUserDataCollection)], opts...) |
| var resp *adminpb.AcknowledgeUserDataCollectionResponse |
| err := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error { |
| var err error |
| resp, err = c.analyticsAdminClient.AcknowledgeUserDataCollection(ctx, req, settings.GRPC...) |
| return err |
| }, opts...) |
| if err != nil { |
| return nil, err |
| } |
| return resp, nil |
| } |
| |
| func (c *analyticsAdminGRPCClient) GetSKAdNetworkConversionValueSchema(ctx context.Context, req *adminpb.GetSKAdNetworkConversionValueSchemaRequest, opts ...gax.CallOption) (*adminpb.SKAdNetworkConversionValueSchema, 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).GetSKAdNetworkConversionValueSchema[0:len((*c.CallOptions).GetSKAdNetworkConversionValueSchema):len((*c.CallOptions).GetSKAdNetworkConversionValueSchema)], opts...) |
| var resp *adminpb.SKAdNetworkConversionValueSchema |
| err := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error { |
| var err error |
| resp, err = c.analyticsAdminClient.GetSKAdNetworkConversionValueSchema(ctx, req, settings.GRPC...) |
| return err |
| }, opts...) |
| if err != nil { |
| return nil, err |
| } |
| return resp, nil |
| } |
| |
| func (c *analyticsAdminGRPCClient) CreateSKAdNetworkConversionValueSchema(ctx context.Context, req *adminpb.CreateSKAdNetworkConversionValueSchemaRequest, opts ...gax.CallOption) (*adminpb.SKAdNetworkConversionValueSchema, 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).CreateSKAdNetworkConversionValueSchema[0:len((*c.CallOptions).CreateSKAdNetworkConversionValueSchema):len((*c.CallOptions).CreateSKAdNetworkConversionValueSchema)], opts...) |
| var resp *adminpb.SKAdNetworkConversionValueSchema |
| err := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error { |
| var err error |
| resp, err = c.analyticsAdminClient.CreateSKAdNetworkConversionValueSchema(ctx, req, settings.GRPC...) |
| return err |
| }, opts...) |
| if err != nil { |
| return nil, err |
| } |
| return resp, nil |
| } |
| |
| func (c *analyticsAdminGRPCClient) DeleteSKAdNetworkConversionValueSchema(ctx context.Context, req *adminpb.DeleteSKAdNetworkConversionValueSchemaRequest, 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).DeleteSKAdNetworkConversionValueSchema[0:len((*c.CallOptions).DeleteSKAdNetworkConversionValueSchema):len((*c.CallOptions).DeleteSKAdNetworkConversionValueSchema)], opts...) |
| err := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error { |
| var err error |
| _, err = c.analyticsAdminClient.DeleteSKAdNetworkConversionValueSchema(ctx, req, settings.GRPC...) |
| return err |
| }, opts...) |
| return err |
| } |
| |
| func (c *analyticsAdminGRPCClient) UpdateSKAdNetworkConversionValueSchema(ctx context.Context, req *adminpb.UpdateSKAdNetworkConversionValueSchemaRequest, opts ...gax.CallOption) (*adminpb.SKAdNetworkConversionValueSchema, error) { |
| hds := []string{"x-goog-request-params", fmt.Sprintf("%s=%v", "skadnetwork_conversion_value_schema.name", url.QueryEscape(req.GetSkadnetworkConversionValueSchema().GetName()))} |
| |
| hds = append(c.xGoogHeaders, hds...) |
| ctx = gax.InsertMetadataIntoOutgoingContext(ctx, hds...) |
| opts = append((*c.CallOptions).UpdateSKAdNetworkConversionValueSchema[0:len((*c.CallOptions).UpdateSKAdNetworkConversionValueSchema):len((*c.CallOptions).UpdateSKAdNetworkConversionValueSchema)], opts...) |
| var resp *adminpb.SKAdNetworkConversionValueSchema |
| err := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error { |
| var err error |
| resp, err = c.analyticsAdminClient.UpdateSKAdNetworkConversionValueSchema(ctx, req, settings.GRPC...) |
| return err |
| }, opts...) |
| if err != nil { |
| return nil, err |
| } |
| return resp, nil |
| } |
| |
| func (c *analyticsAdminGRPCClient) ListSKAdNetworkConversionValueSchemas(ctx context.Context, req *adminpb.ListSKAdNetworkConversionValueSchemasRequest, opts ...gax.CallOption) *SKAdNetworkConversionValueSchemaIterator { |
| 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).ListSKAdNetworkConversionValueSchemas[0:len((*c.CallOptions).ListSKAdNetworkConversionValueSchemas):len((*c.CallOptions).ListSKAdNetworkConversionValueSchemas)], opts...) |
| it := &SKAdNetworkConversionValueSchemaIterator{} |
| req = proto.Clone(req).(*adminpb.ListSKAdNetworkConversionValueSchemasRequest) |
| it.InternalFetch = func(pageSize int, pageToken string) ([]*adminpb.SKAdNetworkConversionValueSchema, string, error) { |
| resp := &adminpb.ListSKAdNetworkConversionValueSchemasResponse{} |
| 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 = c.analyticsAdminClient.ListSKAdNetworkConversionValueSchemas(ctx, req, settings.GRPC...) |
| return err |
| }, opts...) |
| if err != nil { |
| return nil, "", err |
| } |
| |
| it.Response = resp |
| return resp.GetSkadnetworkConversionValueSchemas(), 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 *analyticsAdminGRPCClient) SearchChangeHistoryEvents(ctx context.Context, req *adminpb.SearchChangeHistoryEventsRequest, opts ...gax.CallOption) *ChangeHistoryEventIterator { |
| hds := []string{"x-goog-request-params", fmt.Sprintf("%s=%v", "account", url.QueryEscape(req.GetAccount()))} |
| |
| hds = append(c.xGoogHeaders, hds...) |
| ctx = gax.InsertMetadataIntoOutgoingContext(ctx, hds...) |
| opts = append((*c.CallOptions).SearchChangeHistoryEvents[0:len((*c.CallOptions).SearchChangeHistoryEvents):len((*c.CallOptions).SearchChangeHistoryEvents)], opts...) |
| it := &ChangeHistoryEventIterator{} |
| req = proto.Clone(req).(*adminpb.SearchChangeHistoryEventsRequest) |
| it.InternalFetch = func(pageSize int, pageToken string) ([]*adminpb.ChangeHistoryEvent, string, error) { |
| resp := &adminpb.SearchChangeHistoryEventsResponse{} |
| 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 = c.analyticsAdminClient.SearchChangeHistoryEvents(ctx, req, settings.GRPC...) |
| return err |
| }, opts...) |
| if err != nil { |
| return nil, "", err |
| } |
| |
| it.Response = resp |
| return resp.GetChangeHistoryEvents(), 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 *analyticsAdminGRPCClient) GetGoogleSignalsSettings(ctx context.Context, req *adminpb.GetGoogleSignalsSettingsRequest, opts ...gax.CallOption) (*adminpb.GoogleSignalsSettings, 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).GetGoogleSignalsSettings[0:len((*c.CallOptions).GetGoogleSignalsSettings):len((*c.CallOptions).GetGoogleSignalsSettings)], opts...) |
| var resp *adminpb.GoogleSignalsSettings |
| err := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error { |
| var err error |
| resp, err = c.analyticsAdminClient.GetGoogleSignalsSettings(ctx, req, settings.GRPC...) |
| return err |
| }, opts...) |
| if err != nil { |
| return nil, err |
| } |
| return resp, nil |
| } |
| |
| func (c *analyticsAdminGRPCClient) UpdateGoogleSignalsSettings(ctx context.Context, req *adminpb.UpdateGoogleSignalsSettingsRequest, opts ...gax.CallOption) (*adminpb.GoogleSignalsSettings, error) { |
| hds := []string{"x-goog-request-params", fmt.Sprintf("%s=%v", "google_signals_settings.name", url.QueryEscape(req.GetGoogleSignalsSettings().GetName()))} |
| |
| hds = append(c.xGoogHeaders, hds...) |
| ctx = gax.InsertMetadataIntoOutgoingContext(ctx, hds...) |
| opts = append((*c.CallOptions).UpdateGoogleSignalsSettings[0:len((*c.CallOptions).UpdateGoogleSignalsSettings):len((*c.CallOptions).UpdateGoogleSignalsSettings)], opts...) |
| var resp *adminpb.GoogleSignalsSettings |
| err := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error { |
| var err error |
| resp, err = c.analyticsAdminClient.UpdateGoogleSignalsSettings(ctx, req, settings.GRPC...) |
| return err |
| }, opts...) |
| if err != nil { |
| return nil, err |
| } |
| return resp, nil |
| } |
| |
| func (c *analyticsAdminGRPCClient) CreateConversionEvent(ctx context.Context, req *adminpb.CreateConversionEventRequest, opts ...gax.CallOption) (*adminpb.ConversionEvent, 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).CreateConversionEvent[0:len((*c.CallOptions).CreateConversionEvent):len((*c.CallOptions).CreateConversionEvent)], opts...) |
| var resp *adminpb.ConversionEvent |
| err := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error { |
| var err error |
| resp, err = c.analyticsAdminClient.CreateConversionEvent(ctx, req, settings.GRPC...) |
| return err |
| }, opts...) |
| if err != nil { |
| return nil, err |
| } |
| return resp, nil |
| } |
| |
| func (c *analyticsAdminGRPCClient) UpdateConversionEvent(ctx context.Context, req *adminpb.UpdateConversionEventRequest, opts ...gax.CallOption) (*adminpb.ConversionEvent, error) { |
| hds := []string{"x-goog-request-params", fmt.Sprintf("%s=%v", "conversion_event.name", url.QueryEscape(req.GetConversionEvent().GetName()))} |
| |
| hds = append(c.xGoogHeaders, hds...) |
| ctx = gax.InsertMetadataIntoOutgoingContext(ctx, hds...) |
| opts = append((*c.CallOptions).UpdateConversionEvent[0:len((*c.CallOptions).UpdateConversionEvent):len((*c.CallOptions).UpdateConversionEvent)], opts...) |
| var resp *adminpb.ConversionEvent |
| err := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error { |
| var err error |
| resp, err = c.analyticsAdminClient.UpdateConversionEvent(ctx, req, settings.GRPC...) |
| return err |
| }, opts...) |
| if err != nil { |
| return nil, err |
| } |
| return resp, nil |
| } |
| |
| func (c *analyticsAdminGRPCClient) GetConversionEvent(ctx context.Context, req *adminpb.GetConversionEventRequest, opts ...gax.CallOption) (*adminpb.ConversionEvent, 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).GetConversionEvent[0:len((*c.CallOptions).GetConversionEvent):len((*c.CallOptions).GetConversionEvent)], opts...) |
| var resp *adminpb.ConversionEvent |
| err := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error { |
| var err error |
| resp, err = c.analyticsAdminClient.GetConversionEvent(ctx, req, settings.GRPC...) |
| return err |
| }, opts...) |
| if err != nil { |
| return nil, err |
| } |
| return resp, nil |
| } |
| |
| func (c *analyticsAdminGRPCClient) DeleteConversionEvent(ctx context.Context, req *adminpb.DeleteConversionEventRequest, 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).DeleteConversionEvent[0:len((*c.CallOptions).DeleteConversionEvent):len((*c.CallOptions).DeleteConversionEvent)], opts...) |
| err := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error { |
| var err error |
| _, err = c.analyticsAdminClient.DeleteConversionEvent(ctx, req, settings.GRPC...) |
| return err |
| }, opts...) |
| return err |
| } |
| |
| func (c *analyticsAdminGRPCClient) ListConversionEvents(ctx context.Context, req *adminpb.ListConversionEventsRequest, opts ...gax.CallOption) *ConversionEventIterator { |
| 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).ListConversionEvents[0:len((*c.CallOptions).ListConversionEvents):len((*c.CallOptions).ListConversionEvents)], opts...) |
| it := &ConversionEventIterator{} |
| req = proto.Clone(req).(*adminpb.ListConversionEventsRequest) |
| it.InternalFetch = func(pageSize int, pageToken string) ([]*adminpb.ConversionEvent, string, error) { |
| resp := &adminpb.ListConversionEventsResponse{} |
| 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 = c.analyticsAdminClient.ListConversionEvents(ctx, req, settings.GRPC...) |
| return err |
| }, opts...) |
| if err != nil { |
| return nil, "", err |
| } |
| |
| it.Response = resp |
| return resp.GetConversionEvents(), 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 *analyticsAdminGRPCClient) GetDisplayVideo360AdvertiserLink(ctx context.Context, req *adminpb.GetDisplayVideo360AdvertiserLinkRequest, opts ...gax.CallOption) (*adminpb.DisplayVideo360AdvertiserLink, 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).GetDisplayVideo360AdvertiserLink[0:len((*c.CallOptions).GetDisplayVideo360AdvertiserLink):len((*c.CallOptions).GetDisplayVideo360AdvertiserLink)], opts...) |
| var resp *adminpb.DisplayVideo360AdvertiserLink |
| err := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error { |
| var err error |
| resp, err = c.analyticsAdminClient.GetDisplayVideo360AdvertiserLink(ctx, req, settings.GRPC...) |
| return err |
| }, opts...) |
| if err != nil { |
| return nil, err |
| } |
| return resp, nil |
| } |
| |
| func (c *analyticsAdminGRPCClient) ListDisplayVideo360AdvertiserLinks(ctx context.Context, req *adminpb.ListDisplayVideo360AdvertiserLinksRequest, opts ...gax.CallOption) *DisplayVideo360AdvertiserLinkIterator { |
| 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).ListDisplayVideo360AdvertiserLinks[0:len((*c.CallOptions).ListDisplayVideo360AdvertiserLinks):len((*c.CallOptions).ListDisplayVideo360AdvertiserLinks)], opts...) |
| it := &DisplayVideo360AdvertiserLinkIterator{} |
| req = proto.Clone(req).(*adminpb.ListDisplayVideo360AdvertiserLinksRequest) |
| it.InternalFetch = func(pageSize int, pageToken string) ([]*adminpb.DisplayVideo360AdvertiserLink, string, error) { |
| resp := &adminpb.ListDisplayVideo360AdvertiserLinksResponse{} |
| 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 = c.analyticsAdminClient.ListDisplayVideo360AdvertiserLinks(ctx, req, settings.GRPC...) |
| return err |
| }, opts...) |
| if err != nil { |
| return nil, "", err |
| } |
| |
| it.Response = resp |
| return resp.GetDisplayVideo_360AdvertiserLinks(), 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 *analyticsAdminGRPCClient) CreateDisplayVideo360AdvertiserLink(ctx context.Context, req *adminpb.CreateDisplayVideo360AdvertiserLinkRequest, opts ...gax.CallOption) (*adminpb.DisplayVideo360AdvertiserLink, 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).CreateDisplayVideo360AdvertiserLink[0:len((*c.CallOptions).CreateDisplayVideo360AdvertiserLink):len((*c.CallOptions).CreateDisplayVideo360AdvertiserLink)], opts...) |
| var resp *adminpb.DisplayVideo360AdvertiserLink |
| err := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error { |
| var err error |
| resp, err = c.analyticsAdminClient.CreateDisplayVideo360AdvertiserLink(ctx, req, settings.GRPC...) |
| return err |
| }, opts...) |
| if err != nil { |
| return nil, err |
| } |
| return resp, nil |
| } |
| |
| func (c *analyticsAdminGRPCClient) DeleteDisplayVideo360AdvertiserLink(ctx context.Context, req *adminpb.DeleteDisplayVideo360AdvertiserLinkRequest, 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).DeleteDisplayVideo360AdvertiserLink[0:len((*c.CallOptions).DeleteDisplayVideo360AdvertiserLink):len((*c.CallOptions).DeleteDisplayVideo360AdvertiserLink)], opts...) |
| err := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error { |
| var err error |
| _, err = c.analyticsAdminClient.DeleteDisplayVideo360AdvertiserLink(ctx, req, settings.GRPC...) |
| return err |
| }, opts...) |
| return err |
| } |
| |
| func (c *analyticsAdminGRPCClient) UpdateDisplayVideo360AdvertiserLink(ctx context.Context, req *adminpb.UpdateDisplayVideo360AdvertiserLinkRequest, opts ...gax.CallOption) (*adminpb.DisplayVideo360AdvertiserLink, error) { |
| hds := []string{"x-goog-request-params", fmt.Sprintf("%s=%v", "display_video_360_advertiser_link.name", url.QueryEscape(req.GetDisplayVideo_360AdvertiserLink().GetName()))} |
| |
| hds = append(c.xGoogHeaders, hds...) |
| ctx = gax.InsertMetadataIntoOutgoingContext(ctx, hds...) |
| opts = append((*c.CallOptions).UpdateDisplayVideo360AdvertiserLink[0:len((*c.CallOptions).UpdateDisplayVideo360AdvertiserLink):len((*c.CallOptions).UpdateDisplayVideo360AdvertiserLink)], opts...) |
| var resp *adminpb.DisplayVideo360AdvertiserLink |
| err := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error { |
| var err error |
| resp, err = c.analyticsAdminClient.UpdateDisplayVideo360AdvertiserLink(ctx, req, settings.GRPC...) |
| return err |
| }, opts...) |
| if err != nil { |
| return nil, err |
| } |
| return resp, nil |
| } |
| |
| func (c *analyticsAdminGRPCClient) GetDisplayVideo360AdvertiserLinkProposal(ctx context.Context, req *adminpb.GetDisplayVideo360AdvertiserLinkProposalRequest, opts ...gax.CallOption) (*adminpb.DisplayVideo360AdvertiserLinkProposal, 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).GetDisplayVideo360AdvertiserLinkProposal[0:len((*c.CallOptions).GetDisplayVideo360AdvertiserLinkProposal):len((*c.CallOptions).GetDisplayVideo360AdvertiserLinkProposal)], opts...) |
| var resp *adminpb.DisplayVideo360AdvertiserLinkProposal |
| err := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error { |
| var err error |
| resp, err = c.analyticsAdminClient.GetDisplayVideo360AdvertiserLinkProposal(ctx, req, settings.GRPC...) |
| return err |
| }, opts...) |
| if err != nil { |
| return nil, err |
| } |
| return resp, nil |
| } |
| |
| func (c *analyticsAdminGRPCClient) ListDisplayVideo360AdvertiserLinkProposals(ctx context.Context, req *adminpb.ListDisplayVideo360AdvertiserLinkProposalsRequest, opts ...gax.CallOption) *DisplayVideo360AdvertiserLinkProposalIterator { |
| 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).ListDisplayVideo360AdvertiserLinkProposals[0:len((*c.CallOptions).ListDisplayVideo360AdvertiserLinkProposals):len((*c.CallOptions).ListDisplayVideo360AdvertiserLinkProposals)], opts...) |
| it := &DisplayVideo360AdvertiserLinkProposalIterator{} |
| req = proto.Clone(req).(*adminpb.ListDisplayVideo360AdvertiserLinkProposalsRequest) |
| it.InternalFetch = func(pageSize int, pageToken string) ([]*adminpb.DisplayVideo360AdvertiserLinkProposal, string, error) { |
| resp := &adminpb.ListDisplayVideo360AdvertiserLinkProposalsResponse{} |
| 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 = c.analyticsAdminClient.ListDisplayVideo360AdvertiserLinkProposals(ctx, req, settings.GRPC...) |
| return err |
| }, opts...) |
| if err != nil { |
| return nil, "", err |
| } |
| |
| it.Response = resp |
| return resp.GetDisplayVideo_360AdvertiserLinkProposals(), 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 *analyticsAdminGRPCClient) CreateDisplayVideo360AdvertiserLinkProposal(ctx context.Context, req *adminpb.CreateDisplayVideo360AdvertiserLinkProposalRequest, opts ...gax.CallOption) (*adminpb.DisplayVideo360AdvertiserLinkProposal, 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).CreateDisplayVideo360AdvertiserLinkProposal[0:len((*c.CallOptions).CreateDisplayVideo360AdvertiserLinkProposal):len((*c.CallOptions).CreateDisplayVideo360AdvertiserLinkProposal)], opts...) |
| var resp *adminpb.DisplayVideo360AdvertiserLinkProposal |
| err := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error { |
| var err error |
| resp, err = c.analyticsAdminClient.CreateDisplayVideo360AdvertiserLinkProposal(ctx, req, settings.GRPC...) |
| return err |
| }, opts...) |
| if err != nil { |
| return nil, err |
| } |
| return resp, nil |
| } |
| |
| func (c *analyticsAdminGRPCClient) DeleteDisplayVideo360AdvertiserLinkProposal(ctx context.Context, req *adminpb.DeleteDisplayVideo360AdvertiserLinkProposalRequest, 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).DeleteDisplayVideo360AdvertiserLinkProposal[0:len((*c.CallOptions).DeleteDisplayVideo360AdvertiserLinkProposal):len((*c.CallOptions).DeleteDisplayVideo360AdvertiserLinkProposal)], opts...) |
| err := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error { |
| var err error |
| _, err = c.analyticsAdminClient.DeleteDisplayVideo360AdvertiserLinkProposal(ctx, req, settings.GRPC...) |
| return err |
| }, opts...) |
| return err |
| } |
| |
| func (c *analyticsAdminGRPCClient) ApproveDisplayVideo360AdvertiserLinkProposal(ctx context.Context, req *adminpb.ApproveDisplayVideo360AdvertiserLinkProposalRequest, opts ...gax.CallOption) (*adminpb.ApproveDisplayVideo360AdvertiserLinkProposalResponse, 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).ApproveDisplayVideo360AdvertiserLinkProposal[0:len((*c.CallOptions).ApproveDisplayVideo360AdvertiserLinkProposal):len((*c.CallOptions).ApproveDisplayVideo360AdvertiserLinkProposal)], opts...) |
| var resp *adminpb.ApproveDisplayVideo360AdvertiserLinkProposalResponse |
| err := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error { |
| var err error |
| resp, err = c.analyticsAdminClient.ApproveDisplayVideo360AdvertiserLinkProposal(ctx, req, settings.GRPC...) |
| return err |
| }, opts...) |
| if err != nil { |
| return nil, err |
| } |
| return resp, nil |
| } |
| |
| func (c *analyticsAdminGRPCClient) CancelDisplayVideo360AdvertiserLinkProposal(ctx context.Context, req *adminpb.CancelDisplayVideo360AdvertiserLinkProposalRequest, opts ...gax.CallOption) (*adminpb.DisplayVideo360AdvertiserLinkProposal, 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).CancelDisplayVideo360AdvertiserLinkProposal[0:len((*c.CallOptions).CancelDisplayVideo360AdvertiserLinkProposal):len((*c.CallOptions).CancelDisplayVideo360AdvertiserLinkProposal)], opts...) |
| var resp *adminpb.DisplayVideo360AdvertiserLinkProposal |
| err := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error { |
| var err error |
| resp, err = c.analyticsAdminClient.CancelDisplayVideo360AdvertiserLinkProposal(ctx, req, settings.GRPC...) |
| return err |
| }, opts...) |
| if err != nil { |
| return nil, err |
| } |
| return resp, nil |
| } |
| |
| func (c *analyticsAdminGRPCClient) CreateCustomDimension(ctx context.Context, req *adminpb.CreateCustomDimensionRequest, opts ...gax.CallOption) (*adminpb.CustomDimension, 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).CreateCustomDimension[0:len((*c.CallOptions).CreateCustomDimension):len((*c.CallOptions).CreateCustomDimension)], opts...) |
| var resp *adminpb.CustomDimension |
| err := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error { |
| var err error |
| resp, err = c.analyticsAdminClient.CreateCustomDimension(ctx, req, settings.GRPC...) |
| return err |
| }, opts...) |
| if err != nil { |
| return nil, err |
| } |
| return resp, nil |
| } |
| |
| func (c *analyticsAdminGRPCClient) UpdateCustomDimension(ctx context.Context, req *adminpb.UpdateCustomDimensionRequest, opts ...gax.CallOption) (*adminpb.CustomDimension, error) { |
| hds := []string{"x-goog-request-params", fmt.Sprintf("%s=%v", "custom_dimension.name", url.QueryEscape(req.GetCustomDimension().GetName()))} |
| |
| hds = append(c.xGoogHeaders, hds...) |
| ctx = gax.InsertMetadataIntoOutgoingContext(ctx, hds...) |
| opts = append((*c.CallOptions).UpdateCustomDimension[0:len((*c.CallOptions).UpdateCustomDimension):len((*c.CallOptions).UpdateCustomDimension)], opts...) |
| var resp *adminpb.CustomDimension |
| err := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error { |
| var err error |
| resp, err = c.analyticsAdminClient.UpdateCustomDimension(ctx, req, settings.GRPC...) |
| return err |
| }, opts...) |
| if err != nil { |
| return nil, err |
| } |
| return resp, nil |
| } |
| |
| func (c *analyticsAdminGRPCClient) ListCustomDimensions(ctx context.Context, req *adminpb.ListCustomDimensionsRequest, opts ...gax.CallOption) *CustomDimensionIterator { |
| 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).ListCustomDimensions[0:len((*c.CallOptions).ListCustomDimensions):len((*c.CallOptions).ListCustomDimensions)], opts...) |
| it := &CustomDimensionIterator{} |
| req = proto.Clone(req).(*adminpb.ListCustomDimensionsRequest) |
| it.InternalFetch = func(pageSize int, pageToken string) ([]*adminpb.CustomDimension, string, error) { |
| resp := &adminpb.ListCustomDimensionsResponse{} |
| 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 = c.analyticsAdminClient.ListCustomDimensions(ctx, req, settings.GRPC...) |
| return err |
| }, opts...) |
| if err != nil { |
| return nil, "", err |
| } |
| |
| it.Response = resp |
| return resp.GetCustomDimensions(), 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 *analyticsAdminGRPCClient) ArchiveCustomDimension(ctx context.Context, req *adminpb.ArchiveCustomDimensionRequest, 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).ArchiveCustomDimension[0:len((*c.CallOptions).ArchiveCustomDimension):len((*c.CallOptions).ArchiveCustomDimension)], opts...) |
| err := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error { |
| var err error |
| _, err = c.analyticsAdminClient.ArchiveCustomDimension(ctx, req, settings.GRPC...) |
| return err |
| }, opts...) |
| return err |
| } |
| |
| func (c *analyticsAdminGRPCClient) GetCustomDimension(ctx context.Context, req *adminpb.GetCustomDimensionRequest, opts ...gax.CallOption) (*adminpb.CustomDimension, 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).GetCustomDimension[0:len((*c.CallOptions).GetCustomDimension):len((*c.CallOptions).GetCustomDimension)], opts...) |
| var resp *adminpb.CustomDimension |
| err := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error { |
| var err error |
| resp, err = c.analyticsAdminClient.GetCustomDimension(ctx, req, settings.GRPC...) |
| return err |
| }, opts...) |
| if err != nil { |
| return nil, err |
| } |
| return resp, nil |
| } |
| |
| func (c *analyticsAdminGRPCClient) CreateCustomMetric(ctx context.Context, req *adminpb.CreateCustomMetricRequest, opts ...gax.CallOption) (*adminpb.CustomMetric, 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).CreateCustomMetric[0:len((*c.CallOptions).CreateCustomMetric):len((*c.CallOptions).CreateCustomMetric)], opts...) |
| var resp *adminpb.CustomMetric |
| err := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error { |
| var err error |
| resp, err = c.analyticsAdminClient.CreateCustomMetric(ctx, req, settings.GRPC...) |
| return err |
| }, opts...) |
| if err != nil { |
| return nil, err |
| } |
| return resp, nil |
| } |
| |
| func (c *analyticsAdminGRPCClient) UpdateCustomMetric(ctx context.Context, req *adminpb.UpdateCustomMetricRequest, opts ...gax.CallOption) (*adminpb.CustomMetric, error) { |
| hds := []string{"x-goog-request-params", fmt.Sprintf("%s=%v", "custom_metric.name", url.QueryEscape(req.GetCustomMetric().GetName()))} |
| |
| hds = append(c.xGoogHeaders, hds...) |
| ctx = gax.InsertMetadataIntoOutgoingContext(ctx, hds...) |
| opts = append((*c.CallOptions).UpdateCustomMetric[0:len((*c.CallOptions).UpdateCustomMetric):len((*c.CallOptions).UpdateCustomMetric)], opts...) |
| var resp *adminpb.CustomMetric |
| err := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error { |
| var err error |
| resp, err = c.analyticsAdminClient.UpdateCustomMetric(ctx, req, settings.GRPC...) |
| return err |
| }, opts...) |
| if err != nil { |
| return nil, err |
| } |
| return resp, nil |
| } |
| |
| func (c *analyticsAdminGRPCClient) ListCustomMetrics(ctx context.Context, req *adminpb.ListCustomMetricsRequest, opts ...gax.CallOption) *CustomMetricIterator { |
| 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).ListCustomMetrics[0:len((*c.CallOptions).ListCustomMetrics):len((*c.CallOptions).ListCustomMetrics)], opts...) |
| it := &CustomMetricIterator{} |
| req = proto.Clone(req).(*adminpb.ListCustomMetricsRequest) |
| it.InternalFetch = func(pageSize int, pageToken string) ([]*adminpb.CustomMetric, string, error) { |
| resp := &adminpb.ListCustomMetricsResponse{} |
| 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 = c.analyticsAdminClient.ListCustomMetrics(ctx, req, settings.GRPC...) |
| return err |
| }, opts...) |
| if err != nil { |
| return nil, "", err |
| } |
| |
| it.Response = resp |
| return resp.GetCustomMetrics(), 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 *analyticsAdminGRPCClient) ArchiveCustomMetric(ctx context.Context, req *adminpb.ArchiveCustomMetricRequest, 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).ArchiveCustomMetric[0:len((*c.CallOptions).ArchiveCustomMetric):len((*c.CallOptions).ArchiveCustomMetric)], opts...) |
| err := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error { |
| var err error |
| _, err = c.analyticsAdminClient.ArchiveCustomMetric(ctx, req, settings.GRPC...) |
| return err |
| }, opts...) |
| return err |
| } |
| |
| func (c *analyticsAdminGRPCClient) GetCustomMetric(ctx context.Context, req *adminpb.GetCustomMetricRequest, opts ...gax.CallOption) (*adminpb.CustomMetric, 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).GetCustomMetric[0:len((*c.CallOptions).GetCustomMetric):len((*c.CallOptions).GetCustomMetric)], opts...) |
| var resp *adminpb.CustomMetric |
| err := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error { |
| var err error |
| resp, err = c.analyticsAdminClient.GetCustomMetric(ctx, req, settings.GRPC...) |
| return err |
| }, opts...) |
| if err != nil { |
| return nil, err |
| } |
| return resp, nil |
| } |
| |
| func (c *analyticsAdminGRPCClient) GetDataRetentionSettings(ctx context.Context, req *adminpb.GetDataRetentionSettingsRequest, opts ...gax.CallOption) (*adminpb.DataRetentionSettings, 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).GetDataRetentionSettings[0:len((*c.CallOptions).GetDataRetentionSettings):len((*c.CallOptions).GetDataRetentionSettings)], opts...) |
| var resp *adminpb.DataRetentionSettings |
| err := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error { |
| var err error |
| resp, err = c.analyticsAdminClient.GetDataRetentionSettings(ctx, req, settings.GRPC...) |
| return err |
| }, opts...) |
| if err != nil { |
| return nil, err |
| } |
| return resp, nil |
| } |
| |
| func (c *analyticsAdminGRPCClient) UpdateDataRetentionSettings(ctx context.Context, req *adminpb.UpdateDataRetentionSettingsRequest, opts ...gax.CallOption) (*adminpb.DataRetentionSettings, error) { |
| hds := []string{"x-goog-request-params", fmt.Sprintf("%s=%v", "data_retention_settings.name", url.QueryEscape(req.GetDataRetentionSettings().GetName()))} |
| |
| hds = append(c.xGoogHeaders, hds...) |
| ctx = gax.InsertMetadataIntoOutgoingContext(ctx, hds...) |
| opts = append((*c.CallOptions).UpdateDataRetentionSettings[0:len((*c.CallOptions).UpdateDataRetentionSettings):len((*c.CallOptions).UpdateDataRetentionSettings)], opts...) |
| var resp *adminpb.DataRetentionSettings |
| err := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error { |
| var err error |
| resp, err = c.analyticsAdminClient.UpdateDataRetentionSettings(ctx, req, settings.GRPC...) |
| return err |
| }, opts...) |
| if err != nil { |
| return nil, err |
| } |
| return resp, nil |
| } |
| |
| func (c *analyticsAdminGRPCClient) CreateDataStream(ctx context.Context, req *adminpb.CreateDataStreamRequest, opts ...gax.CallOption) (*adminpb.DataStream, 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).CreateDataStream[0:len((*c.CallOptions).CreateDataStream):len((*c.CallOptions).CreateDataStream)], opts...) |
| var resp *adminpb.DataStream |
| err := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error { |
| var err error |
| resp, err = c.analyticsAdminClient.CreateDataStream(ctx, req, settings.GRPC...) |
| return err |
| }, opts...) |
| if err != nil { |
| return nil, err |
| } |
| return resp, nil |
| } |
| |
| func (c *analyticsAdminGRPCClient) DeleteDataStream(ctx context.Context, req *adminpb.DeleteDataStreamRequest, 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).DeleteDataStream[0:len((*c.CallOptions).DeleteDataStream):len((*c.CallOptions).DeleteDataStream)], opts...) |
| err := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error { |
| var err error |
| _, err = c.analyticsAdminClient.DeleteDataStream(ctx, req, settings.GRPC...) |
| return err |
| }, opts...) |
| return err |
| } |
| |
| func (c *analyticsAdminGRPCClient) UpdateDataStream(ctx context.Context, req *adminpb.UpdateDataStreamRequest, opts ...gax.CallOption) (*adminpb.DataStream, error) { |
| hds := []string{"x-goog-request-params", fmt.Sprintf("%s=%v", "data_stream.name", url.QueryEscape(req.GetDataStream().GetName()))} |
| |
| hds = append(c.xGoogHeaders, hds...) |
| ctx = gax.InsertMetadataIntoOutgoingContext(ctx, hds...) |
| opts = append((*c.CallOptions).UpdateDataStream[0:len((*c.CallOptions).UpdateDataStream):len((*c.CallOptions).UpdateDataStream)], opts...) |
| var resp *adminpb.DataStream |
| err := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error { |
| var err error |
| resp, err = c.analyticsAdminClient.UpdateDataStream(ctx, req, settings.GRPC...) |
| return err |
| }, opts...) |
| if err != nil { |
| return nil, err |
| } |
| return resp, nil |
| } |
| |
| func (c *analyticsAdminGRPCClient) ListDataStreams(ctx context.Context, req *adminpb.ListDataStreamsRequest, opts ...gax.CallOption) *DataStreamIterator { |
| 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).ListDataStreams[0:len((*c.CallOptions).ListDataStreams):len((*c.CallOptions).ListDataStreams)], opts...) |
| it := &DataStreamIterator{} |
| req = proto.Clone(req).(*adminpb.ListDataStreamsRequest) |
| it.InternalFetch = func(pageSize int, pageToken string) ([]*adminpb.DataStream, string, error) { |
| resp := &adminpb.ListDataStreamsResponse{} |
| 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 = c.analyticsAdminClient.ListDataStreams(ctx, req, settings.GRPC...) |
| return err |
| }, opts...) |
| if err != nil { |
| return nil, "", err |
| } |
| |
| it.Response = resp |
| return resp.GetDataStreams(), 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 *analyticsAdminGRPCClient) GetDataStream(ctx context.Context, req *adminpb.GetDataStreamRequest, opts ...gax.CallOption) (*adminpb.DataStream, 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).GetDataStream[0:len((*c.CallOptions).GetDataStream):len((*c.CallOptions).GetDataStream)], opts...) |
| var resp *adminpb.DataStream |
| err := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error { |
| var err error |
| resp, err = c.analyticsAdminClient.GetDataStream(ctx, req, settings.GRPC...) |
| return err |
| }, opts...) |
| if err != nil { |
| return nil, err |
| } |
| return resp, nil |
| } |
| |
| func (c *analyticsAdminGRPCClient) GetAudience(ctx context.Context, req *adminpb.GetAudienceRequest, opts ...gax.CallOption) (*adminpb.Audience, 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).GetAudience[0:len((*c.CallOptions).GetAudience):len((*c.CallOptions).GetAudience)], opts...) |
| var resp *adminpb.Audience |
| err := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error { |
| var err error |
| resp, err = c.analyticsAdminClient.GetAudience(ctx, req, settings.GRPC...) |
| return err |
| }, opts...) |
| if err != nil { |
| return nil, err |
| } |
| return resp, nil |
| } |
| |
| func (c *analyticsAdminGRPCClient) ListAudiences(ctx context.Context, req *adminpb.ListAudiencesRequest, opts ...gax.CallOption) *AudienceIterator { |
| 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).ListAudiences[0:len((*c.CallOptions).ListAudiences):len((*c.CallOptions).ListAudiences)], opts...) |
| it := &AudienceIterator{} |
| req = proto.Clone(req).(*adminpb.ListAudiencesRequest) |
| it.InternalFetch = func(pageSize int, pageToken string) ([]*adminpb.Audience, string, error) { |
| resp := &adminpb.ListAudiencesResponse{} |
| 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 = c.analyticsAdminClient.ListAudiences(ctx, req, settings.GRPC...) |
| return err |
| }, opts...) |
| if err != nil { |
| return nil, "", err |
| } |
| |
| it.Response = resp |
| return resp.GetAudiences(), 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 *analyticsAdminGRPCClient) CreateAudience(ctx context.Context, req *adminpb.CreateAudienceRequest, opts ...gax.CallOption) (*adminpb.Audience, 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).CreateAudience[0:len((*c.CallOptions).CreateAudience):len((*c.CallOptions).CreateAudience)], opts...) |
| var resp *adminpb.Audience |
| err := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error { |
| var err error |
| resp, err = c.analyticsAdminClient.CreateAudience(ctx, req, settings.GRPC...) |
| return err |
| }, opts...) |
| if err != nil { |
| return nil, err |
| } |
| return resp, nil |
| } |
| |
| func (c *analyticsAdminGRPCClient) UpdateAudience(ctx context.Context, req *adminpb.UpdateAudienceRequest, opts ...gax.CallOption) (*adminpb.Audience, error) { |
| hds := []string{"x-goog-request-params", fmt.Sprintf("%s=%v", "audience.name", url.QueryEscape(req.GetAudience().GetName()))} |
| |
| hds = append(c.xGoogHeaders, hds...) |
| ctx = gax.InsertMetadataIntoOutgoingContext(ctx, hds...) |
| opts = append((*c.CallOptions).UpdateAudience[0:len((*c.CallOptions).UpdateAudience):len((*c.CallOptions).UpdateAudience)], opts...) |
| var resp *adminpb.Audience |
| err := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error { |
| var err error |
| resp, err = c.analyticsAdminClient.UpdateAudience(ctx, req, settings.GRPC...) |
| return err |
| }, opts...) |
| if err != nil { |
| return nil, err |
| } |
| return resp, nil |
| } |
| |
| func (c *analyticsAdminGRPCClient) ArchiveAudience(ctx context.Context, req *adminpb.ArchiveAudienceRequest, 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).ArchiveAudience[0:len((*c.CallOptions).ArchiveAudience):len((*c.CallOptions).ArchiveAudience)], opts...) |
| err := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error { |
| var err error |
| _, err = c.analyticsAdminClient.ArchiveAudience(ctx, req, settings.GRPC...) |
| return err |
| }, opts...) |
| return err |
| } |
| |
| func (c *analyticsAdminGRPCClient) GetSearchAds360Link(ctx context.Context, req *adminpb.GetSearchAds360LinkRequest, opts ...gax.CallOption) (*adminpb.SearchAds360Link, 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).GetSearchAds360Link[0:len((*c.CallOptions).GetSearchAds360Link):len((*c.CallOptions).GetSearchAds360Link)], opts...) |
| var resp *adminpb.SearchAds360Link |
| err := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error { |
| var err error |
| resp, err = c.analyticsAdminClient.GetSearchAds360Link(ctx, req, settings.GRPC...) |
| return err |
| }, opts...) |
| if err != nil { |
| return nil, err |
| } |
| return resp, nil |
| } |
| |
| func (c *analyticsAdminGRPCClient) ListSearchAds360Links(ctx context.Context, req *adminpb.ListSearchAds360LinksRequest, opts ...gax.CallOption) *SearchAds360LinkIterator { |
| 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).ListSearchAds360Links[0:len((*c.CallOptions).ListSearchAds360Links):len((*c.CallOptions).ListSearchAds360Links)], opts...) |
| it := &SearchAds360LinkIterator{} |
| req = proto.Clone(req).(*adminpb.ListSearchAds360LinksRequest) |
| it.InternalFetch = func(pageSize int, pageToken string) ([]*adminpb.SearchAds360Link, string, error) { |
| resp := &adminpb.ListSearchAds360LinksResponse{} |
| 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 = c.analyticsAdminClient.ListSearchAds360Links(ctx, req, settings.GRPC...) |
| return err |
| }, opts...) |
| if err != nil { |
| return nil, "", err |
| } |
| |
| it.Response = resp |
| return resp.GetSearchAds_360Links(), 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 *analyticsAdminGRPCClient) CreateSearchAds360Link(ctx context.Context, req *adminpb.CreateSearchAds360LinkRequest, opts ...gax.CallOption) (*adminpb.SearchAds360Link, 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).CreateSearchAds360Link[0:len((*c.CallOptions).CreateSearchAds360Link):len((*c.CallOptions).CreateSearchAds360Link)], opts...) |
| var resp *adminpb.SearchAds360Link |
| err := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error { |
| var err error |
| resp, err = c.analyticsAdminClient.CreateSearchAds360Link(ctx, req, settings.GRPC...) |
| return err |
| }, opts...) |
| if err != nil { |
| return nil, err |
| } |
| return resp, nil |
| } |
| |
| func (c *analyticsAdminGRPCClient) DeleteSearchAds360Link(ctx context.Context, req *adminpb.DeleteSearchAds360LinkRequest, 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).DeleteSearchAds360Link[0:len((*c.CallOptions).DeleteSearchAds360Link):len((*c.CallOptions).DeleteSearchAds360Link)], opts...) |
| err := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error { |
| var err error |
| _, err = c.analyticsAdminClient.DeleteSearchAds360Link(ctx, req, settings.GRPC...) |
| return err |
| }, opts...) |
| return err |
| } |
| |
| func (c *analyticsAdminGRPCClient) UpdateSearchAds360Link(ctx context.Context, req *adminpb.UpdateSearchAds360LinkRequest, opts ...gax.CallOption) (*adminpb.SearchAds360Link, error) { |
| hds := []string{"x-goog-request-params", fmt.Sprintf("%s=%v", "search_ads_360_link.name", url.QueryEscape(req.GetSearchAds_360Link().GetName()))} |
| |
| hds = append(c.xGoogHeaders, hds...) |
| ctx = gax.InsertMetadataIntoOutgoingContext(ctx, hds...) |
| opts = append((*c.CallOptions).UpdateSearchAds360Link[0:len((*c.CallOptions).UpdateSearchAds360Link):len((*c.CallOptions).UpdateSearchAds360Link)], opts...) |
| var resp *adminpb.SearchAds360Link |
| err := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error { |
| var err error |
| resp, err = c.analyticsAdminClient.UpdateSearchAds360Link(ctx, req, settings.GRPC...) |
| return err |
| }, opts...) |
| if err != nil { |
| return nil, err |
| } |
| return resp, nil |
| } |
| |
| func (c *analyticsAdminGRPCClient) GetAttributionSettings(ctx context.Context, req *adminpb.GetAttributionSettingsRequest, opts ...gax.CallOption) (*adminpb.AttributionSettings, 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).GetAttributionSettings[0:len((*c.CallOptions).GetAttributionSettings):len((*c.CallOptions).GetAttributionSettings)], opts...) |
| var resp *adminpb.AttributionSettings |
| err := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error { |
| var err error |
| resp, err = c.analyticsAdminClient.GetAttributionSettings(ctx, req, settings.GRPC...) |
| return err |
| }, opts...) |
| if err != nil { |
| return nil, err |
| } |
| return resp, nil |
| } |
| |
| func (c *analyticsAdminGRPCClient) UpdateAttributionSettings(ctx context.Context, req *adminpb.UpdateAttributionSettingsRequest, opts ...gax.CallOption) (*adminpb.AttributionSettings, error) { |
| hds := []string{"x-goog-request-params", fmt.Sprintf("%s=%v", "attribution_settings.name", url.QueryEscape(req.GetAttributionSettings().GetName()))} |
| |
| hds = append(c.xGoogHeaders, hds...) |
| ctx = gax.InsertMetadataIntoOutgoingContext(ctx, hds...) |
| opts = append((*c.CallOptions).UpdateAttributionSettings[0:len((*c.CallOptions).UpdateAttributionSettings):len((*c.CallOptions).UpdateAttributionSettings)], opts...) |
| var resp *adminpb.AttributionSettings |
| err := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error { |
| var err error |
| resp, err = c.analyticsAdminClient.UpdateAttributionSettings(ctx, req, settings.GRPC...) |
| return err |
| }, opts...) |
| if err != nil { |
| return nil, err |
| } |
| return resp, nil |
| } |
| |
| func (c *analyticsAdminGRPCClient) RunAccessReport(ctx context.Context, req *adminpb.RunAccessReportRequest, opts ...gax.CallOption) (*adminpb.RunAccessReportResponse, error) { |
| hds := []string{"x-goog-request-params", fmt.Sprintf("%s=%v", "entity", url.QueryEscape(req.GetEntity()))} |
| |
| hds = append(c.xGoogHeaders, hds...) |
| ctx = gax.InsertMetadataIntoOutgoingContext(ctx, hds...) |
| opts = append((*c.CallOptions).RunAccessReport[0:len((*c.CallOptions).RunAccessReport):len((*c.CallOptions).RunAccessReport)], opts...) |
| var resp *adminpb.RunAccessReportResponse |
| err := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error { |
| var err error |
| resp, err = c.analyticsAdminClient.RunAccessReport(ctx, req, settings.GRPC...) |
| return err |
| }, opts...) |
| if err != nil { |
| return nil, err |
| } |
| return resp, nil |
| } |
| |
| func (c *analyticsAdminGRPCClient) CreateAccessBinding(ctx context.Context, req *adminpb.CreateAccessBindingRequest, opts ...gax.CallOption) (*adminpb.AccessBinding, 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).CreateAccessBinding[0:len((*c.CallOptions).CreateAccessBinding):len((*c.CallOptions).CreateAccessBinding)], opts...) |
| var resp *adminpb.AccessBinding |
| err := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error { |
| var err error |
| resp, err = c.analyticsAdminClient.CreateAccessBinding(ctx, req, settings.GRPC...) |
| return err |
| }, opts...) |
| if err != nil { |
| return nil, err |
| } |
| return resp, nil |
| } |
| |
| func (c *analyticsAdminGRPCClient) GetAccessBinding(ctx context.Context, req *adminpb.GetAccessBindingRequest, opts ...gax.CallOption) (*adminpb.AccessBinding, 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).GetAccessBinding[0:len((*c.CallOptions).GetAccessBinding):len((*c.CallOptions).GetAccessBinding)], opts...) |
| var resp *adminpb.AccessBinding |
| err := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error { |
| var err error |
| resp, err = c.analyticsAdminClient.GetAccessBinding(ctx, req, settings.GRPC...) |
| return err |
| }, opts...) |
| if err != nil { |
| return nil, err |
| } |
| return resp, nil |
| } |
| |
| func (c *analyticsAdminGRPCClient) UpdateAccessBinding(ctx context.Context, req *adminpb.UpdateAccessBindingRequest, opts ...gax.CallOption) (*adminpb.AccessBinding, error) { |
| hds := []string{"x-goog-request-params", fmt.Sprintf("%s=%v", "access_binding.name", url.QueryEscape(req.GetAccessBinding().GetName()))} |
| |
| hds = append(c.xGoogHeaders, hds...) |
| ctx = gax.InsertMetadataIntoOutgoingContext(ctx, hds...) |
| opts = append((*c.CallOptions).UpdateAccessBinding[0:len((*c.CallOptions).UpdateAccessBinding):len((*c.CallOptions).UpdateAccessBinding)], opts...) |
| var resp *adminpb.AccessBinding |
| err := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error { |
| var err error |
| resp, err = c.analyticsAdminClient.UpdateAccessBinding(ctx, req, settings.GRPC...) |
| return err |
| }, opts...) |
| if err != nil { |
| return nil, err |
| } |
| return resp, nil |
| } |
| |
| func (c *analyticsAdminGRPCClient) DeleteAccessBinding(ctx context.Context, req *adminpb.DeleteAccessBindingRequest, 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).DeleteAccessBinding[0:len((*c.CallOptions).DeleteAccessBinding):len((*c.CallOptions).DeleteAccessBinding)], opts...) |
| err := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error { |
| var err error |
| _, err = c.analyticsAdminClient.DeleteAccessBinding(ctx, req, settings.GRPC...) |
| return err |
| }, opts...) |
| return err |
| } |
| |
| func (c *analyticsAdminGRPCClient) ListAccessBindings(ctx context.Context, req *adminpb.ListAccessBindingsRequest, opts ...gax.CallOption) *AccessBindingIterator { |
| 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).ListAccessBindings[0:len((*c.CallOptions).ListAccessBindings):len((*c.CallOptions).ListAccessBindings)], opts...) |
| it := &AccessBindingIterator{} |
| req = proto.Clone(req).(*adminpb.ListAccessBindingsRequest) |
| it.InternalFetch = func(pageSize int, pageToken string) ([]*adminpb.AccessBinding, string, error) { |
| resp := &adminpb.ListAccessBindingsResponse{} |
| 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 = c.analyticsAdminClient.ListAccessBindings(ctx, req, settings.GRPC...) |
| return err |
| }, opts...) |
| if err != nil { |
| return nil, "", err |
| } |
| |
| it.Response = resp |
| return resp.GetAccessBindings(), 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 *analyticsAdminGRPCClient) BatchCreateAccessBindings(ctx context.Context, req *adminpb.BatchCreateAccessBindingsRequest, opts ...gax.CallOption) (*adminpb.BatchCreateAccessBindingsResponse, 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).BatchCreateAccessBindings[0:len((*c.CallOptions).BatchCreateAccessBindings):len((*c.CallOptions).BatchCreateAccessBindings)], opts...) |
| var resp *adminpb.BatchCreateAccessBindingsResponse |
| err := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error { |
| var err error |
| resp, err = c.analyticsAdminClient.BatchCreateAccessBindings(ctx, req, settings.GRPC...) |
| return err |
| }, opts...) |
| if err != nil { |
| return nil, err |
| } |
| return resp, nil |
| } |
| |
| func (c *analyticsAdminGRPCClient) BatchGetAccessBindings(ctx context.Context, req *adminpb.BatchGetAccessBindingsRequest, opts ...gax.CallOption) (*adminpb.BatchGetAccessBindingsResponse, 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).BatchGetAccessBindings[0:len((*c.CallOptions).BatchGetAccessBindings):len((*c.CallOptions).BatchGetAccessBindings)], opts...) |
| var resp *adminpb.BatchGetAccessBindingsResponse |
| err := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error { |
| var err error |
| resp, err = c.analyticsAdminClient.BatchGetAccessBindings(ctx, req, settings.GRPC...) |
| return err |
| }, opts...) |
| if err != nil { |
| return nil, err |
| } |
| return resp, nil |
| } |
| |
| func (c *analyticsAdminGRPCClient) BatchUpdateAccessBindings(ctx context.Context, req *adminpb.BatchUpdateAccessBindingsRequest, opts ...gax.CallOption) (*adminpb.BatchUpdateAccessBindingsResponse, 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).BatchUpdateAccessBindings[0:len((*c.CallOptions).BatchUpdateAccessBindings):len((*c.CallOptions).BatchUpdateAccessBindings)], opts...) |
| var resp *adminpb.BatchUpdateAccessBindingsResponse |
| err := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error { |
| var err error |
| resp, err = c.analyticsAdminClient.BatchUpdateAccessBindings(ctx, req, settings.GRPC...) |
| return err |
| }, opts...) |
| if err != nil { |
| return nil, err |
| } |
| return resp, nil |
| } |
| |
| func (c *analyticsAdminGRPCClient) BatchDeleteAccessBindings(ctx context.Context, req *adminpb.BatchDeleteAccessBindingsRequest, opts ...gax.CallOption) 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).BatchDeleteAccessBindings[0:len((*c.CallOptions).BatchDeleteAccessBindings):len((*c.CallOptions).BatchDeleteAccessBindings)], opts...) |
| err := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error { |
| var err error |
| _, err = c.analyticsAdminClient.BatchDeleteAccessBindings(ctx, req, settings.GRPC...) |
| return err |
| }, opts...) |
| return err |
| } |
| |
| func (c *analyticsAdminGRPCClient) GetExpandedDataSet(ctx context.Context, req *adminpb.GetExpandedDataSetRequest, opts ...gax.CallOption) (*adminpb.ExpandedDataSet, 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).GetExpandedDataSet[0:len((*c.CallOptions).GetExpandedDataSet):len((*c.CallOptions).GetExpandedDataSet)], opts...) |
| var resp *adminpb.ExpandedDataSet |
| err := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error { |
| var err error |
| resp, err = c.analyticsAdminClient.GetExpandedDataSet(ctx, req, settings.GRPC...) |
| return err |
| }, opts...) |
| if err != nil { |
| return nil, err |
| } |
| return resp, nil |
| } |
| |
| func (c *analyticsAdminGRPCClient) ListExpandedDataSets(ctx context.Context, req *adminpb.ListExpandedDataSetsRequest, opts ...gax.CallOption) *ExpandedDataSetIterator { |
| 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).ListExpandedDataSets[0:len((*c.CallOptions).ListExpandedDataSets):len((*c.CallOptions).ListExpandedDataSets)], opts...) |
| it := &ExpandedDataSetIterator{} |
| req = proto.Clone(req).(*adminpb.ListExpandedDataSetsRequest) |
| it.InternalFetch = func(pageSize int, pageToken string) ([]*adminpb.ExpandedDataSet, string, error) { |
| resp := &adminpb.ListExpandedDataSetsResponse{} |
| 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 = c.analyticsAdminClient.ListExpandedDataSets(ctx, req, settings.GRPC...) |
| return err |
| }, opts...) |
| if err != nil { |
| return nil, "", err |
| } |
| |
| it.Response = resp |
| return resp.GetExpandedDataSets(), 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 *analyticsAdminGRPCClient) CreateExpandedDataSet(ctx context.Context, req *adminpb.CreateExpandedDataSetRequest, opts ...gax.CallOption) (*adminpb.ExpandedDataSet, 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).CreateExpandedDataSet[0:len((*c.CallOptions).CreateExpandedDataSet):len((*c.CallOptions).CreateExpandedDataSet)], opts...) |
| var resp *adminpb.ExpandedDataSet |
| err := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error { |
| var err error |
| resp, err = c.analyticsAdminClient.CreateExpandedDataSet(ctx, req, settings.GRPC...) |
| return err |
| }, opts...) |
| if err != nil { |
| return nil, err |
| } |
| return resp, nil |
| } |
| |
| func (c *analyticsAdminGRPCClient) UpdateExpandedDataSet(ctx context.Context, req *adminpb.UpdateExpandedDataSetRequest, opts ...gax.CallOption) (*adminpb.ExpandedDataSet, error) { |
| hds := []string{"x-goog-request-params", fmt.Sprintf("%s=%v", "expanded_data_set.name", url.QueryEscape(req.GetExpandedDataSet().GetName()))} |
| |
| hds = append(c.xGoogHeaders, hds...) |
| ctx = gax.InsertMetadataIntoOutgoingContext(ctx, hds...) |
| opts = append((*c.CallOptions).UpdateExpandedDataSet[0:len((*c.CallOptions).UpdateExpandedDataSet):len((*c.CallOptions).UpdateExpandedDataSet)], opts...) |
| var resp *adminpb.ExpandedDataSet |
| err := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error { |
| var err error |
| resp, err = c.analyticsAdminClient.UpdateExpandedDataSet(ctx, req, settings.GRPC...) |
| return err |
| }, opts...) |
| if err != nil { |
| return nil, err |
| } |
| return resp, nil |
| } |
| |
| func (c *analyticsAdminGRPCClient) DeleteExpandedDataSet(ctx context.Context, req *adminpb.DeleteExpandedDataSetRequest, 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).DeleteExpandedDataSet[0:len((*c.CallOptions).DeleteExpandedDataSet):len((*c.CallOptions).DeleteExpandedDataSet)], opts...) |
| err := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error { |
| var err error |
| _, err = c.analyticsAdminClient.DeleteExpandedDataSet(ctx, req, settings.GRPC...) |
| return err |
| }, opts...) |
| return err |
| } |
| |
| func (c *analyticsAdminGRPCClient) GetChannelGroup(ctx context.Context, req *adminpb.GetChannelGroupRequest, opts ...gax.CallOption) (*adminpb.ChannelGroup, 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).GetChannelGroup[0:len((*c.CallOptions).GetChannelGroup):len((*c.CallOptions).GetChannelGroup)], opts...) |
| var resp *adminpb.ChannelGroup |
| err := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error { |
| var err error |
| resp, err = c.analyticsAdminClient.GetChannelGroup(ctx, req, settings.GRPC...) |
| return err |
| }, opts...) |
| if err != nil { |
| return nil, err |
| } |
| return resp, nil |
| } |
| |
| func (c *analyticsAdminGRPCClient) ListChannelGroups(ctx context.Context, req *adminpb.ListChannelGroupsRequest, opts ...gax.CallOption) *ChannelGroupIterator { |
| 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).ListChannelGroups[0:len((*c.CallOptions).ListChannelGroups):len((*c.CallOptions).ListChannelGroups)], opts...) |
| it := &ChannelGroupIterator{} |
| req = proto.Clone(req).(*adminpb.ListChannelGroupsRequest) |
| it.InternalFetch = func(pageSize int, pageToken string) ([]*adminpb.ChannelGroup, string, error) { |
| resp := &adminpb.ListChannelGroupsResponse{} |
| 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 = c.analyticsAdminClient.ListChannelGroups(ctx, req, settings.GRPC...) |
| return err |
| }, opts...) |
| if err != nil { |
| return nil, "", err |
| } |
| |
| it.Response = resp |
| return resp.GetChannelGroups(), 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 *analyticsAdminGRPCClient) CreateChannelGroup(ctx context.Context, req *adminpb.CreateChannelGroupRequest, opts ...gax.CallOption) (*adminpb.ChannelGroup, 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).CreateChannelGroup[0:len((*c.CallOptions).CreateChannelGroup):len((*c.CallOptions).CreateChannelGroup)], opts...) |
| var resp *adminpb.ChannelGroup |
| err := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error { |
| var err error |
| resp, err = c.analyticsAdminClient.CreateChannelGroup(ctx, req, settings.GRPC...) |
| return err |
| }, opts...) |
| if err != nil { |
| return nil, err |
| } |
| return resp, nil |
| } |
| |
| func (c *analyticsAdminGRPCClient) UpdateChannelGroup(ctx context.Context, req *adminpb.UpdateChannelGroupRequest, opts ...gax.CallOption) (*adminpb.ChannelGroup, error) { |
| hds := []string{"x-goog-request-params", fmt.Sprintf("%s=%v", "channel_group.name", url.QueryEscape(req.GetChannelGroup().GetName()))} |
| |
| hds = append(c.xGoogHeaders, hds...) |
| ctx = gax.InsertMetadataIntoOutgoingContext(ctx, hds...) |
| opts = append((*c.CallOptions).UpdateChannelGroup[0:len((*c.CallOptions).UpdateChannelGroup):len((*c.CallOptions).UpdateChannelGroup)], opts...) |
| var resp *adminpb.ChannelGroup |
| err := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error { |
| var err error |
| resp, err = c.analyticsAdminClient.UpdateChannelGroup(ctx, req, settings.GRPC...) |
| return err |
| }, opts...) |
| if err != nil { |
| return nil, err |
| } |
| return resp, nil |
| } |
| |
| func (c *analyticsAdminGRPCClient) DeleteChannelGroup(ctx context.Context, req *adminpb.DeleteChannelGroupRequest, 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).DeleteChannelGroup[0:len((*c.CallOptions).DeleteChannelGroup):len((*c.CallOptions).DeleteChannelGroup)], opts...) |
| err := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error { |
| var err error |
| _, err = c.analyticsAdminClient.DeleteChannelGroup(ctx, req, settings.GRPC...) |
| return err |
| }, opts...) |
| return err |
| } |
| |
| func (c *analyticsAdminGRPCClient) SetAutomatedGa4ConfigurationOptOut(ctx context.Context, req *adminpb.SetAutomatedGa4ConfigurationOptOutRequest, opts ...gax.CallOption) (*adminpb.SetAutomatedGa4ConfigurationOptOutResponse, error) { |
| ctx = gax.InsertMetadataIntoOutgoingContext(ctx, c.xGoogHeaders...) |
| opts = append((*c.CallOptions).SetAutomatedGa4ConfigurationOptOut[0:len((*c.CallOptions).SetAutomatedGa4ConfigurationOptOut):len((*c.CallOptions).SetAutomatedGa4ConfigurationOptOut)], opts...) |
| var resp *adminpb.SetAutomatedGa4ConfigurationOptOutResponse |
| err := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error { |
| var err error |
| resp, err = c.analyticsAdminClient.SetAutomatedGa4ConfigurationOptOut(ctx, req, settings.GRPC...) |
| return err |
| }, opts...) |
| if err != nil { |
| return nil, err |
| } |
| return resp, nil |
| } |
| |
| func (c *analyticsAdminGRPCClient) FetchAutomatedGa4ConfigurationOptOut(ctx context.Context, req *adminpb.FetchAutomatedGa4ConfigurationOptOutRequest, opts ...gax.CallOption) (*adminpb.FetchAutomatedGa4ConfigurationOptOutResponse, error) { |
| ctx = gax.InsertMetadataIntoOutgoingContext(ctx, c.xGoogHeaders...) |
| opts = append((*c.CallOptions).FetchAutomatedGa4ConfigurationOptOut[0:len((*c.CallOptions).FetchAutomatedGa4ConfigurationOptOut):len((*c.CallOptions).FetchAutomatedGa4ConfigurationOptOut)], opts...) |
| var resp *adminpb.FetchAutomatedGa4ConfigurationOptOutResponse |
| err := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error { |
| var err error |
| resp, err = c.analyticsAdminClient.FetchAutomatedGa4ConfigurationOptOut(ctx, req, settings.GRPC...) |
| return err |
| }, opts...) |
| if err != nil { |
| return nil, err |
| } |
| return resp, nil |
| } |
| |
| func (c *analyticsAdminGRPCClient) GetBigQueryLink(ctx context.Context, req *adminpb.GetBigQueryLinkRequest, opts ...gax.CallOption) (*adminpb.BigQueryLink, 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).GetBigQueryLink[0:len((*c.CallOptions).GetBigQueryLink):len((*c.CallOptions).GetBigQueryLink)], opts...) |
| var resp *adminpb.BigQueryLink |
| err := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error { |
| var err error |
| resp, err = c.analyticsAdminClient.GetBigQueryLink(ctx, req, settings.GRPC...) |
| return err |
| }, opts...) |
| if err != nil { |
| return nil, err |
| } |
| return resp, nil |
| } |
| |
| func (c *analyticsAdminGRPCClient) ListBigQueryLinks(ctx context.Context, req *adminpb.ListBigQueryLinksRequest, opts ...gax.CallOption) *BigQueryLinkIterator { |
| 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).ListBigQueryLinks[0:len((*c.CallOptions).ListBigQueryLinks):len((*c.CallOptions).ListBigQueryLinks)], opts...) |
| it := &BigQueryLinkIterator{} |
| req = proto.Clone(req).(*adminpb.ListBigQueryLinksRequest) |
| it.InternalFetch = func(pageSize int, pageToken string) ([]*adminpb.BigQueryLink, string, error) { |
| resp := &adminpb.ListBigQueryLinksResponse{} |
| 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 = c.analyticsAdminClient.ListBigQueryLinks(ctx, req, settings.GRPC...) |
| return err |
| }, opts...) |
| if err != nil { |
| return nil, "", err |
| } |
| |
| it.Response = resp |
| return resp.GetBigqueryLinks(), 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 *analyticsAdminGRPCClient) GetEnhancedMeasurementSettings(ctx context.Context, req *adminpb.GetEnhancedMeasurementSettingsRequest, opts ...gax.CallOption) (*adminpb.EnhancedMeasurementSettings, 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).GetEnhancedMeasurementSettings[0:len((*c.CallOptions).GetEnhancedMeasurementSettings):len((*c.CallOptions).GetEnhancedMeasurementSettings)], opts...) |
| var resp *adminpb.EnhancedMeasurementSettings |
| err := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error { |
| var err error |
| resp, err = c.analyticsAdminClient.GetEnhancedMeasurementSettings(ctx, req, settings.GRPC...) |
| return err |
| }, opts...) |
| if err != nil { |
| return nil, err |
| } |
| return resp, nil |
| } |
| |
| func (c *analyticsAdminGRPCClient) UpdateEnhancedMeasurementSettings(ctx context.Context, req *adminpb.UpdateEnhancedMeasurementSettingsRequest, opts ...gax.CallOption) (*adminpb.EnhancedMeasurementSettings, error) { |
| hds := []string{"x-goog-request-params", fmt.Sprintf("%s=%v", "enhanced_measurement_settings.name", url.QueryEscape(req.GetEnhancedMeasurementSettings().GetName()))} |
| |
| hds = append(c.xGoogHeaders, hds...) |
| ctx = gax.InsertMetadataIntoOutgoingContext(ctx, hds...) |
| opts = append((*c.CallOptions).UpdateEnhancedMeasurementSettings[0:len((*c.CallOptions).UpdateEnhancedMeasurementSettings):len((*c.CallOptions).UpdateEnhancedMeasurementSettings)], opts...) |
| var resp *adminpb.EnhancedMeasurementSettings |
| err := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error { |
| var err error |
| resp, err = c.analyticsAdminClient.UpdateEnhancedMeasurementSettings(ctx, req, settings.GRPC...) |
| return err |
| }, opts...) |
| if err != nil { |
| return nil, err |
| } |
| return resp, nil |
| } |
| |
| func (c *analyticsAdminGRPCClient) CreateConnectedSiteTag(ctx context.Context, req *adminpb.CreateConnectedSiteTagRequest, opts ...gax.CallOption) (*adminpb.CreateConnectedSiteTagResponse, error) { |
| ctx = gax.InsertMetadataIntoOutgoingContext(ctx, c.xGoogHeaders...) |
| opts = append((*c.CallOptions).CreateConnectedSiteTag[0:len((*c.CallOptions).CreateConnectedSiteTag):len((*c.CallOptions).CreateConnectedSiteTag)], opts...) |
| var resp *adminpb.CreateConnectedSiteTagResponse |
| err := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error { |
| var err error |
| resp, err = c.analyticsAdminClient.CreateConnectedSiteTag(ctx, req, settings.GRPC...) |
| return err |
| }, opts...) |
| if err != nil { |
| return nil, err |
| } |
| return resp, nil |
| } |
| |
| func (c *analyticsAdminGRPCClient) DeleteConnectedSiteTag(ctx context.Context, req *adminpb.DeleteConnectedSiteTagRequest, opts ...gax.CallOption) error { |
| ctx = gax.InsertMetadataIntoOutgoingContext(ctx, c.xGoogHeaders...) |
| opts = append((*c.CallOptions).DeleteConnectedSiteTag[0:len((*c.CallOptions).DeleteConnectedSiteTag):len((*c.CallOptions).DeleteConnectedSiteTag)], opts...) |
| err := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error { |
| var err error |
| _, err = c.analyticsAdminClient.DeleteConnectedSiteTag(ctx, req, settings.GRPC...) |
| return err |
| }, opts...) |
| return err |
| } |
| |
| func (c *analyticsAdminGRPCClient) ListConnectedSiteTags(ctx context.Context, req *adminpb.ListConnectedSiteTagsRequest, opts ...gax.CallOption) (*adminpb.ListConnectedSiteTagsResponse, error) { |
| ctx = gax.InsertMetadataIntoOutgoingContext(ctx, c.xGoogHeaders...) |
| opts = append((*c.CallOptions).ListConnectedSiteTags[0:len((*c.CallOptions).ListConnectedSiteTags):len((*c.CallOptions).ListConnectedSiteTags)], opts...) |
| var resp *adminpb.ListConnectedSiteTagsResponse |
| err := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error { |
| var err error |
| resp, err = c.analyticsAdminClient.ListConnectedSiteTags(ctx, req, settings.GRPC...) |
| return err |
| }, opts...) |
| if err != nil { |
| return nil, err |
| } |
| return resp, nil |
| } |
| |
| func (c *analyticsAdminGRPCClient) FetchConnectedGa4Property(ctx context.Context, req *adminpb.FetchConnectedGa4PropertyRequest, opts ...gax.CallOption) (*adminpb.FetchConnectedGa4PropertyResponse, error) { |
| ctx = gax.InsertMetadataIntoOutgoingContext(ctx, c.xGoogHeaders...) |
| opts = append((*c.CallOptions).FetchConnectedGa4Property[0:len((*c.CallOptions).FetchConnectedGa4Property):len((*c.CallOptions).FetchConnectedGa4Property)], opts...) |
| var resp *adminpb.FetchConnectedGa4PropertyResponse |
| err := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error { |
| var err error |
| resp, err = c.analyticsAdminClient.FetchConnectedGa4Property(ctx, req, settings.GRPC...) |
| return err |
| }, opts...) |
| if err != nil { |
| return nil, err |
| } |
| return resp, nil |
| } |
| |
| func (c *analyticsAdminGRPCClient) GetAdSenseLink(ctx context.Context, req *adminpb.GetAdSenseLinkRequest, opts ...gax.CallOption) (*adminpb.AdSenseLink, 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).GetAdSenseLink[0:len((*c.CallOptions).GetAdSenseLink):len((*c.CallOptions).GetAdSenseLink)], opts...) |
| var resp *adminpb.AdSenseLink |
| err := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error { |
| var err error |
| resp, err = c.analyticsAdminClient.GetAdSenseLink(ctx, req, settings.GRPC...) |
| return err |
| }, opts...) |
| if err != nil { |
| return nil, err |
| } |
| return resp, nil |
| } |
| |
| func (c *analyticsAdminGRPCClient) CreateAdSenseLink(ctx context.Context, req *adminpb.CreateAdSenseLinkRequest, opts ...gax.CallOption) (*adminpb.AdSenseLink, 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).CreateAdSenseLink[0:len((*c.CallOptions).CreateAdSenseLink):len((*c.CallOptions).CreateAdSenseLink)], opts...) |
| var resp *adminpb.AdSenseLink |
| err := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error { |
| var err error |
| resp, err = c.analyticsAdminClient.CreateAdSenseLink(ctx, req, settings.GRPC...) |
| return err |
| }, opts...) |
| if err != nil { |
| return nil, err |
| } |
| return resp, nil |
| } |
| |
| func (c *analyticsAdminGRPCClient) DeleteAdSenseLink(ctx context.Context, req *adminpb.DeleteAdSenseLinkRequest, 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).DeleteAdSenseLink[0:len((*c.CallOptions).DeleteAdSenseLink):len((*c.CallOptions).DeleteAdSenseLink)], opts...) |
| err := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error { |
| var err error |
| _, err = c.analyticsAdminClient.DeleteAdSenseLink(ctx, req, settings.GRPC...) |
| return err |
| }, opts...) |
| return err |
| } |
| |
| func (c *analyticsAdminGRPCClient) ListAdSenseLinks(ctx context.Context, req *adminpb.ListAdSenseLinksRequest, opts ...gax.CallOption) *AdSenseLinkIterator { |
| 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).ListAdSenseLinks[0:len((*c.CallOptions).ListAdSenseLinks):len((*c.CallOptions).ListAdSenseLinks)], opts...) |
| it := &AdSenseLinkIterator{} |
| req = proto.Clone(req).(*adminpb.ListAdSenseLinksRequest) |
| it.InternalFetch = func(pageSize int, pageToken string) ([]*adminpb.AdSenseLink, string, error) { |
| resp := &adminpb.ListAdSenseLinksResponse{} |
| 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 = c.analyticsAdminClient.ListAdSenseLinks(ctx, req, settings.GRPC...) |
| return err |
| }, opts...) |
| if err != nil { |
| return nil, "", err |
| } |
| |
| it.Response = resp |
| return resp.GetAdsenseLinks(), 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 *analyticsAdminGRPCClient) GetEventCreateRule(ctx context.Context, req *adminpb.GetEventCreateRuleRequest, opts ...gax.CallOption) (*adminpb.EventCreateRule, 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).GetEventCreateRule[0:len((*c.CallOptions).GetEventCreateRule):len((*c.CallOptions).GetEventCreateRule)], opts...) |
| var resp *adminpb.EventCreateRule |
| err := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error { |
| var err error |
| resp, err = c.analyticsAdminClient.GetEventCreateRule(ctx, req, settings.GRPC...) |
| return err |
| }, opts...) |
| if err != nil { |
| return nil, err |
| } |
| return resp, nil |
| } |
| |
| func (c *analyticsAdminGRPCClient) ListEventCreateRules(ctx context.Context, req *adminpb.ListEventCreateRulesRequest, opts ...gax.CallOption) *EventCreateRuleIterator { |
| 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).ListEventCreateRules[0:len((*c.CallOptions).ListEventCreateRules):len((*c.CallOptions).ListEventCreateRules)], opts...) |
| it := &EventCreateRuleIterator{} |
| req = proto.Clone(req).(*adminpb.ListEventCreateRulesRequest) |
| it.InternalFetch = func(pageSize int, pageToken string) ([]*adminpb.EventCreateRule, string, error) { |
| resp := &adminpb.ListEventCreateRulesResponse{} |
| 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 = c.analyticsAdminClient.ListEventCreateRules(ctx, req, settings.GRPC...) |
| return err |
| }, opts...) |
| if err != nil { |
| return nil, "", err |
| } |
| |
| it.Response = resp |
| return resp.GetEventCreateRules(), 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 *analyticsAdminGRPCClient) CreateEventCreateRule(ctx context.Context, req *adminpb.CreateEventCreateRuleRequest, opts ...gax.CallOption) (*adminpb.EventCreateRule, 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).CreateEventCreateRule[0:len((*c.CallOptions).CreateEventCreateRule):len((*c.CallOptions).CreateEventCreateRule)], opts...) |
| var resp *adminpb.EventCreateRule |
| err := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error { |
| var err error |
| resp, err = c.analyticsAdminClient.CreateEventCreateRule(ctx, req, settings.GRPC...) |
| return err |
| }, opts...) |
| if err != nil { |
| return nil, err |
| } |
| return resp, nil |
| } |
| |
| func (c *analyticsAdminGRPCClient) UpdateEventCreateRule(ctx context.Context, req *adminpb.UpdateEventCreateRuleRequest, opts ...gax.CallOption) (*adminpb.EventCreateRule, error) { |
| hds := []string{"x-goog-request-params", fmt.Sprintf("%s=%v", "event_create_rule.name", url.QueryEscape(req.GetEventCreateRule().GetName()))} |
| |
| hds = append(c.xGoogHeaders, hds...) |
| ctx = gax.InsertMetadataIntoOutgoingContext(ctx, hds...) |
| opts = append((*c.CallOptions).UpdateEventCreateRule[0:len((*c.CallOptions).UpdateEventCreateRule):len((*c.CallOptions).UpdateEventCreateRule)], opts...) |
| var resp *adminpb.EventCreateRule |
| err := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error { |
| var err error |
| resp, err = c.analyticsAdminClient.UpdateEventCreateRule(ctx, req, settings.GRPC...) |
| return err |
| }, opts...) |
| if err != nil { |
| return nil, err |
| } |
| return resp, nil |
| } |
| |
| func (c *analyticsAdminGRPCClient) DeleteEventCreateRule(ctx context.Context, req *adminpb.DeleteEventCreateRuleRequest, 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).DeleteEventCreateRule[0:len((*c.CallOptions).DeleteEventCreateRule):len((*c.CallOptions).DeleteEventCreateRule)], opts...) |
| err := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error { |
| var err error |
| _, err = c.analyticsAdminClient.DeleteEventCreateRule(ctx, req, settings.GRPC...) |
| return err |
| }, opts...) |
| return err |
| } |
| |
| func (c *analyticsAdminGRPCClient) UpdateDataRedactionSettings(ctx context.Context, req *adminpb.UpdateDataRedactionSettingsRequest, opts ...gax.CallOption) (*adminpb.DataRedactionSettings, error) { |
| hds := []string{"x-goog-request-params", fmt.Sprintf("%s=%v", "data_redaction_settings.name", url.QueryEscape(req.GetDataRedactionSettings().GetName()))} |
| |
| hds = append(c.xGoogHeaders, hds...) |
| ctx = gax.InsertMetadataIntoOutgoingContext(ctx, hds...) |
| opts = append((*c.CallOptions).UpdateDataRedactionSettings[0:len((*c.CallOptions).UpdateDataRedactionSettings):len((*c.CallOptions).UpdateDataRedactionSettings)], opts...) |
| var resp *adminpb.DataRedactionSettings |
| err := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error { |
| var err error |
| resp, err = c.analyticsAdminClient.UpdateDataRedactionSettings(ctx, req, settings.GRPC...) |
| return err |
| }, opts...) |
| if err != nil { |
| return nil, err |
| } |
| return resp, nil |
| } |
| |
| func (c *analyticsAdminGRPCClient) GetDataRedactionSettings(ctx context.Context, req *adminpb.GetDataRedactionSettingsRequest, opts ...gax.CallOption) (*adminpb.DataRedactionSettings, 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).GetDataRedactionSettings[0:len((*c.CallOptions).GetDataRedactionSettings):len((*c.CallOptions).GetDataRedactionSettings)], opts...) |
| var resp *adminpb.DataRedactionSettings |
| err := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error { |
| var err error |
| resp, err = c.analyticsAdminClient.GetDataRedactionSettings(ctx, req, settings.GRPC...) |
| return err |
| }, opts...) |
| if err != nil { |
| return nil, err |
| } |
| return resp, nil |
| } |
| |
| func (c *analyticsAdminGRPCClient) GetCalculatedMetric(ctx context.Context, req *adminpb.GetCalculatedMetricRequest, opts ...gax.CallOption) (*adminpb.CalculatedMetric, 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).GetCalculatedMetric[0:len((*c.CallOptions).GetCalculatedMetric):len((*c.CallOptions).GetCalculatedMetric)], opts...) |
| var resp *adminpb.CalculatedMetric |
| err := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error { |
| var err error |
| resp, err = c.analyticsAdminClient.GetCalculatedMetric(ctx, req, settings.GRPC...) |
| return err |
| }, opts...) |
| if err != nil { |
| return nil, err |
| } |
| return resp, nil |
| } |
| |
| func (c *analyticsAdminGRPCClient) CreateCalculatedMetric(ctx context.Context, req *adminpb.CreateCalculatedMetricRequest, opts ...gax.CallOption) (*adminpb.CalculatedMetric, 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).CreateCalculatedMetric[0:len((*c.CallOptions).CreateCalculatedMetric):len((*c.CallOptions).CreateCalculatedMetric)], opts...) |
| var resp *adminpb.CalculatedMetric |
| err := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error { |
| var err error |
| resp, err = c.analyticsAdminClient.CreateCalculatedMetric(ctx, req, settings.GRPC...) |
| return err |
| }, opts...) |
| if err != nil { |
| return nil, err |
| } |
| return resp, nil |
| } |
| |
| func (c *analyticsAdminGRPCClient) ListCalculatedMetrics(ctx context.Context, req *adminpb.ListCalculatedMetricsRequest, opts ...gax.CallOption) *CalculatedMetricIterator { |
| 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).ListCalculatedMetrics[0:len((*c.CallOptions).ListCalculatedMetrics):len((*c.CallOptions).ListCalculatedMetrics)], opts...) |
| it := &CalculatedMetricIterator{} |
| req = proto.Clone(req).(*adminpb.ListCalculatedMetricsRequest) |
| it.InternalFetch = func(pageSize int, pageToken string) ([]*adminpb.CalculatedMetric, string, error) { |
| resp := &adminpb.ListCalculatedMetricsResponse{} |
| 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 = c.analyticsAdminClient.ListCalculatedMetrics(ctx, req, settings.GRPC...) |
| return err |
| }, opts...) |
| if err != nil { |
| return nil, "", err |
| } |
| |
| it.Response = resp |
| return resp.GetCalculatedMetrics(), 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 *analyticsAdminGRPCClient) UpdateCalculatedMetric(ctx context.Context, req *adminpb.UpdateCalculatedMetricRequest, opts ...gax.CallOption) (*adminpb.CalculatedMetric, error) { |
| hds := []string{"x-goog-request-params", fmt.Sprintf("%s=%v", "calculated_metric.name", url.QueryEscape(req.GetCalculatedMetric().GetName()))} |
| |
| hds = append(c.xGoogHeaders, hds...) |
| ctx = gax.InsertMetadataIntoOutgoingContext(ctx, hds...) |
| opts = append((*c.CallOptions).UpdateCalculatedMetric[0:len((*c.CallOptions).UpdateCalculatedMetric):len((*c.CallOptions).UpdateCalculatedMetric)], opts...) |
| var resp *adminpb.CalculatedMetric |
| err := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error { |
| var err error |
| resp, err = c.analyticsAdminClient.UpdateCalculatedMetric(ctx, req, settings.GRPC...) |
| return err |
| }, opts...) |
| if err != nil { |
| return nil, err |
| } |
| return resp, nil |
| } |
| |
| func (c *analyticsAdminGRPCClient) DeleteCalculatedMetric(ctx context.Context, req *adminpb.DeleteCalculatedMetricRequest, 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).DeleteCalculatedMetric[0:len((*c.CallOptions).DeleteCalculatedMetric):len((*c.CallOptions).DeleteCalculatedMetric)], opts...) |
| err := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error { |
| var err error |
| _, err = c.analyticsAdminClient.DeleteCalculatedMetric(ctx, req, settings.GRPC...) |
| return err |
| }, opts...) |
| return err |
| } |
| |
| func (c *analyticsAdminGRPCClient) CreateRollupProperty(ctx context.Context, req *adminpb.CreateRollupPropertyRequest, opts ...gax.CallOption) (*adminpb.CreateRollupPropertyResponse, error) { |
| ctx = gax.InsertMetadataIntoOutgoingContext(ctx, c.xGoogHeaders...) |
| opts = append((*c.CallOptions).CreateRollupProperty[0:len((*c.CallOptions).CreateRollupProperty):len((*c.CallOptions).CreateRollupProperty)], opts...) |
| var resp *adminpb.CreateRollupPropertyResponse |
| err := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error { |
| var err error |
| resp, err = c.analyticsAdminClient.CreateRollupProperty(ctx, req, settings.GRPC...) |
| return err |
| }, opts...) |
| if err != nil { |
| return nil, err |
| } |
| return resp, nil |
| } |
| |
| func (c *analyticsAdminGRPCClient) GetRollupPropertySourceLink(ctx context.Context, req *adminpb.GetRollupPropertySourceLinkRequest, opts ...gax.CallOption) (*adminpb.RollupPropertySourceLink, 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).GetRollupPropertySourceLink[0:len((*c.CallOptions).GetRollupPropertySourceLink):len((*c.CallOptions).GetRollupPropertySourceLink)], opts...) |
| var resp *adminpb.RollupPropertySourceLink |
| err := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error { |
| var err error |
| resp, err = c.analyticsAdminClient.GetRollupPropertySourceLink(ctx, req, settings.GRPC...) |
| return err |
| }, opts...) |
| if err != nil { |
| return nil, err |
| } |
| return resp, nil |
| } |
| |
| func (c *analyticsAdminGRPCClient) ListRollupPropertySourceLinks(ctx context.Context, req *adminpb.ListRollupPropertySourceLinksRequest, opts ...gax.CallOption) *RollupPropertySourceLinkIterator { |
| 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).ListRollupPropertySourceLinks[0:len((*c.CallOptions).ListRollupPropertySourceLinks):len((*c.CallOptions).ListRollupPropertySourceLinks)], opts...) |
| it := &RollupPropertySourceLinkIterator{} |
| req = proto.Clone(req).(*adminpb.ListRollupPropertySourceLinksRequest) |
| it.InternalFetch = func(pageSize int, pageToken string) ([]*adminpb.RollupPropertySourceLink, string, error) { |
| resp := &adminpb.ListRollupPropertySourceLinksResponse{} |
| 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 = c.analyticsAdminClient.ListRollupPropertySourceLinks(ctx, req, settings.GRPC...) |
| return err |
| }, opts...) |
| if err != nil { |
| return nil, "", err |
| } |
| |
| it.Response = resp |
| return resp.GetRollupPropertySourceLinks(), 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 *analyticsAdminGRPCClient) CreateRollupPropertySourceLink(ctx context.Context, req *adminpb.CreateRollupPropertySourceLinkRequest, opts ...gax.CallOption) (*adminpb.RollupPropertySourceLink, 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).CreateRollupPropertySourceLink[0:len((*c.CallOptions).CreateRollupPropertySourceLink):len((*c.CallOptions).CreateRollupPropertySourceLink)], opts...) |
| var resp *adminpb.RollupPropertySourceLink |
| err := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error { |
| var err error |
| resp, err = c.analyticsAdminClient.CreateRollupPropertySourceLink(ctx, req, settings.GRPC...) |
| return err |
| }, opts...) |
| if err != nil { |
| return nil, err |
| } |
| return resp, nil |
| } |
| |
| func (c *analyticsAdminGRPCClient) DeleteRollupPropertySourceLink(ctx context.Context, req *adminpb.DeleteRollupPropertySourceLinkRequest, 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).DeleteRollupPropertySourceLink[0:len((*c.CallOptions).DeleteRollupPropertySourceLink):len((*c.CallOptions).DeleteRollupPropertySourceLink)], opts...) |
| err := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error { |
| var err error |
| _, err = c.analyticsAdminClient.DeleteRollupPropertySourceLink(ctx, req, settings.GRPC...) |
| return err |
| }, opts...) |
| return err |
| } |
| |
| func (c *analyticsAdminGRPCClient) CreateSubproperty(ctx context.Context, req *adminpb.CreateSubpropertyRequest, opts ...gax.CallOption) (*adminpb.CreateSubpropertyResponse, error) { |
| ctx = gax.InsertMetadataIntoOutgoingContext(ctx, c.xGoogHeaders...) |
| opts = append((*c.CallOptions).CreateSubproperty[0:len((*c.CallOptions).CreateSubproperty):len((*c.CallOptions).CreateSubproperty)], opts...) |
| var resp *adminpb.CreateSubpropertyResponse |
| err := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error { |
| var err error |
| resp, err = c.analyticsAdminClient.CreateSubproperty(ctx, req, settings.GRPC...) |
| return err |
| }, opts...) |
| if err != nil { |
| return nil, err |
| } |
| return resp, nil |
| } |
| |
| func (c *analyticsAdminGRPCClient) CreateSubpropertyEventFilter(ctx context.Context, req *adminpb.CreateSubpropertyEventFilterRequest, opts ...gax.CallOption) (*adminpb.SubpropertyEventFilter, 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).CreateSubpropertyEventFilter[0:len((*c.CallOptions).CreateSubpropertyEventFilter):len((*c.CallOptions).CreateSubpropertyEventFilter)], opts...) |
| var resp *adminpb.SubpropertyEventFilter |
| err := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error { |
| var err error |
| resp, err = c.analyticsAdminClient.CreateSubpropertyEventFilter(ctx, req, settings.GRPC...) |
| return err |
| }, opts...) |
| if err != nil { |
| return nil, err |
| } |
| return resp, nil |
| } |
| |
| func (c *analyticsAdminGRPCClient) GetSubpropertyEventFilter(ctx context.Context, req *adminpb.GetSubpropertyEventFilterRequest, opts ...gax.CallOption) (*adminpb.SubpropertyEventFilter, 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).GetSubpropertyEventFilter[0:len((*c.CallOptions).GetSubpropertyEventFilter):len((*c.CallOptions).GetSubpropertyEventFilter)], opts...) |
| var resp *adminpb.SubpropertyEventFilter |
| err := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error { |
| var err error |
| resp, err = c.analyticsAdminClient.GetSubpropertyEventFilter(ctx, req, settings.GRPC...) |
| return err |
| }, opts...) |
| if err != nil { |
| return nil, err |
| } |
| return resp, nil |
| } |
| |
| func (c *analyticsAdminGRPCClient) ListSubpropertyEventFilters(ctx context.Context, req *adminpb.ListSubpropertyEventFiltersRequest, opts ...gax.CallOption) *SubpropertyEventFilterIterator { |
| 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).ListSubpropertyEventFilters[0:len((*c.CallOptions).ListSubpropertyEventFilters):len((*c.CallOptions).ListSubpropertyEventFilters)], opts...) |
| it := &SubpropertyEventFilterIterator{} |
| req = proto.Clone(req).(*adminpb.ListSubpropertyEventFiltersRequest) |
| it.InternalFetch = func(pageSize int, pageToken string) ([]*adminpb.SubpropertyEventFilter, string, error) { |
| resp := &adminpb.ListSubpropertyEventFiltersResponse{} |
| 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 = c.analyticsAdminClient.ListSubpropertyEventFilters(ctx, req, settings.GRPC...) |
| return err |
| }, opts...) |
| if err != nil { |
| return nil, "", err |
| } |
| |
| it.Response = resp |
| return resp.GetSubpropertyEventFilters(), 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 *analyticsAdminGRPCClient) UpdateSubpropertyEventFilter(ctx context.Context, req *adminpb.UpdateSubpropertyEventFilterRequest, opts ...gax.CallOption) (*adminpb.SubpropertyEventFilter, error) { |
| hds := []string{"x-goog-request-params", fmt.Sprintf("%s=%v", "subproperty_event_filter.name", url.QueryEscape(req.GetSubpropertyEventFilter().GetName()))} |
| |
| hds = append(c.xGoogHeaders, hds...) |
| ctx = gax.InsertMetadataIntoOutgoingContext(ctx, hds...) |
| opts = append((*c.CallOptions).UpdateSubpropertyEventFilter[0:len((*c.CallOptions).UpdateSubpropertyEventFilter):len((*c.CallOptions).UpdateSubpropertyEventFilter)], opts...) |
| var resp *adminpb.SubpropertyEventFilter |
| err := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error { |
| var err error |
| resp, err = c.analyticsAdminClient.UpdateSubpropertyEventFilter(ctx, req, settings.GRPC...) |
| return err |
| }, opts...) |
| if err != nil { |
| return nil, err |
| } |
| return resp, nil |
| } |
| |
| func (c *analyticsAdminGRPCClient) DeleteSubpropertyEventFilter(ctx context.Context, req *adminpb.DeleteSubpropertyEventFilterRequest, 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).DeleteSubpropertyEventFilter[0:len((*c.CallOptions).DeleteSubpropertyEventFilter):len((*c.CallOptions).DeleteSubpropertyEventFilter)], opts...) |
| err := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error { |
| var err error |
| _, err = c.analyticsAdminClient.DeleteSubpropertyEventFilter(ctx, req, settings.GRPC...) |
| return err |
| }, opts...) |
| return err |
| } |
| |
| // GetAccount lookup for a single Account. |
| func (c *analyticsAdminRESTClient) GetAccount(ctx context.Context, req *adminpb.GetAccountRequest, opts ...gax.CallOption) (*adminpb.Account, error) { |
| baseUrl, err := url.Parse(c.endpoint) |
| if err != nil { |
| return nil, err |
| } |
| baseUrl.Path += fmt.Sprintf("/v1alpha/%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).GetAccount[0:len((*c.CallOptions).GetAccount):len((*c.CallOptions).GetAccount)], opts...) |
| unm := protojson.UnmarshalOptions{AllowPartial: true, DiscardUnknown: true} |
| resp := &adminpb.Account{} |
| 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 |
| |
| httpRsp, err := c.httpClient.Do(httpReq) |
| if err != nil { |
| return err |
| } |
| defer httpRsp.Body.Close() |
| |
| if err = googleapi.CheckResponse(httpRsp); err != nil { |
| return err |
| } |
| |
| buf, err := io.ReadAll(httpRsp.Body) |
| 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 |
| } |
| |
| // ListAccounts returns all accounts accessible by the caller. |
| // |
| // Note that these accounts might not currently have GA4 properties. |
| // Soft-deleted (ie: “trashed”) accounts are excluded by default. |
| // Returns an empty list if no relevant accounts are found. |
| func (c *analyticsAdminRESTClient) ListAccounts(ctx context.Context, req *adminpb.ListAccountsRequest, opts ...gax.CallOption) *AccountIterator { |
| it := &AccountIterator{} |
| req = proto.Clone(req).(*adminpb.ListAccountsRequest) |
| unm := protojson.UnmarshalOptions{AllowPartial: true, DiscardUnknown: true} |
| it.InternalFetch = func(pageSize int, pageToken string) ([]*adminpb.Account, string, error) { |
| resp := &adminpb.ListAccountsResponse{} |
| 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("/v1alpha/accounts") |
| |
| 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())) |
| } |
| if req.GetShowDeleted() { |
| params.Add("showDeleted", fmt.Sprintf("%v", req.GetShowDeleted())) |
| } |
| |
| 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 |
| |
| httpRsp, err := c.httpClient.Do(httpReq) |
| if err != nil { |
| return err |
| } |
| defer httpRsp.Body.Close() |
| |
| if err = googleapi.CheckResponse(httpRsp); err != nil { |
| return err |
| } |
| |
| buf, err := io.ReadAll(httpRsp.Body) |
| 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.GetAccounts(), 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 |
| } |
| |
| // DeleteAccount marks target Account as soft-deleted (ie: “trashed”) and returns it. |
| // |
| // This API does not have a method to restore soft-deleted accounts. |
| // However, they can be restored using the Trash Can UI. |
| // |
| // If the accounts are not restored before the expiration time, the account |
| // and all child resources (eg: Properties, GoogleAdsLinks, Streams, |
| // AccessBindings) will be permanently purged. |
| // https://support.google.com/analytics/answer/6154772 (at https://support.google.com/analytics/answer/6154772) |
| // |
| // Returns an error if the target is not found. |
| func (c *analyticsAdminRESTClient) DeleteAccount(ctx context.Context, req *adminpb.DeleteAccountRequest, opts ...gax.CallOption) error { |
| baseUrl, err := url.Parse(c.endpoint) |
| if err != nil { |
| return err |
| } |
| baseUrl.Path += fmt.Sprintf("/v1alpha/%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 |
| |
| httpRsp, err := c.httpClient.Do(httpReq) |
| if err != nil { |
| return err |
| } |
| defer httpRsp.Body.Close() |
| |
| // Returns nil if there is no error, otherwise wraps |
| // the response code and body into a non-nil error |
| return googleapi.CheckResponse(httpRsp) |
| }, opts...) |
| } |
| |
| // UpdateAccount updates an account. |
| func (c *analyticsAdminRESTClient) UpdateAccount(ctx context.Context, req *adminpb.UpdateAccountRequest, opts ...gax.CallOption) (*adminpb.Account, error) { |
| m := protojson.MarshalOptions{AllowPartial: true, UseEnumNumbers: true} |
| body := req.GetAccount() |
| 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("/v1alpha/%v", req.GetAccount().GetName()) |
| |
| params := url.Values{} |
| params.Add("$alt", "json;enum-encoding=int") |
| if req.GetUpdateMask() != nil { |
| updateMask, err := protojson.Marshal(req.GetUpdateMask()) |
| if err != nil { |
| return nil, err |
| } |
| params.Add("updateMask", string(updateMask[1:len(updateMask)-1])) |
| } |
| |
| baseUrl.RawQuery = params.Encode() |
| |
| // Build HTTP headers from client and context metadata. |
| hds := []string{"x-goog-request-params", fmt.Sprintf("%s=%v", "account.name", url.QueryEscape(req.GetAccount().GetName()))} |
| |
| hds = append(c.xGoogHeaders, hds...) |
| hds = append(hds, "Content-Type", "application/json") |
| headers := gax.BuildHeaders(ctx, hds...) |
| opts = append((*c.CallOptions).UpdateAccount[0:len((*c.CallOptions).UpdateAccount):len((*c.CallOptions).UpdateAccount)], opts...) |
| unm := protojson.UnmarshalOptions{AllowPartial: true, DiscardUnknown: true} |
| resp := &adminpb.Account{} |
| 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 |
| |
| httpRsp, err := c.httpClient.Do(httpReq) |
| if err != nil { |
| return err |
| } |
| defer httpRsp.Body.Close() |
| |
| if err = googleapi.CheckResponse(httpRsp); err != nil { |
| return err |
| } |
| |
| buf, err := io.ReadAll(httpRsp.Body) |
| 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 |
| } |
| |
| // ProvisionAccountTicket requests a ticket for creating an account. |
| func (c *analyticsAdminRESTClient) ProvisionAccountTicket(ctx context.Context, req *adminpb.ProvisionAccountTicketRequest, opts ...gax.CallOption) (*adminpb.ProvisionAccountTicketResponse, 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("/v1alpha/accounts:provisionAccountTicket") |
| |
| params := url.Values{} |
| params.Add("$alt", "json;enum-encoding=int") |
| |
| 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...) |
| opts = append((*c.CallOptions).ProvisionAccountTicket[0:len((*c.CallOptions).ProvisionAccountTicket):len((*c.CallOptions).ProvisionAccountTicket)], opts...) |
| unm := protojson.UnmarshalOptions{AllowPartial: true, DiscardUnknown: true} |
| resp := &adminpb.ProvisionAccountTicketResponse{} |
| 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 |
| |
| httpRsp, err := c.httpClient.Do(httpReq) |
| if err != nil { |
| return err |
| } |
| defer httpRsp.Body.Close() |
| |
| if err = googleapi.CheckResponse(httpRsp); err != nil { |
| return err |
| } |
| |
| buf, err := io.ReadAll(httpRsp.Body) |
| 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 |
| } |
| |
| // ListAccountSummaries returns summaries of all accounts accessible by the caller. |
| func (c *analyticsAdminRESTClient) ListAccountSummaries(ctx context.Context, req *adminpb.ListAccountSummariesRequest, opts ...gax.CallOption) *AccountSummaryIterator { |
| it := &AccountSummaryIterator{} |
| req = proto.Clone(req).(*adminpb.ListAccountSummariesRequest) |
| unm := protojson.UnmarshalOptions{AllowPartial: true, DiscardUnknown: true} |
| it.InternalFetch = func(pageSize int, pageToken string) ([]*adminpb.AccountSummary, string, error) { |
| resp := &adminpb.ListAccountSummariesResponse{} |
| 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("/v1alpha/accountSummaries") |
| |
| 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 |
| |
| httpRsp, err := c.httpClient.Do(httpReq) |
| if err != nil { |
| return err |
| } |
| defer httpRsp.Body.Close() |
| |
| if err = googleapi.CheckResponse(httpRsp); err != nil { |
| return err |
| } |
| |
| buf, err := io.ReadAll(httpRsp.Body) |
| 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.GetAccountSummaries(), 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 |
| } |
| |
| // GetProperty lookup for a single “GA4” Property. |
| func (c *analyticsAdminRESTClient) GetProperty(ctx context.Context, req *adminpb.GetPropertyRequest, opts ...gax.CallOption) (*adminpb.Property, error) { |
| baseUrl, err := url.Parse(c.endpoint) |
| if err != nil { |
| return nil, err |
| } |
| baseUrl.Path += fmt.Sprintf("/v1alpha/%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).GetProperty[0:len((*c.CallOptions).GetProperty):len((*c.CallOptions).GetProperty)], opts...) |
| unm := protojson.UnmarshalOptions{AllowPartial: true, DiscardUnknown: true} |
| resp := &adminpb.Property{} |
| 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 |
| |
| httpRsp, err := c.httpClient.Do(httpReq) |
| if err != nil { |
| return err |
| } |
| defer httpRsp.Body.Close() |
| |
| if err = googleapi.CheckResponse(httpRsp); err != nil { |
| return err |
| } |
| |
| buf, err := io.ReadAll(httpRsp.Body) |
| 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 |
| } |
| |
| // ListProperties returns child Properties under the specified parent Account. |
| // |
| // Only “GA4” properties will be returned. |
| // Properties will be excluded if the caller does not have access. |
| // Soft-deleted (ie: “trashed”) properties are excluded by default. |
| // Returns an empty list if no relevant properties are found. |
| func (c *analyticsAdminRESTClient) ListProperties(ctx context.Context, req *adminpb.ListPropertiesRequest, opts ...gax.CallOption) *PropertyIterator { |
| it := &PropertyIterator{} |
| req = proto.Clone(req).(*adminpb.ListPropertiesRequest) |
| unm := protojson.UnmarshalOptions{AllowPartial: true, DiscardUnknown: true} |
| it.InternalFetch = func(pageSize int, pageToken string) ([]*adminpb.Property, string, error) { |
| resp := &adminpb.ListPropertiesResponse{} |
| 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("/v1alpha/properties") |
| |
| params := url.Values{} |
| params.Add("$alt", "json;enum-encoding=int") |
| 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())) |
| } |
| if req.GetShowDeleted() { |
| params.Add("showDeleted", fmt.Sprintf("%v", req.GetShowDeleted())) |
| } |
| |
| 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 |
| |
| httpRsp, err := c.httpClient.Do(httpReq) |
| if err != nil { |
| return err |
| } |
| defer httpRsp.Body.Close() |
| |
| if err = googleapi.CheckResponse(httpRsp); err != nil { |
| return err |
| } |
| |
| buf, err := io.ReadAll(httpRsp.Body) |
| 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.GetProperties(), 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 |
| } |
| |
| // CreateProperty creates an “GA4” property with the specified location and attributes. |
| func (c *analyticsAdminRESTClient) CreateProperty(ctx context.Context, req *adminpb.CreatePropertyRequest, opts ...gax.CallOption) (*adminpb.Property, error) { |
| m := protojson.MarshalOptions{AllowPartial: true, UseEnumNumbers: true} |
| body := req.GetProperty() |
| 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("/v1alpha/properties") |
| |
| params := url.Values{} |
| params.Add("$alt", "json;enum-encoding=int") |
| |
| 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...) |
| opts = append((*c.CallOptions).CreateProperty[0:len((*c.CallOptions).CreateProperty):len((*c.CallOptions).CreateProperty)], opts...) |
| unm := protojson.UnmarshalOptions{AllowPartial: true, DiscardUnknown: true} |
| resp := &adminpb.Property{} |
| 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 |
| |
| httpRsp, err := c.httpClient.Do(httpReq) |
| if err != nil { |
| return err |
| } |
| defer httpRsp.Body.Close() |
| |
| if err = googleapi.CheckResponse(httpRsp); err != nil { |
| return err |
| } |
| |
| buf, err := io.ReadAll(httpRsp.Body) |
| 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 |
| } |
| |
| // DeleteProperty marks target Property as soft-deleted (ie: “trashed”) and returns it. |
| // |
| // This API does not have a method to restore soft-deleted properties. |
| // However, they can be restored using the Trash Can UI. |
| // |
| // If the properties are not restored before the expiration time, the Property |
| // and all child resources (eg: GoogleAdsLinks, Streams, AccessBindings) |
| // will be permanently purged. |
| // https://support.google.com/analytics/answer/6154772 (at https://support.google.com/analytics/answer/6154772) |
| // |
| // Returns an error if the target is not found, or is not a GA4 Property. |
| func (c *analyticsAdminRESTClient) DeleteProperty(ctx context.Context, req *adminpb.DeletePropertyRequest, opts ...gax.CallOption) (*adminpb.Property, error) { |
| baseUrl, err := url.Parse(c.endpoint) |
| if err != nil { |
| return nil, err |
| } |
| baseUrl.Path += fmt.Sprintf("/v1alpha/%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).DeleteProperty[0:len((*c.CallOptions).DeleteProperty):len((*c.CallOptions).DeleteProperty)], opts...) |
| unm := protojson.UnmarshalOptions{AllowPartial: true, DiscardUnknown: true} |
| resp := &adminpb.Property{} |
| 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 |
| |
| httpRsp, err := c.httpClient.Do(httpReq) |
| if err != nil { |
| return err |
| } |
| defer httpRsp.Body.Close() |
| |
| if err = googleapi.CheckResponse(httpRsp); err != nil { |
| return err |
| } |
| |
| buf, err := io.ReadAll(httpRsp.Body) |
| 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 |
| } |
| |
| // UpdateProperty updates a property. |
| func (c *analyticsAdminRESTClient) UpdateProperty(ctx context.Context, req *adminpb.UpdatePropertyRequest, opts ...gax.CallOption) (*adminpb.Property, error) { |
| m := protojson.MarshalOptions{AllowPartial: true, UseEnumNumbers: true} |
| body := req.GetProperty() |
| 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("/v1alpha/%v", req.GetProperty().GetName()) |
| |
| params := url.Values{} |
| params.Add("$alt", "json;enum-encoding=int") |
| if req.GetUpdateMask() != nil { |
| updateMask, err := protojson.Marshal(req.GetUpdateMask()) |
| if err != nil { |
| return nil, err |
| } |
| params.Add("updateMask", string(updateMask[1:len(updateMask)-1])) |
| } |
| |
| baseUrl.RawQuery = params.Encode() |
| |
| // Build HTTP headers from client and context metadata. |
| hds := []string{"x-goog-request-params", fmt.Sprintf("%s=%v", "property.name", url.QueryEscape(req.GetProperty().GetName()))} |
| |
| hds = append(c.xGoogHeaders, hds...) |
| hds = append(hds, "Content-Type", "application/json") |
| headers := gax.BuildHeaders(ctx, hds...) |
| opts = append((*c.CallOptions).UpdateProperty[0:len((*c.CallOptions).UpdateProperty):len((*c.CallOptions).UpdateProperty)], opts...) |
| unm := protojson.UnmarshalOptions{AllowPartial: true, DiscardUnknown: true} |
| resp := &adminpb.Property{} |
| 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 |
| |
| httpRsp, err := c.httpClient.Do(httpReq) |
| if err != nil { |
| return err |
| } |
| defer httpRsp.Body.Close() |
| |
| if err = googleapi.CheckResponse(httpRsp); err != nil { |
| return err |
| } |
| |
| buf, err := io.ReadAll(httpRsp.Body) |
| 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 |
| } |
| |
| // CreateFirebaseLink creates a FirebaseLink. |
| // |
| // Properties can have at most one FirebaseLink. |
| func (c *analyticsAdminRESTClient) CreateFirebaseLink(ctx context.Context, req *adminpb.CreateFirebaseLinkRequest, opts ...gax.CallOption) (*adminpb.FirebaseLink, error) { |
| m := protojson.MarshalOptions{AllowPartial: true, UseEnumNumbers: true} |
| body := req.GetFirebaseLink() |
| 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("/v1alpha/%v/firebaseLinks", 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).CreateFirebaseLink[0:len((*c.CallOptions).CreateFirebaseLink):len((*c.CallOptions).CreateFirebaseLink)], opts...) |
| unm := protojson.UnmarshalOptions{AllowPartial: true, DiscardUnknown: true} |
| resp := &adminpb.FirebaseLink{} |
| 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 |
| |
| httpRsp, err := c.httpClient.Do(httpReq) |
| if err != nil { |
| return err |
| } |
| defer httpRsp.Body.Close() |
| |
| if err = googleapi.CheckResponse(httpRsp); err != nil { |
| return err |
| } |
| |
| buf, err := io.ReadAll(httpRsp.Body) |
| 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 |
| } |
| |
| // DeleteFirebaseLink deletes a FirebaseLink on a property |
| func (c *analyticsAdminRESTClient) DeleteFirebaseLink(ctx context.Context, req *adminpb.DeleteFirebaseLinkRequest, opts ...gax.CallOption) error { |
| baseUrl, err := url.Parse(c.endpoint) |
| if err != nil { |
| return err |
| } |
| baseUrl.Path += fmt.Sprintf("/v1alpha/%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 |
| |
| httpRsp, err := c.httpClient.Do(httpReq) |
| if err != nil { |
| return err |
| } |
| defer httpRsp.Body.Close() |
| |
| // Returns nil if there is no error, otherwise wraps |
| // the response code and body into a non-nil error |
| return googleapi.CheckResponse(httpRsp) |
| }, opts...) |
| } |
| |
| // ListFirebaseLinks lists FirebaseLinks on a property. |
| // Properties can have at most one FirebaseLink. |
| func (c *analyticsAdminRESTClient) ListFirebaseLinks(ctx context.Context, req *adminpb.ListFirebaseLinksRequest, opts ...gax.CallOption) *FirebaseLinkIterator { |
| it := &FirebaseLinkIterator{} |
| req = proto.Clone(req).(*adminpb.ListFirebaseLinksRequest) |
| unm := protojson.UnmarshalOptions{AllowPartial: true, DiscardUnknown: true} |
| it.InternalFetch = func(pageSize int, pageToken string) ([]*adminpb.FirebaseLink, string, error) { |
| resp := &adminpb.ListFirebaseLinksResponse{} |
| 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("/v1alpha/%v/firebaseLinks", 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 |
| |
| httpRsp, err := c.httpClient.Do(httpReq) |
| if err != nil { |
| return err |
| } |
| defer httpRsp.Body.Close() |
| |
| if err = googleapi.CheckResponse(httpRsp); err != nil { |
| return err |
| } |
| |
| buf, err := io.ReadAll(httpRsp.Body) |
| 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.GetFirebaseLinks(), 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 |
| } |
| |
| // GetGlobalSiteTag returns the Site Tag for the specified web stream. |
| // Site Tags are immutable singletons. |
| func (c *analyticsAdminRESTClient) GetGlobalSiteTag(ctx context.Context, req *adminpb.GetGlobalSiteTagRequest, opts ...gax.CallOption) (*adminpb.GlobalSiteTag, error) { |
| baseUrl, err := url.Parse(c.endpoint) |
| if err != nil { |
| return nil, err |
| } |
| baseUrl.Path += fmt.Sprintf("/v1alpha/%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).GetGlobalSiteTag[0:len((*c.CallOptions).GetGlobalSiteTag):len((*c.CallOptions).GetGlobalSiteTag)], opts...) |
| unm := protojson.UnmarshalOptions{AllowPartial: true, DiscardUnknown: true} |
| resp := &adminpb.GlobalSiteTag{} |
| 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 |
| |
| httpRsp, err := c.httpClient.Do(httpReq) |
| if err != nil { |
| return err |
| } |
| defer httpRsp.Body.Close() |
| |
| if err = googleapi.CheckResponse(httpRsp); err != nil { |
| return err |
| } |
| |
| buf, err := io.ReadAll(httpRsp.Body) |
| 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 |
| } |
| |
| // CreateGoogleAdsLink creates a GoogleAdsLink. |
| func (c *analyticsAdminRESTClient) CreateGoogleAdsLink(ctx context.Context, req *adminpb.CreateGoogleAdsLinkRequest, opts ...gax.CallOption) (*adminpb.GoogleAdsLink, error) { |
| m := protojson.MarshalOptions{AllowPartial: true, UseEnumNumbers: true} |
| body := req.GetGoogleAdsLink() |
| 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("/v1alpha/%v/googleAdsLinks", 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).CreateGoogleAdsLink[0:len((*c.CallOptions).CreateGoogleAdsLink):len((*c.CallOptions).CreateGoogleAdsLink)], opts...) |
| unm := protojson.UnmarshalOptions{AllowPartial: true, DiscardUnknown: true} |
| resp := &adminpb.GoogleAdsLink{} |
| 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 |
| |
| httpRsp, err := c.httpClient.Do(httpReq) |
| if err != nil { |
| return err |
| } |
| defer httpRsp.Body.Close() |
| |
| if err = googleapi.CheckResponse(httpRsp); err != nil { |
| return err |
| } |
| |
| buf, err := io.ReadAll(httpRsp.Body) |
| 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 |
| } |
| |
| // UpdateGoogleAdsLink updates a GoogleAdsLink on a property |
| func (c *analyticsAdminRESTClient) UpdateGoogleAdsLink(ctx context.Context, req *adminpb.UpdateGoogleAdsLinkRequest, opts ...gax.CallOption) (*adminpb.GoogleAdsLink, error) { |
| m := protojson.MarshalOptions{AllowPartial: true, UseEnumNumbers: true} |
| body := req.GetGoogleAdsLink() |
| 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("/v1alpha/%v", req.GetGoogleAdsLink().GetName()) |
| |
| params := url.Values{} |
| params.Add("$alt", "json;enum-encoding=int") |
| if req.GetUpdateMask() != nil { |
| updateMask, err := protojson.Marshal(req.GetUpdateMask()) |
| if err != nil { |
| return nil, err |
| } |
| params.Add("updateMask", string(updateMask[1:len(updateMask)-1])) |
| } |
| |
| baseUrl.RawQuery = params.Encode() |
| |
| // Build HTTP headers from client and context metadata. |
| hds := []string{"x-goog-request-params", fmt.Sprintf("%s=%v", "google_ads_link.name", url.QueryEscape(req.GetGoogleAdsLink().GetName()))} |
| |
| hds = append(c.xGoogHeaders, hds...) |
| hds = append(hds, "Content-Type", "application/json") |
| headers := gax.BuildHeaders(ctx, hds...) |
| opts = append((*c.CallOptions).UpdateGoogleAdsLink[0:len((*c.CallOptions).UpdateGoogleAdsLink):len((*c.CallOptions).UpdateGoogleAdsLink)], opts...) |
| unm := protojson.UnmarshalOptions{AllowPartial: true, DiscardUnknown: true} |
| resp := &adminpb.GoogleAdsLink{} |
| 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 |
| |
| httpRsp, err := c.httpClient.Do(httpReq) |
| if err != nil { |
| return err |
| } |
| defer httpRsp.Body.Close() |
| |
| if err = googleapi.CheckResponse(httpRsp); err != nil { |
| return err |
| } |
| |
| buf, err := io.ReadAll(httpRsp.Body) |
| 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 |
| } |
| |
| // DeleteGoogleAdsLink deletes a GoogleAdsLink on a property |
| func (c *analyticsAdminRESTClient) DeleteGoogleAdsLink(ctx context.Context, req *adminpb.DeleteGoogleAdsLinkRequest, opts ...gax.CallOption) error { |
| baseUrl, err := url.Parse(c.endpoint) |
| if err != nil { |
| return err |
| } |
| baseUrl.Path += fmt.Sprintf("/v1alpha/%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 |
| |
| httpRsp, err := c.httpClient.Do(httpReq) |
| if err != nil { |
| return err |
| } |
| defer httpRsp.Body.Close() |
| |
| // Returns nil if there is no error, otherwise wraps |
| // the response code and body into a non-nil error |
| return googleapi.CheckResponse(httpRsp) |
| }, opts...) |
| } |
| |
| // ListGoogleAdsLinks lists GoogleAdsLinks on a property. |
| func (c *analyticsAdminRESTClient) ListGoogleAdsLinks(ctx context.Context, req *adminpb.ListGoogleAdsLinksRequest, opts ...gax.CallOption) *GoogleAdsLinkIterator { |
| it := &GoogleAdsLinkIterator{} |
| req = proto.Clone(req).(*adminpb.ListGoogleAdsLinksRequest) |
| unm := protojson.UnmarshalOptions{AllowPartial: true, DiscardUnknown: true} |
| it.InternalFetch = func(pageSize int, pageToken string) ([]*adminpb.GoogleAdsLink, string, error) { |
| resp := &adminpb.ListGoogleAdsLinksResponse{} |
| 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("/v1alpha/%v/googleAdsLinks", 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 |
| |
| httpRsp, err := c.httpClient.Do(httpReq) |
| if err != nil { |
| return err |
| } |
| defer httpRsp.Body.Close() |
| |
| if err = googleapi.CheckResponse(httpRsp); err != nil { |
| return err |
| } |
| |
| buf, err := io.ReadAll(httpRsp.Body) |
| 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.GetGoogleAdsLinks(), 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 |
| } |
| |
| // GetDataSharingSettings get data sharing settings on an account. |
| // Data sharing settings are singletons. |
| func (c *analyticsAdminRESTClient) GetDataSharingSettings(ctx context.Context, req *adminpb.GetDataSharingSettingsRequest, opts ...gax.CallOption) (*adminpb.DataSharingSettings, error) { |
| baseUrl, err := url.Parse(c.endpoint) |
| if err != nil { |
| return nil, err |
| } |
| baseUrl.Path += fmt.Sprintf("/v1alpha/%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).GetDataSharingSettings[0:len((*c.CallOptions).GetDataSharingSettings):len((*c.CallOptions).GetDataSharingSettings)], opts...) |
| unm := protojson.UnmarshalOptions{AllowPartial: true, DiscardUnknown: true} |
| resp := &adminpb.DataSharingSettings{} |
| 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 |
| |
| httpRsp, err := c.httpClient.Do(httpReq) |
| if err != nil { |
| return err |
| } |
| defer httpRsp.Body.Close() |
| |
| if err = googleapi.CheckResponse(httpRsp); err != nil { |
| return err |
| } |
| |
| buf, err := io.ReadAll(httpRsp.Body) |
| 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 |
| } |
| |
| // GetMeasurementProtocolSecret lookup for a single “GA4” MeasurementProtocolSecret. |
| func (c *analyticsAdminRESTClient) GetMeasurementProtocolSecret(ctx context.Context, req *adminpb.GetMeasurementProtocolSecretRequest, opts ...gax.CallOption) (*adminpb.MeasurementProtocolSecret, error) { |
| baseUrl, err := url.Parse(c.endpoint) |
| if err != nil { |
| return nil, err |
| } |
| baseUrl.Path += fmt.Sprintf("/v1alpha/%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).GetMeasurementProtocolSecret[0:len((*c.CallOptions).GetMeasurementProtocolSecret):len((*c.CallOptions).GetMeasurementProtocolSecret)], opts...) |
| unm := protojson.UnmarshalOptions{AllowPartial: true, DiscardUnknown: true} |
| resp := &adminpb.MeasurementProtocolSecret{} |
| 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 |
| |
| httpRsp, err := c.httpClient.Do(httpReq) |
| if err != nil { |
| return err |
| } |
| defer httpRsp.Body.Close() |
| |
| if err = googleapi.CheckResponse(httpRsp); err != nil { |
| return err |
| } |
| |
| buf, err := io.ReadAll(httpRsp.Body) |
| 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 |
| } |
| |
| // ListMeasurementProtocolSecrets returns child MeasurementProtocolSecrets under the specified parent |
| // Property. |
| func (c *analyticsAdminRESTClient) ListMeasurementProtocolSecrets(ctx context.Context, req *adminpb.ListMeasurementProtocolSecretsRequest, opts ...gax.CallOption) *MeasurementProtocolSecretIterator { |
| it := &MeasurementProtocolSecretIterator{} |
| req = proto.Clone(req).(*adminpb.ListMeasurementProtocolSecretsRequest) |
| unm := protojson.UnmarshalOptions{AllowPartial: true, DiscardUnknown: true} |
| it.InternalFetch = func(pageSize int, pageToken string) ([]*adminpb.MeasurementProtocolSecret, string, error) { |
| resp := &adminpb.ListMeasurementProtocolSecretsResponse{} |
| 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("/v1alpha/%v/measurementProtocolSecrets", 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 |
| |
| httpRsp, err := c.httpClient.Do(httpReq) |
| if err != nil { |
| return err |
| } |
| defer httpRsp.Body.Close() |
| |
| if err = googleapi.CheckResponse(httpRsp); err != nil { |
| return err |
| } |
| |
| buf, err := io.ReadAll(httpRsp.Body) |
| 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.GetMeasurementProtocolSecrets(), 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 |
| } |
| |
| // CreateMeasurementProtocolSecret creates a measurement protocol secret. |
| func (c *analyticsAdminRESTClient) CreateMeasurementProtocolSecret(ctx context.Context, req *adminpb.CreateMeasurementProtocolSecretRequest, opts ...gax.CallOption) (*adminpb.MeasurementProtocolSecret, error) { |
| m := protojson.MarshalOptions{AllowPartial: true, UseEnumNumbers: true} |
| body := req.GetMeasurementProtocolSecret() |
| 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("/v1alpha/%v/measurementProtocolSecrets", 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).CreateMeasurementProtocolSecret[0:len((*c.CallOptions).CreateMeasurementProtocolSecret):len((*c.CallOptions).CreateMeasurementProtocolSecret)], opts...) |
| unm := protojson.UnmarshalOptions{AllowPartial: true, DiscardUnknown: true} |
| resp := &adminpb.MeasurementProtocolSecret{} |
| 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 |
| |
| httpRsp, err := c.httpClient.Do(httpReq) |
| if err != nil { |
| return err |
| } |
| defer httpRsp.Body.Close() |
| |
| if err = googleapi.CheckResponse(httpRsp); err != nil { |
| return err |
| } |
| |
| buf, err := io.ReadAll(httpRsp.Body) |
| 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 |
| } |
| |
| // DeleteMeasurementProtocolSecret deletes target MeasurementProtocolSecret. |
| func (c *analyticsAdminRESTClient) DeleteMeasurementProtocolSecret(ctx context.Context, req *adminpb.DeleteMeasurementProtocolSecretRequest, opts ...gax.CallOption) error { |
| baseUrl, err := url.Parse(c.endpoint) |
| if err != nil { |
| return err |
| } |
| baseUrl.Path += fmt.Sprintf("/v1alpha/%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 |
| |
| httpRsp, err := c.httpClient.Do(httpReq) |
| if err != nil { |
| return err |
| } |
| defer httpRsp.Body.Close() |
| |
| // Returns nil if there is no error, otherwise wraps |
| // the response code and body into a non-nil error |
| return googleapi.CheckResponse(httpRsp) |
| }, opts...) |
| } |
| |
| // UpdateMeasurementProtocolSecret updates a measurement protocol secret. |
| func (c *analyticsAdminRESTClient) UpdateMeasurementProtocolSecret(ctx context.Context, req *adminpb.UpdateMeasurementProtocolSecretRequest, opts ...gax.CallOption) (*adminpb.MeasurementProtocolSecret, error) { |
| m := protojson.MarshalOptions{AllowPartial: true, UseEnumNumbers: true} |
| body := req.GetMeasurementProtocolSecret() |
| 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("/v1alpha/%v", req.GetMeasurementProtocolSecret().GetName()) |
| |
| params := url.Values{} |
| params.Add("$alt", "json;enum-encoding=int") |
| if req.GetUpdateMask() != nil { |
| updateMask, err := protojson.Marshal(req.GetUpdateMask()) |
| if err != nil { |
| return nil, err |
| } |
| params.Add("updateMask", string(updateMask[1:len(updateMask)-1])) |
| } |
| |
| baseUrl.RawQuery = params.Encode() |
| |
| // Build HTTP headers from client and context metadata. |
| hds := []string{"x-goog-request-params", fmt.Sprintf("%s=%v", "measurement_protocol_secret.name", url.QueryEscape(req.GetMeasurementProtocolSecret().GetName()))} |
| |
| hds = append(c.xGoogHeaders, hds...) |
| hds = append(hds, "Content-Type", "application/json") |
| headers := gax.BuildHeaders(ctx, hds...) |
| opts = append((*c.CallOptions).UpdateMeasurementProtocolSecret[0:len((*c.CallOptions).UpdateMeasurementProtocolSecret):len((*c.CallOptions).UpdateMeasurementProtocolSecret)], opts...) |
| unm := protojson.UnmarshalOptions{AllowPartial: true, DiscardUnknown: true} |
| resp := &adminpb.MeasurementProtocolSecret{} |
| 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 |
| |
| httpRsp, err := c.httpClient.Do(httpReq) |
| if err != nil { |
| return err |
| } |
| defer httpRsp.Body.Close() |
| |
| if err = googleapi.CheckResponse(httpRsp); err != nil { |
| return err |
| } |
| |
| buf, err := io.ReadAll(httpRsp.Body) |
| 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 |
| } |
| |
| // AcknowledgeUserDataCollection acknowledges the terms of user data collection for the specified property. |
| // |
| // This acknowledgement must be completed (either in the Google Analytics UI |
| // or through this API) before MeasurementProtocolSecret resources may be |
| // created. |
| func (c *analyticsAdminRESTClient) AcknowledgeUserDataCollection(ctx context.Context, req *adminpb.AcknowledgeUserDataCollectionRequest, opts ...gax.CallOption) (*adminpb.AcknowledgeUserDataCollectionResponse, 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("/v1alpha/%v:acknowledgeUserDataCollection", req.GetProperty()) |
| |
| 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", "property", url.QueryEscape(req.GetProperty()))} |
| |
| hds = append(c.xGoogHeaders, hds...) |
| hds = append(hds, "Content-Type", "application/json") |
| headers := gax.BuildHeaders(ctx, hds...) |
| opts = append((*c.CallOptions).AcknowledgeUserDataCollection[0:len((*c.CallOptions).AcknowledgeUserDataCollection):len((*c.CallOptions).AcknowledgeUserDataCollection)], opts...) |
| unm := protojson.UnmarshalOptions{AllowPartial: true, DiscardUnknown: true} |
| resp := &adminpb.AcknowledgeUserDataCollectionResponse{} |
| 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 |
| |
| httpRsp, err := c.httpClient.Do(httpReq) |
| if err != nil { |
| return err |
| } |
| defer httpRsp.Body.Close() |
| |
| if err = googleapi.CheckResponse(httpRsp); err != nil { |
| return err |
| } |
| |
| buf, err := io.ReadAll(httpRsp.Body) |
| 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 |
| } |
| |
| // GetSKAdNetworkConversionValueSchema looks up a single SKAdNetworkConversionValueSchema. |
| func (c *analyticsAdminRESTClient) GetSKAdNetworkConversionValueSchema(ctx context.Context, req *adminpb.GetSKAdNetworkConversionValueSchemaRequest, opts ...gax.CallOption) (*adminpb.SKAdNetworkConversionValueSchema, error) { |
| baseUrl, err := url.Parse(c.endpoint) |
| if err != nil { |
| return nil, err |
| } |
| baseUrl.Path += fmt.Sprintf("/v1alpha/%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).GetSKAdNetworkConversionValueSchema[0:len((*c.CallOptions).GetSKAdNetworkConversionValueSchema):len((*c.CallOptions).GetSKAdNetworkConversionValueSchema)], opts...) |
| unm := protojson.UnmarshalOptions{AllowPartial: true, DiscardUnknown: true} |
| resp := &adminpb.SKAdNetworkConversionValueSchema{} |
| 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 |
| |
| httpRsp, err := c.httpClient.Do(httpReq) |
| if err != nil { |
| return err |
| } |
| defer httpRsp.Body.Close() |
| |
| if err = googleapi.CheckResponse(httpRsp); err != nil { |
| return err |
| } |
| |
| buf, err := io.ReadAll(httpRsp.Body) |
| 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 |
| } |
| |
| // CreateSKAdNetworkConversionValueSchema creates a SKAdNetworkConversionValueSchema. |
| func (c *analyticsAdminRESTClient) CreateSKAdNetworkConversionValueSchema(ctx context.Context, req *adminpb.CreateSKAdNetworkConversionValueSchemaRequest, opts ...gax.CallOption) (*adminpb.SKAdNetworkConversionValueSchema, error) { |
| m := protojson.MarshalOptions{AllowPartial: true, UseEnumNumbers: true} |
| body := req.GetSkadnetworkConversionValueSchema() |
| 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("/v1alpha/%v/sKAdNetworkConversionValueSchema", 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).CreateSKAdNetworkConversionValueSchema[0:len((*c.CallOptions).CreateSKAdNetworkConversionValueSchema):len((*c.CallOptions).CreateSKAdNetworkConversionValueSchema)], opts...) |
| unm := protojson.UnmarshalOptions{AllowPartial: true, DiscardUnknown: true} |
| resp := &adminpb.SKAdNetworkConversionValueSchema{} |
| 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 |
| |
| httpRsp, err := c.httpClient.Do(httpReq) |
| if err != nil { |
| return err |
| } |
| defer httpRsp.Body.Close() |
| |
| if err = googleapi.CheckResponse(httpRsp); err != nil { |
| return err |
| } |
| |
| buf, err := io.ReadAll(httpRsp.Body) |
| 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 |
| } |
| |
| // DeleteSKAdNetworkConversionValueSchema deletes target SKAdNetworkConversionValueSchema. |
| func (c *analyticsAdminRESTClient) DeleteSKAdNetworkConversionValueSchema(ctx context.Context, req *adminpb.DeleteSKAdNetworkConversionValueSchemaRequest, opts ...gax.CallOption) error { |
| baseUrl, err := url.Parse(c.endpoint) |
| if err != nil { |
| return err |
| } |
| baseUrl.Path += fmt.Sprintf("/v1alpha/%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 |
| |
| httpRsp, err := c.httpClient.Do(httpReq) |
| if err != nil { |
| return err |
| } |
| defer httpRsp.Body.Close() |
| |
| // Returns nil if there is no error, otherwise wraps |
| // the response code and body into a non-nil error |
| return googleapi.CheckResponse(httpRsp) |
| }, opts...) |
| } |
| |
| // UpdateSKAdNetworkConversionValueSchema updates a SKAdNetworkConversionValueSchema. |
| func (c *analyticsAdminRESTClient) UpdateSKAdNetworkConversionValueSchema(ctx context.Context, req *adminpb.UpdateSKAdNetworkConversionValueSchemaRequest, opts ...gax.CallOption) (*adminpb.SKAdNetworkConversionValueSchema, error) { |
| m := protojson.MarshalOptions{AllowPartial: true, UseEnumNumbers: true} |
| body := req.GetSkadnetworkConversionValueSchema() |
| 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("/v1alpha/%v", req.GetSkadnetworkConversionValueSchema().GetName()) |
| |
| params := url.Values{} |
| params.Add("$alt", "json;enum-encoding=int") |
| if req.GetUpdateMask() != nil { |
| updateMask, err := protojson.Marshal(req.GetUpdateMask()) |
| if err != nil { |
| return nil, err |
| } |
| params.Add("updateMask", string(updateMask[1:len(updateMask)-1])) |
| } |
| |
| baseUrl.RawQuery = params.Encode() |
| |
| // Build HTTP headers from client and context metadata. |
| hds := []string{"x-goog-request-params", fmt.Sprintf("%s=%v", "skadnetwork_conversion_value_schema.name", url.QueryEscape(req.GetSkadnetworkConversionValueSchema().GetName()))} |
| |
| hds = append(c.xGoogHeaders, hds...) |
| hds = append(hds, "Content-Type", "application/json") |
| headers := gax.BuildHeaders(ctx, hds...) |
| opts = append((*c.CallOptions).UpdateSKAdNetworkConversionValueSchema[0:len((*c.CallOptions).UpdateSKAdNetworkConversionValueSchema):len((*c.CallOptions).UpdateSKAdNetworkConversionValueSchema)], opts...) |
| unm := protojson.UnmarshalOptions{AllowPartial: true, DiscardUnknown: true} |
| resp := &adminpb.SKAdNetworkConversionValueSchema{} |
| 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 |
| |
| httpRsp, err := c.httpClient.Do(httpReq) |
| if err != nil { |
| return err |
| } |
| defer httpRsp.Body.Close() |
| |
| if err = googleapi.CheckResponse(httpRsp); err != nil { |
| return err |
| } |
| |
| buf, err := io.ReadAll(httpRsp.Body) |
| 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 |
| } |
| |
| // ListSKAdNetworkConversionValueSchemas lists SKAdNetworkConversionValueSchema on a stream. |
| // Properties can have at most one SKAdNetworkConversionValueSchema. |
| func (c *analyticsAdminRESTClient) ListSKAdNetworkConversionValueSchemas(ctx context.Context, req *adminpb.ListSKAdNetworkConversionValueSchemasRequest, opts ...gax.CallOption) *SKAdNetworkConversionValueSchemaIterator { |
| it := &SKAdNetworkConversionValueSchemaIterator{} |
| req = proto.Clone(req).(*adminpb.ListSKAdNetworkConversionValueSchemasRequest) |
| unm := protojson.UnmarshalOptions{AllowPartial: true, DiscardUnknown: true} |
| it.InternalFetch = func(pageSize int, pageToken string) ([]*adminpb.SKAdNetworkConversionValueSchema, string, error) { |
| resp := &adminpb.ListSKAdNetworkConversionValueSchemasResponse{} |
| 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("/v1alpha/%v/sKAdNetworkConversionValueSchema", 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 |
| |
| httpRsp, err := c.httpClient.Do(httpReq) |
| if err != nil { |
| return err |
| } |
| defer httpRsp.Body.Close() |
| |
| if err = googleapi.CheckResponse(httpRsp); err != nil { |
| return err |
| } |
| |
| buf, err := io.ReadAll(httpRsp.Body) |
| 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.GetSkadnetworkConversionValueSchemas(), 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 |
| } |
| |
| // SearchChangeHistoryEvents searches through all changes to an account or its children given the |
| // specified set of filters. |
| func (c *analyticsAdminRESTClient) SearchChangeHistoryEvents(ctx context.Context, req *adminpb.SearchChangeHistoryEventsRequest, opts ...gax.CallOption) *ChangeHistoryEventIterator { |
| it := &ChangeHistoryEventIterator{} |
| req = proto.Clone(req).(*adminpb.SearchChangeHistoryEventsRequest) |
| m := protojson.MarshalOptions{AllowPartial: true, UseEnumNumbers: true} |
| unm := protojson.UnmarshalOptions{AllowPartial: true, DiscardUnknown: true} |
| it.InternalFetch = func(pageSize int, pageToken string) ([]*adminpb.ChangeHistoryEvent, string, error) { |
| resp := &adminpb.SearchChangeHistoryEventsResponse{} |
| if pageToken != "" { |
| req.PageToken = pageToken |
| } |
| if pageSize > math.MaxInt32 { |
| req.PageSize = math.MaxInt32 |
| } else if pageSize != 0 { |
| req.PageSize = int32(pageSize) |
| } |
| 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("/v1alpha/%v:searchChangeHistoryEvents", req.GetAccount()) |
| |
| params := url.Values{} |
| params.Add("$alt", "json;enum-encoding=int") |
| |
| 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("POST", baseUrl.String(), bytes.NewReader(jsonReq)) |
| if err != nil { |
| return err |
| } |
| httpReq.Header = headers |
| |
| httpRsp, err := c.httpClient.Do(httpReq) |
| if err != nil { |
| return err |
| } |
| defer httpRsp.Body.Close() |
| |
| if err = googleapi.CheckResponse(httpRsp); err != nil { |
| return err |
| } |
| |
| buf, err := io.ReadAll(httpRsp.Body) |
| 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.GetChangeHistoryEvents(), 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 |
| } |
| |
| // GetGoogleSignalsSettings lookup for Google Signals settings for a property. |
| func (c *analyticsAdminRESTClient) GetGoogleSignalsSettings(ctx context.Context, req *adminpb.GetGoogleSignalsSettingsRequest, opts ...gax.CallOption) (*adminpb.GoogleSignalsSettings, error) { |
| baseUrl, err := url.Parse(c.endpoint) |
| if err != nil { |
| return nil, err |
| } |
| baseUrl.Path += fmt.Sprintf("/v1alpha/%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).GetGoogleSignalsSettings[0:len((*c.CallOptions).GetGoogleSignalsSettings):len((*c.CallOptions).GetGoogleSignalsSettings)], opts...) |
| unm := protojson.UnmarshalOptions{AllowPartial: true, DiscardUnknown: true} |
| resp := &adminpb.GoogleSignalsSettings{} |
| 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 |
| |
| httpRsp, err := c.httpClient.Do(httpReq) |
| if err != nil { |
| return err |
| } |
| defer httpRsp.Body.Close() |
| |
| if err = googleapi.CheckResponse(httpRsp); err != nil { |
| return err |
| } |
| |
| buf, err := io.ReadAll(httpRsp.Body) |
| 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 |
| } |
| |
| // UpdateGoogleSignalsSettings updates Google Signals settings for a property. |
| func (c *analyticsAdminRESTClient) UpdateGoogleSignalsSettings(ctx context.Context, req *adminpb.UpdateGoogleSignalsSettingsRequest, opts ...gax.CallOption) (*adminpb.GoogleSignalsSettings, error) { |
| m := protojson.MarshalOptions{AllowPartial: true, UseEnumNumbers: true} |
| body := req.GetGoogleSignalsSettings() |
| 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("/v1alpha/%v", req.GetGoogleSignalsSettings().GetName()) |
| |
| params := url.Values{} |
| params.Add("$alt", "json;enum-encoding=int") |
| if req.GetUpdateMask() != nil { |
| updateMask, err := protojson.Marshal(req.GetUpdateMask()) |
| if err != nil { |
| return nil, err |
| } |
| params.Add("updateMask", string(updateMask[1:len(updateMask)-1])) |
| } |
| |
| baseUrl.RawQuery = params.Encode() |
| |
| // Build HTTP headers from client and context metadata. |
| hds := []string{"x-goog-request-params", fmt.Sprintf("%s=%v", "google_signals_settings.name", url.QueryEscape(req.GetGoogleSignalsSettings().GetName()))} |
| |
| hds = append(c.xGoogHeaders, hds...) |
| hds = append(hds, "Content-Type", "application/json") |
| headers := gax.BuildHeaders(ctx, hds...) |
| opts = append((*c.CallOptions).UpdateGoogleSignalsSettings[0:len((*c.CallOptions).UpdateGoogleSignalsSettings):len((*c.CallOptions).UpdateGoogleSignalsSettings)], opts...) |
| unm := protojson.UnmarshalOptions{AllowPartial: true, DiscardUnknown: true} |
| resp := &adminpb.GoogleSignalsSettings{} |
| 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 |
| |
| httpRsp, err := c.httpClient.Do(httpReq) |
| if err != nil { |
| return err |
| } |
| defer httpRsp.Body.Close() |
| |
| if err = googleapi.CheckResponse(httpRsp); err != nil { |
| return err |
| } |
| |
| buf, err := io.ReadAll(httpRsp.Body) |
| 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 |
| } |
| |
| // CreateConversionEvent creates a conversion event with the specified attributes. |
| func (c *analyticsAdminRESTClient) CreateConversionEvent(ctx context.Context, req *adminpb.CreateConversionEventRequest, opts ...gax.CallOption) (*adminpb.ConversionEvent, error) { |
| m := protojson.MarshalOptions{AllowPartial: true, UseEnumNumbers: true} |
| body := req.GetConversionEvent() |
| 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("/v1alpha/%v/conversionEvents", 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).CreateConversionEvent[0:len((*c.CallOptions).CreateConversionEvent):len((*c.CallOptions).CreateConversionEvent)], opts...) |
| unm := protojson.UnmarshalOptions{AllowPartial: true, DiscardUnknown: true} |
| resp := &adminpb.ConversionEvent{} |
| 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 |
| |
| httpRsp, err := c.httpClient.Do(httpReq) |
| if err != nil { |
| return err |
| } |
| defer httpRsp.Body.Close() |
| |
| if err = googleapi.CheckResponse(httpRsp); err != nil { |
| return err |
| } |
| |
| buf, err := io.ReadAll(httpRsp.Body) |
| 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 |
| } |
| |
| // UpdateConversionEvent updates a conversion event with the specified attributes. |
| func (c *analyticsAdminRESTClient) UpdateConversionEvent(ctx context.Context, req *adminpb.UpdateConversionEventRequest, opts ...gax.CallOption) (*adminpb.ConversionEvent, error) { |
| m := protojson.MarshalOptions{AllowPartial: true, UseEnumNumbers: true} |
| body := req.GetConversionEvent() |
| 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("/v1alpha/%v", req.GetConversionEvent().GetName()) |
| |
| params := url.Values{} |
| params.Add("$alt", "json;enum-encoding=int") |
| if req.GetUpdateMask() != nil { |
| updateMask, err := protojson.Marshal(req.GetUpdateMask()) |
| if err != nil { |
| return nil, err |
| } |
| params.Add("updateMask", string(updateMask[1:len(updateMask)-1])) |
| } |
| |
| baseUrl.RawQuery = params.Encode() |
| |
| // Build HTTP headers from client and context metadata. |
| hds := []string{"x-goog-request-params", fmt.Sprintf("%s=%v", "conversion_event.name", url.QueryEscape(req.GetConversionEvent().GetName()))} |
| |
| hds = append(c.xGoogHeaders, hds...) |
| hds = append(hds, "Content-Type", "application/json") |
| headers := gax.BuildHeaders(ctx, hds...) |
| opts = append((*c.CallOptions).UpdateConversionEvent[0:len((*c.CallOptions).UpdateConversionEvent):len((*c.CallOptions).UpdateConversionEvent)], opts...) |
| unm := protojson.UnmarshalOptions{AllowPartial: true, DiscardUnknown: true} |
| resp := &adminpb.ConversionEvent{} |
| 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 |
| |
| httpRsp, err := c.httpClient.Do(httpReq) |
| if err != nil { |
| return err |
| } |
| defer httpRsp.Body.Close() |
| |
| if err = googleapi.CheckResponse(httpRsp); err != nil { |
| return err |
| } |
| |
| buf, err := io.ReadAll(httpRsp.Body) |
| 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 |
| } |
| |
| // GetConversionEvent retrieve a single conversion event. |
| func (c *analyticsAdminRESTClient) GetConversionEvent(ctx context.Context, req *adminpb.GetConversionEventRequest, opts ...gax.CallOption) (*adminpb.ConversionEvent, error) { |
| baseUrl, err := url.Parse(c.endpoint) |
| if err != nil { |
| return nil, err |
| } |
| baseUrl.Path += fmt.Sprintf("/v1alpha/%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).GetConversionEvent[0:len((*c.CallOptions).GetConversionEvent):len((*c.CallOptions).GetConversionEvent)], opts...) |
| unm := protojson.UnmarshalOptions{AllowPartial: true, DiscardUnknown: true} |
| resp := &adminpb.ConversionEvent{} |
| 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 |
| |
| httpRsp, err := c.httpClient.Do(httpReq) |
| if err != nil { |
| return err |
| } |
| defer httpRsp.Body.Close() |
| |
| if err = googleapi.CheckResponse(httpRsp); err != nil { |
| return err |
| } |
| |
| buf, err := io.ReadAll(httpRsp.Body) |
| 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 |
| } |
| |
| // DeleteConversionEvent deletes a conversion event in a property. |
| func (c *analyticsAdminRESTClient) DeleteConversionEvent(ctx context.Context, req *adminpb.DeleteConversionEventRequest, opts ...gax.CallOption) error { |
| baseUrl, err := url.Parse(c.endpoint) |
| if err != nil { |
| return err |
| } |
| baseUrl.Path += fmt.Sprintf("/v1alpha/%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 |
| |
| httpRsp, err := c.httpClient.Do(httpReq) |
| if err != nil { |
| return err |
| } |
| defer httpRsp.Body.Close() |
| |
| // Returns nil if there is no error, otherwise wraps |
| // the response code and body into a non-nil error |
| return googleapi.CheckResponse(httpRsp) |
| }, opts...) |
| } |
| |
| // ListConversionEvents returns a list of conversion events in the specified parent property. |
| // |
| // Returns an empty list if no conversion events are found. |
| func (c *analyticsAdminRESTClient) ListConversionEvents(ctx context.Context, req *adminpb.ListConversionEventsRequest, opts ...gax.CallOption) *ConversionEventIterator { |
| it := &ConversionEventIterator{} |
| req = proto.Clone(req).(*adminpb.ListConversionEventsRequest) |
| unm := protojson.UnmarshalOptions{AllowPartial: true, DiscardUnknown: true} |
| it.InternalFetch = func(pageSize int, pageToken string) ([]*adminpb.ConversionEvent, string, error) { |
| resp := &adminpb.ListConversionEventsResponse{} |
| 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("/v1alpha/%v/conversionEvents", 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 |
| |
| httpRsp, err := c.httpClient.Do(httpReq) |
| if err != nil { |
| return err |
| } |
| defer httpRsp.Body.Close() |
| |
| if err = googleapi.CheckResponse(httpRsp); err != nil { |
| return err |
| } |
| |
| buf, err := io.ReadAll(httpRsp.Body) |
| 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.GetConversionEvents(), 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 |
| } |
| |
| // GetDisplayVideo360AdvertiserLink look up a single DisplayVideo360AdvertiserLink |
| func (c *analyticsAdminRESTClient) GetDisplayVideo360AdvertiserLink(ctx context.Context, req *adminpb.GetDisplayVideo360AdvertiserLinkRequest, opts ...gax.CallOption) (*adminpb.DisplayVideo360AdvertiserLink, error) { |
| baseUrl, err := url.Parse(c.endpoint) |
| if err != nil { |
| return nil, err |
| } |
| baseUrl.Path += fmt.Sprintf("/v1alpha/%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).GetDisplayVideo360AdvertiserLink[0:len((*c.CallOptions).GetDisplayVideo360AdvertiserLink):len((*c.CallOptions).GetDisplayVideo360AdvertiserLink)], opts...) |
| unm := protojson.UnmarshalOptions{AllowPartial: true, DiscardUnknown: true} |
| resp := &adminpb.DisplayVideo360AdvertiserLink{} |
| 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 |
| |
| httpRsp, err := c.httpClient.Do(httpReq) |
| if err != nil { |
| return err |
| } |
| defer httpRsp.Body.Close() |
| |
| if err = googleapi.CheckResponse(httpRsp); err != nil { |
| return err |
| } |
| |
| buf, err := io.ReadAll(httpRsp.Body) |
| 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 |
| } |
| |
| // ListDisplayVideo360AdvertiserLinks lists all DisplayVideo360AdvertiserLinks on a property. |
| func (c *analyticsAdminRESTClient) ListDisplayVideo360AdvertiserLinks(ctx context.Context, req *adminpb.ListDisplayVideo360AdvertiserLinksRequest, opts ...gax.CallOption) *DisplayVideo360AdvertiserLinkIterator { |
| it := &DisplayVideo360AdvertiserLinkIterator{} |
| req = proto.Clone(req).(*adminpb.ListDisplayVideo360AdvertiserLinksRequest) |
| unm := protojson.UnmarshalOptions{AllowPartial: true, DiscardUnknown: true} |
| it.InternalFetch = func(pageSize int, pageToken string) ([]*adminpb.DisplayVideo360AdvertiserLink, string, error) { |
| resp := &adminpb.ListDisplayVideo360AdvertiserLinksResponse{} |
| 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("/v1alpha/%v/displayVideo360AdvertiserLinks", 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 |
| |
| httpRsp, err := c.httpClient.Do(httpReq) |
| if err != nil { |
| return err |
| } |
| defer httpRsp.Body.Close() |
| |
| if err = googleapi.CheckResponse(httpRsp); err != nil { |
| return err |
| } |
| |
| buf, err := io.ReadAll(httpRsp.Body) |
| 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.GetDisplayVideo_360AdvertiserLinks(), 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 |
| } |
| |
| // CreateDisplayVideo360AdvertiserLink creates a DisplayVideo360AdvertiserLink. |
| // This can only be utilized by users who have proper authorization both on |
| // the Google Analytics property and on the Display & Video 360 advertiser. |
| // Users who do not have access to the Display & Video 360 advertiser should |
| // instead seek to create a DisplayVideo360LinkProposal. |
| func (c *analyticsAdminRESTClient) CreateDisplayVideo360AdvertiserLink(ctx context.Context, req *adminpb.CreateDisplayVideo360AdvertiserLinkRequest, opts ...gax.CallOption) (*adminpb.DisplayVideo360AdvertiserLink, error) { |
| m := protojson.MarshalOptions{AllowPartial: true, UseEnumNumbers: true} |
| body := req.GetDisplayVideo_360AdvertiserLink() |
| 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("/v1alpha/%v/displayVideo360AdvertiserLinks", 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).CreateDisplayVideo360AdvertiserLink[0:len((*c.CallOptions).CreateDisplayVideo360AdvertiserLink):len((*c.CallOptions).CreateDisplayVideo360AdvertiserLink)], opts...) |
| unm := protojson.UnmarshalOptions{AllowPartial: true, DiscardUnknown: true} |
| resp := &adminpb.DisplayVideo360AdvertiserLink{} |
| 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 |
| |
| httpRsp, err := c.httpClient.Do(httpReq) |
| if err != nil { |
| return err |
| } |
| defer httpRsp.Body.Close() |
| |
| if err = googleapi.CheckResponse(httpRsp); err != nil { |
| return err |
| } |
| |
| buf, err := io.ReadAll(httpRsp.Body) |
| 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 |
| } |
| |
| // DeleteDisplayVideo360AdvertiserLink deletes a DisplayVideo360AdvertiserLink on a property. |
| func (c *analyticsAdminRESTClient) DeleteDisplayVideo360AdvertiserLink(ctx context.Context, req *adminpb.DeleteDisplayVideo360AdvertiserLinkRequest, opts ...gax.CallOption) error { |
| baseUrl, err := url.Parse(c.endpoint) |
| if err != nil { |
| return err |
| } |
| baseUrl.Path += fmt.Sprintf("/v1alpha/%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 |
| |
| httpRsp, err := c.httpClient.Do(httpReq) |
| if err != nil { |
| return err |
| } |
| defer httpRsp.Body.Close() |
| |
| // Returns nil if there is no error, otherwise wraps |
| // the response code and body into a non-nil error |
| return googleapi.CheckResponse(httpRsp) |
| }, opts...) |
| } |
| |
| // UpdateDisplayVideo360AdvertiserLink updates a DisplayVideo360AdvertiserLink on a property. |
| func (c *analyticsAdminRESTClient) UpdateDisplayVideo360AdvertiserLink(ctx context.Context, req *adminpb.UpdateDisplayVideo360AdvertiserLinkRequest, opts ...gax.CallOption) (*adminpb.DisplayVideo360AdvertiserLink, error) { |
| m := protojson.MarshalOptions{AllowPartial: true, UseEnumNumbers: true} |
| body := req.GetDisplayVideo_360AdvertiserLink() |
| 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("/v1alpha/%v", req.GetDisplayVideo_360AdvertiserLink().GetName()) |
| |
| params := url.Values{} |
| params.Add("$alt", "json;enum-encoding=int") |
| if req.GetUpdateMask() != nil { |
| updateMask, err := protojson.Marshal(req.GetUpdateMask()) |
| if err != nil { |
| return nil, err |
| } |
| params.Add("updateMask", string(updateMask[1:len(updateMask)-1])) |
| } |
| |
| baseUrl.RawQuery = params.Encode() |
| |
| // Build HTTP headers from client and context metadata. |
| hds := []string{"x-goog-request-params", fmt.Sprintf("%s=%v", "display_video_360_advertiser_link.name", url.QueryEscape(req.GetDisplayVideo_360AdvertiserLink().GetName()))} |
| |
| hds = append(c.xGoogHeaders, hds...) |
| hds = append(hds, "Content-Type", "application/json") |
| headers := gax.BuildHeaders(ctx, hds...) |
| opts = append((*c.CallOptions).UpdateDisplayVideo360AdvertiserLink[0:len((*c.CallOptions).UpdateDisplayVideo360AdvertiserLink):len((*c.CallOptions).UpdateDisplayVideo360AdvertiserLink)], opts...) |
| unm := protojson.UnmarshalOptions{AllowPartial: true, DiscardUnknown: true} |
| resp := &adminpb.DisplayVideo360AdvertiserLink{} |
| 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 |
| |
| httpRsp, err := c.httpClient.Do(httpReq) |
| if err != nil { |
| return err |
| } |
| defer httpRsp.Body.Close() |
| |
| if err = googleapi.CheckResponse(httpRsp); err != nil { |
| return err |
| } |
| |
| buf, err := io.ReadAll(httpRsp.Body) |
| 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 |
| } |
| |
| // GetDisplayVideo360AdvertiserLinkProposal lookup for a single DisplayVideo360AdvertiserLinkProposal. |
| func (c *analyticsAdminRESTClient) GetDisplayVideo360AdvertiserLinkProposal(ctx context.Context, req *adminpb.GetDisplayVideo360AdvertiserLinkProposalRequest, opts ...gax.CallOption) (*adminpb.DisplayVideo360AdvertiserLinkProposal, error) { |
| baseUrl, err := url.Parse(c.endpoint) |
| if err != nil { |
| return nil, err |
| } |
| baseUrl.Path += fmt.Sprintf("/v1alpha/%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).GetDisplayVideo360AdvertiserLinkProposal[0:len((*c.CallOptions).GetDisplayVideo360AdvertiserLinkProposal):len((*c.CallOptions).GetDisplayVideo360AdvertiserLinkProposal)], opts...) |
| unm := protojson.UnmarshalOptions{AllowPartial: true, DiscardUnknown: true} |
| resp := &adminpb.DisplayVideo360AdvertiserLinkProposal{} |
| 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 |
| |
| httpRsp, err := c.httpClient.Do(httpReq) |
| if err != nil { |
| return err |
| } |
| defer httpRsp.Body.Close() |
| |
| if err = googleapi.CheckResponse(httpRsp); err != nil { |
| return err |
| } |
| |
| buf, err := io.ReadAll(httpRsp.Body) |
| 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 |
| } |
| |
| // ListDisplayVideo360AdvertiserLinkProposals lists DisplayVideo360AdvertiserLinkProposals on a property. |
| func (c *analyticsAdminRESTClient) ListDisplayVideo360AdvertiserLinkProposals(ctx context.Context, req *adminpb.ListDisplayVideo360AdvertiserLinkProposalsRequest, opts ...gax.CallOption) *DisplayVideo360AdvertiserLinkProposalIterator { |
| it := &DisplayVideo360AdvertiserLinkProposalIterator{} |
| req = proto.Clone(req).(*adminpb.ListDisplayVideo360AdvertiserLinkProposalsRequest) |
| unm := protojson.UnmarshalOptions{AllowPartial: true, DiscardUnknown: true} |
| it.InternalFetch = func(pageSize int, pageToken string) ([]*adminpb.DisplayVideo360AdvertiserLinkProposal, string, error) { |
| resp := &adminpb.ListDisplayVideo360AdvertiserLinkProposalsResponse{} |
| 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("/v1alpha/%v/displayVideo360AdvertiserLinkProposals", 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 |
| |
| httpRsp, err := c.httpClient.Do(httpReq) |
| if err != nil { |
| return err |
| } |
| defer httpRsp.Body.Close() |
| |
| if err = googleapi.CheckResponse(httpRsp); err != nil { |
| return err |
| } |
| |
| buf, err := io.ReadAll(httpRsp.Body) |
| 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.GetDisplayVideo_360AdvertiserLinkProposals(), 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 |
| } |
| |
| // CreateDisplayVideo360AdvertiserLinkProposal creates a DisplayVideo360AdvertiserLinkProposal. |
| func (c *analyticsAdminRESTClient) CreateDisplayVideo360AdvertiserLinkProposal(ctx context.Context, req *adminpb.CreateDisplayVideo360AdvertiserLinkProposalRequest, opts ...gax.CallOption) (*adminpb.DisplayVideo360AdvertiserLinkProposal, error) { |
| m := protojson.MarshalOptions{AllowPartial: true, UseEnumNumbers: true} |
| body := req.GetDisplayVideo_360AdvertiserLinkProposal() |
| 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("/v1alpha/%v/displayVideo360AdvertiserLinkProposals", 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).CreateDisplayVideo360AdvertiserLinkProposal[0:len((*c.CallOptions).CreateDisplayVideo360AdvertiserLinkProposal):len((*c.CallOptions).CreateDisplayVideo360AdvertiserLinkProposal)], opts...) |
| unm := protojson.UnmarshalOptions{AllowPartial: true, DiscardUnknown: true} |
| resp := &adminpb.DisplayVideo360AdvertiserLinkProposal{} |
| 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 |
| |
| httpRsp, err := c.httpClient.Do(httpReq) |
| if err != nil { |
| return err |
| } |
| defer httpRsp.Body.Close() |
| |
| if err = googleapi.CheckResponse(httpRsp); err != nil { |
| return err |
| } |
| |
| buf, err := io.ReadAll(httpRsp.Body) |
| 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 |
| } |
| |
| // DeleteDisplayVideo360AdvertiserLinkProposal deletes a DisplayVideo360AdvertiserLinkProposal on a property. |
| // This can only be used on cancelled proposals. |
| func (c *analyticsAdminRESTClient) DeleteDisplayVideo360AdvertiserLinkProposal(ctx context.Context, req *adminpb.DeleteDisplayVideo360AdvertiserLinkProposalRequest, opts ...gax.CallOption) error { |
| baseUrl, err := url.Parse(c.endpoint) |
| if err != nil { |
| return err |
| } |
| baseUrl.Path += fmt.Sprintf("/v1alpha/%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 |
| |
| httpRsp, err := c.httpClient.Do(httpReq) |
| if err != nil { |
| return err |
| } |
| defer httpRsp.Body.Close() |
| |
| // Returns nil if there is no error, otherwise wraps |
| // the response code and body into a non-nil error |
| return googleapi.CheckResponse(httpRsp) |
| }, opts...) |
| } |
| |
| // ApproveDisplayVideo360AdvertiserLinkProposal approves a DisplayVideo360AdvertiserLinkProposal. |
| // The DisplayVideo360AdvertiserLinkProposal will be deleted and a new |
| // DisplayVideo360AdvertiserLink will be created. |
| func (c *analyticsAdminRESTClient) ApproveDisplayVideo360AdvertiserLinkProposal(ctx context.Context, req *adminpb.ApproveDisplayVideo360AdvertiserLinkProposalRequest, opts ...gax.CallOption) (*adminpb.ApproveDisplayVideo360AdvertiserLinkProposalResponse, 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("/v1alpha/%v:approve", 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).ApproveDisplayVideo360AdvertiserLinkProposal[0:len((*c.CallOptions).ApproveDisplayVideo360AdvertiserLinkProposal):len((*c.CallOptions).ApproveDisplayVideo360AdvertiserLinkProposal)], opts...) |
| unm := protojson.UnmarshalOptions{AllowPartial: true, DiscardUnknown: true} |
| resp := &adminpb.ApproveDisplayVideo360AdvertiserLinkProposalResponse{} |
| 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 |
| |
| httpRsp, err := c.httpClient.Do(httpReq) |
| if err != nil { |
| return err |
| } |
| defer httpRsp.Body.Close() |
| |
| if err = googleapi.CheckResponse(httpRsp); err != nil { |
| return err |
| } |
| |
| buf, err := io.ReadAll(httpRsp.Body) |
| 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 |
| } |
| |
| // CancelDisplayVideo360AdvertiserLinkProposal cancels a DisplayVideo360AdvertiserLinkProposal. |
| // Cancelling can mean either: |
| // |
| // Declining a proposal initiated from Display & Video 360 |
| // |
| // Withdrawing a proposal initiated from Google Analytics |
| // After being cancelled, a proposal will eventually be deleted automatically. |
| func (c *analyticsAdminRESTClient) CancelDisplayVideo360AdvertiserLinkProposal(ctx context.Context, req *adminpb.CancelDisplayVideo360AdvertiserLinkProposalRequest, opts ...gax.CallOption) (*adminpb.DisplayVideo360AdvertiserLinkProposal, 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("/v1alpha/%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...) |
| opts = append((*c.CallOptions).CancelDisplayVideo360AdvertiserLinkProposal[0:len((*c.CallOptions).CancelDisplayVideo360AdvertiserLinkProposal):len((*c.CallOptions).CancelDisplayVideo360AdvertiserLinkProposal)], opts...) |
| unm := protojson.UnmarshalOptions{AllowPartial: true, DiscardUnknown: true} |
| resp := &adminpb.DisplayVideo360AdvertiserLinkProposal{} |
| 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 |
| |
| httpRsp, err := c.httpClient.Do(httpReq) |
| if err != nil { |
| return err |
| } |
| defer httpRsp.Body.Close() |
| |
| if err = googleapi.CheckResponse(httpRsp); err != nil { |
| return err |
| } |
| |
| buf, err := io.ReadAll(httpRsp.Body) |
| 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 |
| } |
| |
| // CreateCustomDimension creates a CustomDimension. |
| func (c *analyticsAdminRESTClient) CreateCustomDimension(ctx context.Context, req *adminpb.CreateCustomDimensionRequest, opts ...gax.CallOption) (*adminpb.CustomDimension, error) { |
| m := protojson.MarshalOptions{AllowPartial: true, UseEnumNumbers: true} |
| body := req.GetCustomDimension() |
| 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("/v1alpha/%v/customDimensions", 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).CreateCustomDimension[0:len((*c.CallOptions).CreateCustomDimension):len((*c.CallOptions).CreateCustomDimension)], opts...) |
| unm := protojson.UnmarshalOptions{AllowPartial: true, DiscardUnknown: true} |
| resp := &adminpb.CustomDimension{} |
| 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 |
| |
| httpRsp, err := c.httpClient.Do(httpReq) |
| if err != nil { |
| return err |
| } |
| defer httpRsp.Body.Close() |
| |
| if err = googleapi.CheckResponse(httpRsp); err != nil { |
| return err |
| } |
| |
| buf, err := io.ReadAll(httpRsp.Body) |
| 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 |
| } |
| |
| // UpdateCustomDimension updates a CustomDimension on a property. |
| func (c *analyticsAdminRESTClient) UpdateCustomDimension(ctx context.Context, req *adminpb.UpdateCustomDimensionRequest, opts ...gax.CallOption) (*adminpb.CustomDimension, error) { |
| m := protojson.MarshalOptions{AllowPartial: true, UseEnumNumbers: true} |
| body := req.GetCustomDimension() |
| 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("/v1alpha/%v", req.GetCustomDimension().GetName()) |
| |
| params := url.Values{} |
| params.Add("$alt", "json;enum-encoding=int") |
| if req.GetUpdateMask() != nil { |
| updateMask, err := protojson.Marshal(req.GetUpdateMask()) |
| if err != nil { |
| return nil, err |
| } |
| params.Add("updateMask", string(updateMask[1:len(updateMask)-1])) |
| } |
| |
| baseUrl.RawQuery = params.Encode() |
| |
| // Build HTTP headers from client and context metadata. |
| hds := []string{"x-goog-request-params", fmt.Sprintf("%s=%v", "custom_dimension.name", url.QueryEscape(req.GetCustomDimension().GetName()))} |
| |
| hds = append(c.xGoogHeaders, hds...) |
| hds = append(hds, "Content-Type", "application/json") |
| headers := gax.BuildHeaders(ctx, hds...) |
| opts = append((*c.CallOptions).UpdateCustomDimension[0:len((*c.CallOptions).UpdateCustomDimension):len((*c.CallOptions).UpdateCustomDimension)], opts...) |
| unm := protojson.UnmarshalOptions{AllowPartial: true, DiscardUnknown: true} |
| resp := &adminpb.CustomDimension{} |
| 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 |
| |
| httpRsp, err := c.httpClient.Do(httpReq) |
| if err != nil { |
| return err |
| } |
| defer httpRsp.Body.Close() |
| |
| if err = googleapi.CheckResponse(httpRsp); err != nil { |
| return err |
| } |
| |
| buf, err := io.ReadAll(httpRsp.Body) |
| 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 |
| } |
| |
| // ListCustomDimensions lists CustomDimensions on a property. |
| func (c *analyticsAdminRESTClient) ListCustomDimensions(ctx context.Context, req *adminpb.ListCustomDimensionsRequest, opts ...gax.CallOption) *CustomDimensionIterator { |
| it := &CustomDimensionIterator{} |
| req = proto.Clone(req).(*adminpb.ListCustomDimensionsRequest) |
| unm := protojson.UnmarshalOptions{AllowPartial: true, DiscardUnknown: true} |
| it.InternalFetch = func(pageSize int, pageToken string) ([]*adminpb.CustomDimension, string, error) { |
| resp := &adminpb.ListCustomDimensionsResponse{} |
| 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("/v1alpha/%v/customDimensions", 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 |
| |
| httpRsp, err := c.httpClient.Do(httpReq) |
| if err != nil { |
| return err |
| } |
| defer httpRsp.Body.Close() |
| |
| if err = googleapi.CheckResponse(httpRsp); err != nil { |
| return err |
| } |
| |
| buf, err := io.ReadAll(httpRsp.Body) |
| 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.GetCustomDimensions(), 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 |
| } |
| |
| // ArchiveCustomDimension archives a CustomDimension on a property. |
| func (c *analyticsAdminRESTClient) ArchiveCustomDimension(ctx context.Context, req *adminpb.ArchiveCustomDimensionRequest, opts ...gax.CallOption) error { |
| m := protojson.MarshalOptions{AllowPartial: true, UseEnumNumbers: true} |
| jsonReq, err := m.Marshal(req) |
| if err != nil { |
| return err |
| } |
| |
| baseUrl, err := url.Parse(c.endpoint) |
| if err != nil { |
| return err |
| } |
| baseUrl.Path += fmt.Sprintf("/v1alpha/%v:archive", 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(), bytes.NewReader(jsonReq)) |
| if err != nil { |
| return err |
| } |
| httpReq = httpReq.WithContext(ctx) |
| httpReq.Header = headers |
| |
| httpRsp, err := c.httpClient.Do(httpReq) |
| if err != nil { |
| return err |
| } |
| defer httpRsp.Body.Close() |
| |
| // Returns nil if there is no error, otherwise wraps |
| // the response code and body into a non-nil error |
| return googleapi.CheckResponse(httpRsp) |
| }, opts...) |
| } |
| |
| // GetCustomDimension lookup for a single CustomDimension. |
| func (c *analyticsAdminRESTClient) GetCustomDimension(ctx context.Context, req *adminpb.GetCustomDimensionRequest, opts ...gax.CallOption) (*adminpb.CustomDimension, error) { |
| baseUrl, err := url.Parse(c.endpoint) |
| if err != nil { |
| return nil, err |
| } |
| baseUrl.Path += fmt.Sprintf("/v1alpha/%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).GetCustomDimension[0:len((*c.CallOptions).GetCustomDimension):len((*c.CallOptions).GetCustomDimension)], opts...) |
| unm := protojson.UnmarshalOptions{AllowPartial: true, DiscardUnknown: true} |
| resp := &adminpb.CustomDimension{} |
| 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 |
| |
| httpRsp, err := c.httpClient.Do(httpReq) |
| if err != nil { |
| return err |
| } |
| defer httpRsp.Body.Close() |
| |
| if err = googleapi.CheckResponse(httpRsp); err != nil { |
| return err |
| } |
| |
| buf, err := io.ReadAll(httpRsp.Body) |
| 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 |
| } |
| |
| // CreateCustomMetric creates a CustomMetric. |
| func (c *analyticsAdminRESTClient) CreateCustomMetric(ctx context.Context, req *adminpb.CreateCustomMetricRequest, opts ...gax.CallOption) (*adminpb.CustomMetric, error) { |
| m := protojson.MarshalOptions{AllowPartial: true, UseEnumNumbers: true} |
| body := req.GetCustomMetric() |
| 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("/v1alpha/%v/customMetrics", 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).CreateCustomMetric[0:len((*c.CallOptions).CreateCustomMetric):len((*c.CallOptions).CreateCustomMetric)], opts...) |
| unm := protojson.UnmarshalOptions{AllowPartial: true, DiscardUnknown: true} |
| resp := &adminpb.CustomMetric{} |
| 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 |
| |
| httpRsp, err := c.httpClient.Do(httpReq) |
| if err != nil { |
| return err |
| } |
| defer httpRsp.Body.Close() |
| |
| if err = googleapi.CheckResponse(httpRsp); err != nil { |
| return err |
| } |
| |
| buf, err := io.ReadAll(httpRsp.Body) |
| 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 |
| } |
| |
| // UpdateCustomMetric updates a CustomMetric on a property. |
| func (c *analyticsAdminRESTClient) UpdateCustomMetric(ctx context.Context, req *adminpb.UpdateCustomMetricRequest, opts ...gax.CallOption) (*adminpb.CustomMetric, error) { |
| m := protojson.MarshalOptions{AllowPartial: true, UseEnumNumbers: true} |
| body := req.GetCustomMetric() |
| 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("/v1alpha/%v", req.GetCustomMetric().GetName()) |
| |
| params := url.Values{} |
| params.Add("$alt", "json;enum-encoding=int") |
| if req.GetUpdateMask() != nil { |
| updateMask, err := protojson.Marshal(req.GetUpdateMask()) |
| if err != nil { |
| return nil, err |
| } |
| params.Add("updateMask", string(updateMask[1:len(updateMask)-1])) |
| } |
| |
| baseUrl.RawQuery = params.Encode() |
| |
| // Build HTTP headers from client and context metadata. |
| hds := []string{"x-goog-request-params", fmt.Sprintf("%s=%v", "custom_metric.name", url.QueryEscape(req.GetCustomMetric().GetName()))} |
| |
| hds = append(c.xGoogHeaders, hds...) |
| hds = append(hds, "Content-Type", "application/json") |
| headers := gax.BuildHeaders(ctx, hds...) |
| opts = append((*c.CallOptions).UpdateCustomMetric[0:len((*c.CallOptions).UpdateCustomMetric):len((*c.CallOptions).UpdateCustomMetric)], opts...) |
| unm := protojson.UnmarshalOptions{AllowPartial: true, DiscardUnknown: true} |
| resp := &adminpb.CustomMetric{} |
| 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 |
| |
| httpRsp, err := c.httpClient.Do(httpReq) |
| if err != nil { |
| return err |
| } |
| defer httpRsp.Body.Close() |
| |
| if err = googleapi.CheckResponse(httpRsp); err != nil { |
| return err |
| } |
| |
| buf, err := io.ReadAll(httpRsp.Body) |
| 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 |
| } |
| |
| // ListCustomMetrics lists CustomMetrics on a property. |
| func (c *analyticsAdminRESTClient) ListCustomMetrics(ctx context.Context, req *adminpb.ListCustomMetricsRequest, opts ...gax.CallOption) *CustomMetricIterator { |
| it := &CustomMetricIterator{} |
| req = proto.Clone(req).(*adminpb.ListCustomMetricsRequest) |
| unm := protojson.UnmarshalOptions{AllowPartial: true, DiscardUnknown: true} |
| it.InternalFetch = func(pageSize int, pageToken string) ([]*adminpb.CustomMetric, string, error) { |
| resp := &adminpb.ListCustomMetricsResponse{} |
| 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("/v1alpha/%v/customMetrics", 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 |
| |
| httpRsp, err := c.httpClient.Do(httpReq) |
| if err != nil { |
| return err |
| } |
| defer httpRsp.Body.Close() |
| |
| if err = googleapi.CheckResponse(httpRsp); err != nil { |
| return err |
| } |
| |
| buf, err := io.ReadAll(httpRsp.Body) |
| 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.GetCustomMetrics(), 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 |
| } |
| |
| // ArchiveCustomMetric archives a CustomMetric on a property. |
| func (c *analyticsAdminRESTClient) ArchiveCustomMetric(ctx context.Context, req *adminpb.ArchiveCustomMetricRequest, opts ...gax.CallOption) error { |
| m := protojson.MarshalOptions{AllowPartial: true, UseEnumNumbers: true} |
| jsonReq, err := m.Marshal(req) |
| if err != nil { |
| return err |
| } |
| |
| baseUrl, err := url.Parse(c.endpoint) |
| if err != nil { |
| return err |
| } |
| baseUrl.Path += fmt.Sprintf("/v1alpha/%v:archive", 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(), bytes.NewReader(jsonReq)) |
| if err != nil { |
| return err |
| } |
| httpReq = httpReq.WithContext(ctx) |
| httpReq.Header = headers |
| |
| httpRsp, err := c.httpClient.Do(httpReq) |
| if err != nil { |
| return err |
| } |
| defer httpRsp.Body.Close() |
| |
| // Returns nil if there is no error, otherwise wraps |
| // the response code and body into a non-nil error |
| return googleapi.CheckResponse(httpRsp) |
| }, opts...) |
| } |
| |
| // GetCustomMetric lookup for a single CustomMetric. |
| func (c *analyticsAdminRESTClient) GetCustomMetric(ctx context.Context, req *adminpb.GetCustomMetricRequest, opts ...gax.CallOption) (*adminpb.CustomMetric, error) { |
| baseUrl, err := url.Parse(c.endpoint) |
| if err != nil { |
| return nil, err |
| } |
| baseUrl.Path += fmt.Sprintf("/v1alpha/%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).GetCustomMetric[0:len((*c.CallOptions).GetCustomMetric):len((*c.CallOptions).GetCustomMetric)], opts...) |
| unm := protojson.UnmarshalOptions{AllowPartial: true, DiscardUnknown: true} |
| resp := &adminpb.CustomMetric{} |
| 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 |
| |
| httpRsp, err := c.httpClient.Do(httpReq) |
| if err != nil { |
| return err |
| } |
| defer httpRsp.Body.Close() |
| |
| if err = googleapi.CheckResponse(httpRsp); err != nil { |
| return err |
| } |
| |
| buf, err := io.ReadAll(httpRsp.Body) |
| 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 |
| } |
| |
| // GetDataRetentionSettings returns the singleton data retention settings for this property. |
| func (c *analyticsAdminRESTClient) GetDataRetentionSettings(ctx context.Context, req *adminpb.GetDataRetentionSettingsRequest, opts ...gax.CallOption) (*adminpb.DataRetentionSettings, error) { |
| baseUrl, err := url.Parse(c.endpoint) |
| if err != nil { |
| return nil, err |
| } |
| baseUrl.Path += fmt.Sprintf("/v1alpha/%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).GetDataRetentionSettings[0:len((*c.CallOptions).GetDataRetentionSettings):len((*c.CallOptions).GetDataRetentionSettings)], opts...) |
| unm := protojson.UnmarshalOptions{AllowPartial: true, DiscardUnknown: true} |
| resp := &adminpb.DataRetentionSettings{} |
| 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 |
| |
| httpRsp, err := c.httpClient.Do(httpReq) |
| if err != nil { |
| return err |
| } |
| defer httpRsp.Body.Close() |
| |
| if err = googleapi.CheckResponse(httpRsp); err != nil { |
| return err |
| } |
| |
| buf, err := io.ReadAll(httpRsp.Body) |
| 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 |
| } |
| |
| // UpdateDataRetentionSettings updates the singleton data retention settings for this property. |
| func (c *analyticsAdminRESTClient) UpdateDataRetentionSettings(ctx context.Context, req *adminpb.UpdateDataRetentionSettingsRequest, opts ...gax.CallOption) (*adminpb.DataRetentionSettings, error) { |
| m := protojson.MarshalOptions{AllowPartial: true, UseEnumNumbers: true} |
| body := req.GetDataRetentionSettings() |
| 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("/v1alpha/%v", req.GetDataRetentionSettings().GetName()) |
| |
| params := url.Values{} |
| params.Add("$alt", "json;enum-encoding=int") |
| if req.GetUpdateMask() != nil { |
| updateMask, err := protojson.Marshal(req.GetUpdateMask()) |
| if err != nil { |
| return nil, err |
| } |
| params.Add("updateMask", string(updateMask[1:len(updateMask)-1])) |
| } |
| |
| baseUrl.RawQuery = params.Encode() |
| |
| // Build HTTP headers from client and context metadata. |
| hds := []string{"x-goog-request-params", fmt.Sprintf("%s=%v", "data_retention_settings.name", url.QueryEscape(req.GetDataRetentionSettings().GetName()))} |
| |
| hds = append(c.xGoogHeaders, hds...) |
| hds = append(hds, "Content-Type", "application/json") |
| headers := gax.BuildHeaders(ctx, hds...) |
| opts = append((*c.CallOptions).UpdateDataRetentionSettings[0:len((*c.CallOptions).UpdateDataRetentionSettings):len((*c.CallOptions).UpdateDataRetentionSettings)], opts...) |
| unm := protojson.UnmarshalOptions{AllowPartial: true, DiscardUnknown: true} |
| resp := &adminpb.DataRetentionSettings{} |
| 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 |
| |
| httpRsp, err := c.httpClient.Do(httpReq) |
| if err != nil { |
| return err |
| } |
| defer httpRsp.Body.Close() |
| |
| if err = googleapi.CheckResponse(httpRsp); err != nil { |
| return err |
| } |
| |
| buf, err := io.ReadAll(httpRsp.Body) |
| 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 |
| } |
| |
| // CreateDataStream creates a DataStream. |
| func (c *analyticsAdminRESTClient) CreateDataStream(ctx context.Context, req *adminpb.CreateDataStreamRequest, opts ...gax.CallOption) (*adminpb.DataStream, error) { |
| m := protojson.MarshalOptions{AllowPartial: true, UseEnumNumbers: true} |
| body := req.GetDataStream() |
| 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("/v1alpha/%v/dataStreams", 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).CreateDataStream[0:len((*c.CallOptions).CreateDataStream):len((*c.CallOptions).CreateDataStream)], opts...) |
| unm := protojson.UnmarshalOptions{AllowPartial: true, DiscardUnknown: true} |
| resp := &adminpb.DataStream{} |
| 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 |
| |
| httpRsp, err := c.httpClient.Do(httpReq) |
| if err != nil { |
| return err |
| } |
| defer httpRsp.Body.Close() |
| |
| if err = googleapi.CheckResponse(httpRsp); err != nil { |
| return err |
| } |
| |
| buf, err := io.ReadAll(httpRsp.Body) |
| 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 |
| } |
| |
| // DeleteDataStream deletes a DataStream on a property. |
| func (c *analyticsAdminRESTClient) DeleteDataStream(ctx context.Context, req *adminpb.DeleteDataStreamRequest, opts ...gax.CallOption) error { |
| baseUrl, err := url.Parse(c.endpoint) |
| if err != nil { |
| return err |
| } |
| baseUrl.Path += fmt.Sprintf("/v1alpha/%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 |
| |
| httpRsp, err := c.httpClient.Do(httpReq) |
| if err != nil { |
| return err |
| } |
| defer httpRsp.Body.Close() |
| |
| // Returns nil if there is no error, otherwise wraps |
| // the response code and body into a non-nil error |
| return googleapi.CheckResponse(httpRsp) |
| }, opts...) |
| } |
| |
| // UpdateDataStream updates a DataStream on a property. |
| func (c *analyticsAdminRESTClient) UpdateDataStream(ctx context.Context, req *adminpb.UpdateDataStreamRequest, opts ...gax.CallOption) (*adminpb.DataStream, error) { |
| m := protojson.MarshalOptions{AllowPartial: true, UseEnumNumbers: true} |
| body := req.GetDataStream() |
| 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("/v1alpha/%v", req.GetDataStream().GetName()) |
| |
| params := url.Values{} |
| params.Add("$alt", "json;enum-encoding=int") |
| if req.GetUpdateMask() != nil { |
| updateMask, err := protojson.Marshal(req.GetUpdateMask()) |
| if err != nil { |
| return nil, err |
| } |
| params.Add("updateMask", string(updateMask[1:len(updateMask)-1])) |
| } |
| |
| baseUrl.RawQuery = params.Encode() |
| |
| // Build HTTP headers from client and context metadata. |
| hds := []string{"x-goog-request-params", fmt.Sprintf("%s=%v", "data_stream.name", url.QueryEscape(req.GetDataStream().GetName()))} |
| |
| hds = append(c.xGoogHeaders, hds...) |
| hds = append(hds, "Content-Type", "application/json") |
| headers := gax.BuildHeaders(ctx, hds...) |
| opts = append((*c.CallOptions).UpdateDataStream[0:len((*c.CallOptions).UpdateDataStream):len((*c.CallOptions).UpdateDataStream)], opts...) |
| unm := protojson.UnmarshalOptions{AllowPartial: true, DiscardUnknown: true} |
| resp := &adminpb.DataStream{} |
| 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 |
| |
| httpRsp, err := c.httpClient.Do(httpReq) |
| if err != nil { |
| return err |
| } |
| defer httpRsp.Body.Close() |
| |
| if err = googleapi.CheckResponse(httpRsp); err != nil { |
| return err |
| } |
| |
| buf, err := io.ReadAll(httpRsp.Body) |
| 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 |
| } |
| |
| // ListDataStreams lists DataStreams on a property. |
| func (c *analyticsAdminRESTClient) ListDataStreams(ctx context.Context, req *adminpb.ListDataStreamsRequest, opts ...gax.CallOption) *DataStreamIterator { |
| it := &DataStreamIterator{} |
| req = proto.Clone(req).(*adminpb.ListDataStreamsRequest) |
| unm := protojson.UnmarshalOptions{AllowPartial: true, DiscardUnknown: true} |
| it.InternalFetch = func(pageSize int, pageToken string) ([]*adminpb.DataStream, string, error) { |
| resp := &adminpb.ListDataStreamsResponse{} |
| 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("/v1alpha/%v/dataStreams", 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 |
| |
| httpRsp, err := c.httpClient.Do(httpReq) |
| if err != nil { |
| return err |
| } |
| defer httpRsp.Body.Close() |
| |
| if err = googleapi.CheckResponse(httpRsp); err != nil { |
| return err |
| } |
| |
| buf, err := io.ReadAll(httpRsp.Body) |
| 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.GetDataStreams(), 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 |
| } |
| |
| // GetDataStream lookup for a single DataStream. |
| func (c *analyticsAdminRESTClient) GetDataStream(ctx context.Context, req *adminpb.GetDataStreamRequest, opts ...gax.CallOption) (*adminpb.DataStream, error) { |
| baseUrl, err := url.Parse(c.endpoint) |
| if err != nil { |
| return nil, err |
| } |
| baseUrl.Path += fmt.Sprintf("/v1alpha/%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).GetDataStream[0:len((*c.CallOptions).GetDataStream):len((*c.CallOptions).GetDataStream)], opts...) |
| unm := protojson.UnmarshalOptions{AllowPartial: true, DiscardUnknown: true} |
| resp := &adminpb.DataStream{} |
| 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 |
| |
| httpRsp, err := c.httpClient.Do(httpReq) |
| if err != nil { |
| return err |
| } |
| defer httpRsp.Body.Close() |
| |
| if err = googleapi.CheckResponse(httpRsp); err != nil { |
| return err |
| } |
| |
| buf, err := io.ReadAll(httpRsp.Body) |
| 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 |
| } |
| |
| // GetAudience lookup for a single Audience. |
| // Audiences created before 2020 may not be supported. |
| // Default audiences will not show filter definitions. |
| func (c *analyticsAdminRESTClient) GetAudience(ctx context.Context, req *adminpb.GetAudienceRequest, opts ...gax.CallOption) (*adminpb.Audience, error) { |
| baseUrl, err := url.Parse(c.endpoint) |
| if err != nil { |
| return nil, err |
| } |
| baseUrl.Path += fmt.Sprintf("/v1alpha/%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).GetAudience[0:len((*c.CallOptions).GetAudience):len((*c.CallOptions).GetAudience)], opts...) |
| unm := protojson.UnmarshalOptions{AllowPartial: true, DiscardUnknown: true} |
| resp := &adminpb.Audience{} |
| 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 |
| |
| httpRsp, err := c.httpClient.Do(httpReq) |
| if err != nil { |
| return err |
| } |
| defer httpRsp.Body.Close() |
| |
| if err = googleapi.CheckResponse(httpRsp); err != nil { |
| return err |
| } |
| |
| buf, err := io.ReadAll(httpRsp.Body) |
| 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 |
| } |
| |
| // ListAudiences lists Audiences on a property. |
| // Audiences created before 2020 may not be supported. |
| // Default audiences will not show filter definitions. |
| func (c *analyticsAdminRESTClient) ListAudiences(ctx context.Context, req *adminpb.ListAudiencesRequest, opts ...gax.CallOption) *AudienceIterator { |
| it := &AudienceIterator{} |
| req = proto.Clone(req).(*adminpb.ListAudiencesRequest) |
| unm := protojson.UnmarshalOptions{AllowPartial: true, DiscardUnknown: true} |
| it.InternalFetch = func(pageSize int, pageToken string) ([]*adminpb.Audience, string, error) { |
| resp := &adminpb.ListAudiencesResponse{} |
| 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("/v1alpha/%v/audiences", 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 |
| |
| httpRsp, err := c.httpClient.Do(httpReq) |
| if err != nil { |
| return err |
| } |
| defer httpRsp.Body.Close() |
| |
| if err = googleapi.CheckResponse(httpRsp); err != nil { |
| return err |
| } |
| |
| buf, err := io.ReadAll(httpRsp.Body) |
| 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.GetAudiences(), 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 |
| } |
| |
| // CreateAudience creates an Audience. |
| func (c *analyticsAdminRESTClient) CreateAudience(ctx context.Context, req *adminpb.CreateAudienceRequest, opts ...gax.CallOption) (*adminpb.Audience, error) { |
| m := protojson.MarshalOptions{AllowPartial: true, UseEnumNumbers: true} |
| body := req.GetAudience() |
| 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("/v1alpha/%v/audiences", 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).CreateAudience[0:len((*c.CallOptions).CreateAudience):len((*c.CallOptions).CreateAudience)], opts...) |
| unm := protojson.UnmarshalOptions{AllowPartial: true, DiscardUnknown: true} |
| resp := &adminpb.Audience{} |
| 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 |
| |
| httpRsp, err := c.httpClient.Do(httpReq) |
| if err != nil { |
| return err |
| } |
| defer httpRsp.Body.Close() |
| |
| if err = googleapi.CheckResponse(httpRsp); err != nil { |
| return err |
| } |
| |
| buf, err := io.ReadAll(httpRsp.Body) |
| 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 |
| } |
| |
| // UpdateAudience updates an Audience on a property. |
| func (c *analyticsAdminRESTClient) UpdateAudience(ctx context.Context, req *adminpb.UpdateAudienceRequest, opts ...gax.CallOption) (*adminpb.Audience, error) { |
| m := protojson.MarshalOptions{AllowPartial: true, UseEnumNumbers: true} |
| body := req.GetAudience() |
| 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("/v1alpha/%v", req.GetAudience().GetName()) |
| |
| params := url.Values{} |
| params.Add("$alt", "json;enum-encoding=int") |
| if req.GetUpdateMask() != nil { |
| updateMask, err := protojson.Marshal(req.GetUpdateMask()) |
| if err != nil { |
| return nil, err |
| } |
| params.Add("updateMask", string(updateMask[1:len(updateMask)-1])) |
| } |
| |
| baseUrl.RawQuery = params.Encode() |
| |
| // Build HTTP headers from client and context metadata. |
| hds := []string{"x-goog-request-params", fmt.Sprintf("%s=%v", "audience.name", url.QueryEscape(req.GetAudience().GetName()))} |
| |
| hds = append(c.xGoogHeaders, hds...) |
| hds = append(hds, "Content-Type", "application/json") |
| headers := gax.BuildHeaders(ctx, hds...) |
| opts = append((*c.CallOptions).UpdateAudience[0:len((*c.CallOptions).UpdateAudience):len((*c.CallOptions).UpdateAudience)], opts...) |
| unm := protojson.UnmarshalOptions{AllowPartial: true, DiscardUnknown: true} |
| resp := &adminpb.Audience{} |
| 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 |
| |
| httpRsp, err := c.httpClient.Do(httpReq) |
| if err != nil { |
| return err |
| } |
| defer httpRsp.Body.Close() |
| |
| if err = googleapi.CheckResponse(httpRsp); err != nil { |
| return err |
| } |
| |
| buf, err := io.ReadAll(httpRsp.Body) |
| 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 |
| } |
| |
| // ArchiveAudience archives an Audience on a property. |
| func (c *analyticsAdminRESTClient) ArchiveAudience(ctx context.Context, req *adminpb.ArchiveAudienceRequest, opts ...gax.CallOption) error { |
| m := protojson.MarshalOptions{AllowPartial: true, UseEnumNumbers: true} |
| jsonReq, err := m.Marshal(req) |
| if err != nil { |
| return err |
| } |
| |
| baseUrl, err := url.Parse(c.endpoint) |
| if err != nil { |
| return err |
| } |
| baseUrl.Path += fmt.Sprintf("/v1alpha/%v:archive", 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(), bytes.NewReader(jsonReq)) |
| if err != nil { |
| return err |
| } |
| httpReq = httpReq.WithContext(ctx) |
| httpReq.Header = headers |
| |
| httpRsp, err := c.httpClient.Do(httpReq) |
| if err != nil { |
| return err |
| } |
| defer httpRsp.Body.Close() |
| |
| // Returns nil if there is no error, otherwise wraps |
| // the response code and body into a non-nil error |
| return googleapi.CheckResponse(httpRsp) |
| }, opts...) |
| } |
| |
| // GetSearchAds360Link look up a single SearchAds360Link |
| func (c *analyticsAdminRESTClient) GetSearchAds360Link(ctx context.Context, req *adminpb.GetSearchAds360LinkRequest, opts ...gax.CallOption) (*adminpb.SearchAds360Link, error) { |
| baseUrl, err := url.Parse(c.endpoint) |
| if err != nil { |
| return nil, err |
| } |
| baseUrl.Path += fmt.Sprintf("/v1alpha/%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).GetSearchAds360Link[0:len((*c.CallOptions).GetSearchAds360Link):len((*c.CallOptions).GetSearchAds360Link)], opts...) |
| unm := protojson.UnmarshalOptions{AllowPartial: true, DiscardUnknown: true} |
| resp := &adminpb.SearchAds360Link{} |
| 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 |
| |
| httpRsp, err := c.httpClient.Do(httpReq) |
| if err != nil { |
| return err |
| } |
| defer httpRsp.Body.Close() |
| |
| if err = googleapi.CheckResponse(httpRsp); err != nil { |
| return err |
| } |
| |
| buf, err := io.ReadAll(httpRsp.Body) |
| 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 |
| } |
| |
| // ListSearchAds360Links lists all SearchAds360Links on a property. |
| func (c *analyticsAdminRESTClient) ListSearchAds360Links(ctx context.Context, req *adminpb.ListSearchAds360LinksRequest, opts ...gax.CallOption) *SearchAds360LinkIterator { |
| it := &SearchAds360LinkIterator{} |
| req = proto.Clone(req).(*adminpb.ListSearchAds360LinksRequest) |
| unm := protojson.UnmarshalOptions{AllowPartial: true, DiscardUnknown: true} |
| it.InternalFetch = func(pageSize int, pageToken string) ([]*adminpb.SearchAds360Link, string, error) { |
| resp := &adminpb.ListSearchAds360LinksResponse{} |
| 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("/v1alpha/%v/searchAds360Links", 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 |
| |
| httpRsp, err := c.httpClient.Do(httpReq) |
| if err != nil { |
| return err |
| } |
| defer httpRsp.Body.Close() |
| |
| if err = googleapi.CheckResponse(httpRsp); err != nil { |
| return err |
| } |
| |
| buf, err := io.ReadAll(httpRsp.Body) |
| 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.GetSearchAds_360Links(), 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 |
| } |
| |
| // CreateSearchAds360Link creates a SearchAds360Link. |
| func (c *analyticsAdminRESTClient) CreateSearchAds360Link(ctx context.Context, req *adminpb.CreateSearchAds360LinkRequest, opts ...gax.CallOption) (*adminpb.SearchAds360Link, error) { |
| m := protojson.MarshalOptions{AllowPartial: true, UseEnumNumbers: true} |
| body := req.GetSearchAds_360Link() |
| 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("/v1alpha/%v/searchAds360Links", 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).CreateSearchAds360Link[0:len((*c.CallOptions).CreateSearchAds360Link):len((*c.CallOptions).CreateSearchAds360Link)], opts...) |
| unm := protojson.UnmarshalOptions{AllowPartial: true, DiscardUnknown: true} |
| resp := &adminpb.SearchAds360Link{} |
| 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 |
| |
| httpRsp, err := c.httpClient.Do(httpReq) |
| if err != nil { |
| return err |
| } |
| defer httpRsp.Body.Close() |
| |
| if err = googleapi.CheckResponse(httpRsp); err != nil { |
| return err |
| } |
| |
| buf, err := io.ReadAll(httpRsp.Body) |
| 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 |
| } |
| |
| // DeleteSearchAds360Link deletes a SearchAds360Link on a property. |
| func (c *analyticsAdminRESTClient) DeleteSearchAds360Link(ctx context.Context, req *adminpb.DeleteSearchAds360LinkRequest, opts ...gax.CallOption) error { |
| baseUrl, err := url.Parse(c.endpoint) |
| if err != nil { |
| return err |
| } |
| baseUrl.Path += fmt.Sprintf("/v1alpha/%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 |
| |
| httpRsp, err := c.httpClient.Do(httpReq) |
| if err != nil { |
| return err |
| } |
| defer httpRsp.Body.Close() |
| |
| // Returns nil if there is no error, otherwise wraps |
| // the response code and body into a non-nil error |
| return googleapi.CheckResponse(httpRsp) |
| }, opts...) |
| } |
| |
| // UpdateSearchAds360Link updates a SearchAds360Link on a property. |
| func (c *analyticsAdminRESTClient) UpdateSearchAds360Link(ctx context.Context, req *adminpb.UpdateSearchAds360LinkRequest, opts ...gax.CallOption) (*adminpb.SearchAds360Link, error) { |
| m := protojson.MarshalOptions{AllowPartial: true, UseEnumNumbers: true} |
| body := req.GetSearchAds_360Link() |
| 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("/v1alpha/%v", req.GetSearchAds_360Link().GetName()) |
| |
| params := url.Values{} |
| params.Add("$alt", "json;enum-encoding=int") |
| if req.GetUpdateMask() != nil { |
| updateMask, err := protojson.Marshal(req.GetUpdateMask()) |
| if err != nil { |
| return nil, err |
| } |
| params.Add("updateMask", string(updateMask[1:len(updateMask)-1])) |
| } |
| |
| baseUrl.RawQuery = params.Encode() |
| |
| // Build HTTP headers from client and context metadata. |
| hds := []string{"x-goog-request-params", fmt.Sprintf("%s=%v", "search_ads_360_link.name", url.QueryEscape(req.GetSearchAds_360Link().GetName()))} |
| |
| hds = append(c.xGoogHeaders, hds...) |
| hds = append(hds, "Content-Type", "application/json") |
| headers := gax.BuildHeaders(ctx, hds...) |
| opts = append((*c.CallOptions).UpdateSearchAds360Link[0:len((*c.CallOptions).UpdateSearchAds360Link):len((*c.CallOptions).UpdateSearchAds360Link)], opts...) |
| unm := protojson.UnmarshalOptions{AllowPartial: true, DiscardUnknown: true} |
| resp := &adminpb.SearchAds360Link{} |
| 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 |
| |
| httpRsp, err := c.httpClient.Do(httpReq) |
| if err != nil { |
| return err |
| } |
| defer httpRsp.Body.Close() |
| |
| if err = googleapi.CheckResponse(httpRsp); err != nil { |
| return err |
| } |
| |
| buf, err := io.ReadAll(httpRsp.Body) |
| 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 |
| } |
| |
| // GetAttributionSettings lookup for a AttributionSettings singleton. |
| func (c *analyticsAdminRESTClient) GetAttributionSettings(ctx context.Context, req *adminpb.GetAttributionSettingsRequest, opts ...gax.CallOption) (*adminpb.AttributionSettings, error) { |
| baseUrl, err := url.Parse(c.endpoint) |
| if err != nil { |
| return nil, err |
| } |
| baseUrl.Path += fmt.Sprintf("/v1alpha/%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).GetAttributionSettings[0:len((*c.CallOptions).GetAttributionSettings):len((*c.CallOptions).GetAttributionSettings)], opts...) |
| unm := protojson.UnmarshalOptions{AllowPartial: true, DiscardUnknown: true} |
| resp := &adminpb.AttributionSettings{} |
| 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 |
| |
| httpRsp, err := c.httpClient.Do(httpReq) |
| if err != nil { |
| return err |
| } |
| defer httpRsp.Body.Close() |
| |
| if err = googleapi.CheckResponse(httpRsp); err != nil { |
| return err |
| } |
| |
| buf, err := io.ReadAll(httpRsp.Body) |
| 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 |
| } |
| |
| // UpdateAttributionSettings updates attribution settings on a property. |
| func (c *analyticsAdminRESTClient) UpdateAttributionSettings(ctx context.Context, req *adminpb.UpdateAttributionSettingsRequest, opts ...gax.CallOption) (*adminpb.AttributionSettings, error) { |
| m := protojson.MarshalOptions{AllowPartial: true, UseEnumNumbers: true} |
| body := req.GetAttributionSettings() |
| 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("/v1alpha/%v", req.GetAttributionSettings().GetName()) |
| |
| params := url.Values{} |
| params.Add("$alt", "json;enum-encoding=int") |
| if req.GetUpdateMask() != nil { |
| updateMask, err := protojson.Marshal(req.GetUpdateMask()) |
| if err != nil { |
| return nil, err |
| } |
| params.Add("updateMask", string(updateMask[1:len(updateMask)-1])) |
| } |
| |
| baseUrl.RawQuery = params.Encode() |
| |
| // Build HTTP headers from client and context metadata. |
| hds := []string{"x-goog-request-params", fmt.Sprintf("%s=%v", "attribution_settings.name", url.QueryEscape(req.GetAttributionSettings().GetName()))} |
| |
| hds = append(c.xGoogHeaders, hds...) |
| hds = append(hds, "Content-Type", "application/json") |
| headers := gax.BuildHeaders(ctx, hds...) |
| opts = append((*c.CallOptions).UpdateAttributionSettings[0:len((*c.CallOptions).UpdateAttributionSettings):len((*c.CallOptions).UpdateAttributionSettings)], opts...) |
| unm := protojson.UnmarshalOptions{AllowPartial: true, DiscardUnknown: true} |
| resp := &adminpb.AttributionSettings{} |
| 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 |
| |
| httpRsp, err := c.httpClient.Do(httpReq) |
| if err != nil { |
| return err |
| } |
| defer httpRsp.Body.Close() |
| |
| if err = googleapi.CheckResponse(httpRsp); err != nil { |
| return err |
| } |
| |
| buf, err := io.ReadAll(httpRsp.Body) |
| 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 |
| } |
| |
| // RunAccessReport returns a customized report of data access records. The report provides |
| // records of each time a user reads Google Analytics reporting data. Access |
| // records are retained for up to 2 years. |
| // |
| // Data Access Reports can be requested for a property. Reports may be |
| // requested for any property, but dimensions that aren’t related to quota can |
| // only be requested on Google Analytics 360 properties. This method is only |
| // available to Administrators. |
| // |
| // These data access records include GA4 UI Reporting, GA4 UI Explorations, |
| // GA4 Data API, and other products like Firebase & Admob that can retrieve |
| // data from Google Analytics through a linkage. These records don’t include |
| // property configuration changes like adding a stream or changing a |
| // property’s time zone. For configuration change history, see |
| // searchChangeHistoryEvents (at https://developers.google.com/analytics/devguides/config/admin/v1/rest/v1alpha/accounts/searchChangeHistoryEvents). |
| func (c *analyticsAdminRESTClient) RunAccessReport(ctx context.Context, req *adminpb.RunAccessReportRequest, opts ...gax.CallOption) (*adminpb.RunAccessReportResponse, 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("/v1alpha/%v:runAccessReport", req.GetEntity()) |
| |
| 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", "entity", url.QueryEscape(req.GetEntity()))} |
| |
| hds = append(c.xGoogHeaders, hds...) |
| hds = append(hds, "Content-Type", "application/json") |
| headers := gax.BuildHeaders(ctx, hds...) |
| opts = append((*c.CallOptions).RunAccessReport[0:len((*c.CallOptions).RunAccessReport):len((*c.CallOptions).RunAccessReport)], opts...) |
| unm := protojson.UnmarshalOptions{AllowPartial: true, DiscardUnknown: true} |
| resp := &adminpb.RunAccessReportResponse{} |
| 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 |
| |
| httpRsp, err := c.httpClient.Do(httpReq) |
| if err != nil { |
| return err |
| } |
| defer httpRsp.Body.Close() |
| |
| if err = googleapi.CheckResponse(httpRsp); err != nil { |
| return err |
| } |
| |
| buf, err := io.ReadAll(httpRsp.Body) |
| 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 |
| } |
| |
| // CreateAccessBinding creates an access binding on an account or property. |
| func (c *analyticsAdminRESTClient) CreateAccessBinding(ctx context.Context, req *adminpb.CreateAccessBindingRequest, opts ...gax.CallOption) (*adminpb.AccessBinding, error) { |
| m := protojson.MarshalOptions{AllowPartial: true, UseEnumNumbers: true} |
| body := req.GetAccessBinding() |
| 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("/v1alpha/%v/accessBindings", 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).CreateAccessBinding[0:len((*c.CallOptions).CreateAccessBinding):len((*c.CallOptions).CreateAccessBinding)], opts...) |
| unm := protojson.UnmarshalOptions{AllowPartial: true, DiscardUnknown: true} |
| resp := &adminpb.AccessBinding{} |
| 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 |
| |
| httpRsp, err := c.httpClient.Do(httpReq) |
| if err != nil { |
| return err |
| } |
| defer httpRsp.Body.Close() |
| |
| if err = googleapi.CheckResponse(httpRsp); err != nil { |
| return err |
| } |
| |
| buf, err := io.ReadAll(httpRsp.Body) |
| 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 |
| } |
| |
| // GetAccessBinding gets information about an access binding. |
| func (c *analyticsAdminRESTClient) GetAccessBinding(ctx context.Context, req *adminpb.GetAccessBindingRequest, opts ...gax.CallOption) (*adminpb.AccessBinding, error) { |
| baseUrl, err := url.Parse(c.endpoint) |
| if err != nil { |
| return nil, err |
| } |
| baseUrl.Path += fmt.Sprintf("/v1alpha/%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).GetAccessBinding[0:len((*c.CallOptions).GetAccessBinding):len((*c.CallOptions).GetAccessBinding)], opts...) |
| unm := protojson.UnmarshalOptions{AllowPartial: true, DiscardUnknown: true} |
| resp := &adminpb.AccessBinding{} |
| 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 |
| |
| httpRsp, err := c.httpClient.Do(httpReq) |
| if err != nil { |
| return err |
| } |
| defer httpRsp.Body.Close() |
| |
| if err = googleapi.CheckResponse(httpRsp); err != nil { |
| return err |
| } |
| |
| buf, err := io.ReadAll(httpRsp.Body) |
| 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 |
| } |
| |
| // UpdateAccessBinding updates an access binding on an account or property. |
| func (c *analyticsAdminRESTClient) UpdateAccessBinding(ctx context.Context, req *adminpb.UpdateAccessBindingRequest, opts ...gax.CallOption) (*adminpb.AccessBinding, error) { |
| m := protojson.MarshalOptions{AllowPartial: true, UseEnumNumbers: true} |
| body := req.GetAccessBinding() |
| 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("/v1alpha/%v", req.GetAccessBinding().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", "access_binding.name", url.QueryEscape(req.GetAccessBinding().GetName()))} |
| |
| hds = append(c.xGoogHeaders, hds...) |
| hds = append(hds, "Content-Type", "application/json") |
| headers := gax.BuildHeaders(ctx, hds...) |
| opts = append((*c.CallOptions).UpdateAccessBinding[0:len((*c.CallOptions).UpdateAccessBinding):len((*c.CallOptions).UpdateAccessBinding)], opts...) |
| unm := protojson.UnmarshalOptions{AllowPartial: true, DiscardUnknown: true} |
| resp := &adminpb.AccessBinding{} |
| 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 |
| |
| httpRsp, err := c.httpClient.Do(httpReq) |
| if err != nil { |
| return err |
| } |
| defer httpRsp.Body.Close() |
| |
| if err = googleapi.CheckResponse(httpRsp); err != nil { |
| return err |
| } |
| |
| buf, err := io.ReadAll(httpRsp.Body) |
| 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 |
| } |
| |
| // DeleteAccessBinding deletes an access binding on an account or property. |
| func (c *analyticsAdminRESTClient) DeleteAccessBinding(ctx context.Context, req *adminpb.DeleteAccessBindingRequest, opts ...gax.CallOption) error { |
| baseUrl, err := url.Parse(c.endpoint) |
| if err != nil { |
| return err |
| } |
| baseUrl.Path += fmt.Sprintf("/v1alpha/%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 |
| |
| httpRsp, err := c.httpClient.Do(httpReq) |
| if err != nil { |
| return err |
| } |
| defer httpRsp.Body.Close() |
| |
| // Returns nil if there is no error, otherwise wraps |
| // the response code and body into a non-nil error |
| return googleapi.CheckResponse(httpRsp) |
| }, opts...) |
| } |
| |
| // ListAccessBindings lists all access bindings on an account or property. |
| func (c *analyticsAdminRESTClient) ListAccessBindings(ctx context.Context, req *adminpb.ListAccessBindingsRequest, opts ...gax.CallOption) *AccessBindingIterator { |
| it := &AccessBindingIterator{} |
| req = proto.Clone(req).(*adminpb.ListAccessBindingsRequest) |
| unm := protojson.UnmarshalOptions{AllowPartial: true, DiscardUnknown: true} |
| it.InternalFetch = func(pageSize int, pageToken string) ([]*adminpb.AccessBinding, string, error) { |
| resp := &adminpb.ListAccessBindingsResponse{} |
| 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("/v1alpha/%v/accessBindings", 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 |
| |
| httpRsp, err := c.httpClient.Do(httpReq) |
| if err != nil { |
| return err |
| } |
| defer httpRsp.Body.Close() |
| |
| if err = googleapi.CheckResponse(httpRsp); err != nil { |
| return err |
| } |
| |
| buf, err := io.ReadAll(httpRsp.Body) |
| 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.GetAccessBindings(), 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 |
| } |
| |
| // BatchCreateAccessBindings creates information about multiple access bindings to an account or |
| // property. |
| // |
| // This method is transactional. If any AccessBinding cannot be created, none |
| // of the AccessBindings will be created. |
| func (c *analyticsAdminRESTClient) BatchCreateAccessBindings(ctx context.Context, req *adminpb.BatchCreateAccessBindingsRequest, opts ...gax.CallOption) (*adminpb.BatchCreateAccessBindingsResponse, 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("/v1alpha/%v/accessBindings:batchCreate", 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).BatchCreateAccessBindings[0:len((*c.CallOptions).BatchCreateAccessBindings):len((*c.CallOptions).BatchCreateAccessBindings)], opts...) |
| unm := protojson.UnmarshalOptions{AllowPartial: true, DiscardUnknown: true} |
| resp := &adminpb.BatchCreateAccessBindingsResponse{} |
| 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 |
| |
| httpRsp, err := c.httpClient.Do(httpReq) |
| if err != nil { |
| return err |
| } |
| defer httpRsp.Body.Close() |
| |
| if err = googleapi.CheckResponse(httpRsp); err != nil { |
| return err |
| } |
| |
| buf, err := io.ReadAll(httpRsp.Body) |
| 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 |
| } |
| |
| // BatchGetAccessBindings gets information about multiple access bindings to an account or property. |
| func (c *analyticsAdminRESTClient) BatchGetAccessBindings(ctx context.Context, req *adminpb.BatchGetAccessBindingsRequest, opts ...gax.CallOption) (*adminpb.BatchGetAccessBindingsResponse, error) { |
| baseUrl, err := url.Parse(c.endpoint) |
| if err != nil { |
| return nil, err |
| } |
| baseUrl.Path += fmt.Sprintf("/v1alpha/%v/accessBindings:batchGet", req.GetParent()) |
| |
| params := url.Values{} |
| params.Add("$alt", "json;enum-encoding=int") |
| if items := req.GetNames(); len(items) > 0 { |
| for _, item := range items { |
| params.Add("names", fmt.Sprintf("%v", item)) |
| } |
| } |
| |
| 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).BatchGetAccessBindings[0:len((*c.CallOptions).BatchGetAccessBindings):len((*c.CallOptions).BatchGetAccessBindings)], opts...) |
| unm := protojson.UnmarshalOptions{AllowPartial: true, DiscardUnknown: true} |
| resp := &adminpb.BatchGetAccessBindingsResponse{} |
| 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 |
| |
| httpRsp, err := c.httpClient.Do(httpReq) |
| if err != nil { |
| return err |
| } |
| defer httpRsp.Body.Close() |
| |
| if err = googleapi.CheckResponse(httpRsp); err != nil { |
| return err |
| } |
| |
| buf, err := io.ReadAll(httpRsp.Body) |
| 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 |
| } |
| |
| // BatchUpdateAccessBindings updates information about multiple access bindings to an account or |
| // property. |
| func (c *analyticsAdminRESTClient) BatchUpdateAccessBindings(ctx context.Context, req *adminpb.BatchUpdateAccessBindingsRequest, opts ...gax.CallOption) (*adminpb.BatchUpdateAccessBindingsResponse, 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("/v1alpha/%v/accessBindings:batchUpdate", 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).BatchUpdateAccessBindings[0:len((*c.CallOptions).BatchUpdateAccessBindings):len((*c.CallOptions).BatchUpdateAccessBindings)], opts...) |
| unm := protojson.UnmarshalOptions{AllowPartial: true, DiscardUnknown: true} |
| resp := &adminpb.BatchUpdateAccessBindingsResponse{} |
| 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 |
| |
| httpRsp, err := c.httpClient.Do(httpReq) |
| if err != nil { |
| return err |
| } |
| defer httpRsp.Body.Close() |
| |
| if err = googleapi.CheckResponse(httpRsp); err != nil { |
| return err |
| } |
| |
| buf, err := io.ReadAll(httpRsp.Body) |
| 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 |
| } |
| |
| // BatchDeleteAccessBindings deletes information about multiple users’ links to an account or property. |
| func (c *analyticsAdminRESTClient) BatchDeleteAccessBindings(ctx context.Context, req *adminpb.BatchDeleteAccessBindingsRequest, opts ...gax.CallOption) error { |
| m := protojson.MarshalOptions{AllowPartial: true, UseEnumNumbers: true} |
| jsonReq, err := m.Marshal(req) |
| if err != nil { |
| return err |
| } |
| |
| baseUrl, err := url.Parse(c.endpoint) |
| if err != nil { |
| return err |
| } |
| baseUrl.Path += fmt.Sprintf("/v1alpha/%v/accessBindings:batchDelete", 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...) |
| 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(), bytes.NewReader(jsonReq)) |
| if err != nil { |
| return err |
| } |
| httpReq = httpReq.WithContext(ctx) |
| httpReq.Header = headers |
| |
| httpRsp, err := c.httpClient.Do(httpReq) |
| if err != nil { |
| return err |
| } |
| defer httpRsp.Body.Close() |
| |
| // Returns nil if there is no error, otherwise wraps |
| // the response code and body into a non-nil error |
| return googleapi.CheckResponse(httpRsp) |
| }, opts...) |
| } |
| |
| // GetExpandedDataSet lookup for a single ExpandedDataSet. |
| func (c *analyticsAdminRESTClient) GetExpandedDataSet(ctx context.Context, req *adminpb.GetExpandedDataSetRequest, opts ...gax.CallOption) (*adminpb.ExpandedDataSet, error) { |
| baseUrl, err := url.Parse(c.endpoint) |
| if err != nil { |
| return nil, err |
| } |
| baseUrl.Path += fmt.Sprintf("/v1alpha/%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).GetExpandedDataSet[0:len((*c.CallOptions).GetExpandedDataSet):len((*c.CallOptions).GetExpandedDataSet)], opts...) |
| unm := protojson.UnmarshalOptions{AllowPartial: true, DiscardUnknown: true} |
| resp := &adminpb.ExpandedDataSet{} |
| 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 |
| |
| httpRsp, err := c.httpClient.Do(httpReq) |
| if err != nil { |
| return err |
| } |
| defer httpRsp.Body.Close() |
| |
| if err = googleapi.CheckResponse(httpRsp); err != nil { |
| return err |
| } |
| |
| buf, err := io.ReadAll(httpRsp.Body) |
| 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 |
| } |
| |
| // ListExpandedDataSets lists ExpandedDataSets on a property. |
| func (c *analyticsAdminRESTClient) ListExpandedDataSets(ctx context.Context, req *adminpb.ListExpandedDataSetsRequest, opts ...gax.CallOption) *ExpandedDataSetIterator { |
| it := &ExpandedDataSetIterator{} |
| req = proto.Clone(req).(*adminpb.ListExpandedDataSetsRequest) |
| unm := protojson.UnmarshalOptions{AllowPartial: true, DiscardUnknown: true} |
| it.InternalFetch = func(pageSize int, pageToken string) ([]*adminpb.ExpandedDataSet, string, error) { |
| resp := &adminpb.ListExpandedDataSetsResponse{} |
| 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("/v1alpha/%v/expandedDataSets", 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 |
| |
| httpRsp, err := c.httpClient.Do(httpReq) |
| if err != nil { |
| return err |
| } |
| defer httpRsp.Body.Close() |
| |
| if err = googleapi.CheckResponse(httpRsp); err != nil { |
| return err |
| } |
| |
| buf, err := io.ReadAll(httpRsp.Body) |
| 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.GetExpandedDataSets(), 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 |
| } |
| |
| // CreateExpandedDataSet creates a ExpandedDataSet. |
| func (c *analyticsAdminRESTClient) CreateExpandedDataSet(ctx context.Context, req *adminpb.CreateExpandedDataSetRequest, opts ...gax.CallOption) (*adminpb.ExpandedDataSet, error) { |
| m := protojson.MarshalOptions{AllowPartial: true, UseEnumNumbers: true} |
| body := req.GetExpandedDataSet() |
| 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("/v1alpha/%v/expandedDataSets", 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).CreateExpandedDataSet[0:len((*c.CallOptions).CreateExpandedDataSet):len((*c.CallOptions).CreateExpandedDataSet)], opts...) |
| unm := protojson.UnmarshalOptions{AllowPartial: true, DiscardUnknown: true} |
| resp := &adminpb.ExpandedDataSet{} |
| 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 |
| |
| httpRsp, err := c.httpClient.Do(httpReq) |
| if err != nil { |
| return err |
| } |
| defer httpRsp.Body.Close() |
| |
| if err = googleapi.CheckResponse(httpRsp); err != nil { |
| return err |
| } |
| |
| buf, err := io.ReadAll(httpRsp.Body) |
| 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 |
| } |
| |
| // UpdateExpandedDataSet updates a ExpandedDataSet on a property. |
| func (c *analyticsAdminRESTClient) UpdateExpandedDataSet(ctx context.Context, req *adminpb.UpdateExpandedDataSetRequest, opts ...gax.CallOption) (*adminpb.ExpandedDataSet, error) { |
| m := protojson.MarshalOptions{AllowPartial: true, UseEnumNumbers: true} |
| body := req.GetExpandedDataSet() |
| 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("/v1alpha/%v", req.GetExpandedDataSet().GetName()) |
| |
| params := url.Values{} |
| params.Add("$alt", "json;enum-encoding=int") |
| if req.GetUpdateMask() != nil { |
| updateMask, err := protojson.Marshal(req.GetUpdateMask()) |
| if err != nil { |
| return nil, err |
| } |
| params.Add("updateMask", string(updateMask[1:len(updateMask)-1])) |
| } |
| |
| baseUrl.RawQuery = params.Encode() |
| |
| // Build HTTP headers from client and context metadata. |
| hds := []string{"x-goog-request-params", fmt.Sprintf("%s=%v", "expanded_data_set.name", url.QueryEscape(req.GetExpandedDataSet().GetName()))} |
| |
| hds = append(c.xGoogHeaders, hds...) |
| hds = append(hds, "Content-Type", "application/json") |
| headers := gax.BuildHeaders(ctx, hds...) |
| opts = append((*c.CallOptions).UpdateExpandedDataSet[0:len((*c.CallOptions).UpdateExpandedDataSet):len((*c.CallOptions).UpdateExpandedDataSet)], opts...) |
| unm := protojson.UnmarshalOptions{AllowPartial: true, DiscardUnknown: true} |
| resp := &adminpb.ExpandedDataSet{} |
| 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 |
| |
| httpRsp, err := c.httpClient.Do(httpReq) |
| if err != nil { |
| return err |
| } |
| defer httpRsp.Body.Close() |
| |
| if err = googleapi.CheckResponse(httpRsp); err != nil { |
| return err |
| } |
| |
| buf, err := io.ReadAll(httpRsp.Body) |
| 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 |
| } |
| |
| // DeleteExpandedDataSet deletes a ExpandedDataSet on a property. |
| func (c *analyticsAdminRESTClient) DeleteExpandedDataSet(ctx context.Context, req *adminpb.DeleteExpandedDataSetRequest, opts ...gax.CallOption) error { |
| baseUrl, err := url.Parse(c.endpoint) |
| if err != nil { |
| return err |
| } |
| baseUrl.Path += fmt.Sprintf("/v1alpha/%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 |
| |
| httpRsp, err := c.httpClient.Do(httpReq) |
| if err != nil { |
| return err |
| } |
| defer httpRsp.Body.Close() |
| |
| // Returns nil if there is no error, otherwise wraps |
| // the response code and body into a non-nil error |
| return googleapi.CheckResponse(httpRsp) |
| }, opts...) |
| } |
| |
| // GetChannelGroup lookup for a single ChannelGroup. |
| func (c *analyticsAdminRESTClient) GetChannelGroup(ctx context.Context, req *adminpb.GetChannelGroupRequest, opts ...gax.CallOption) (*adminpb.ChannelGroup, error) { |
| baseUrl, err := url.Parse(c.endpoint) |
| if err != nil { |
| return nil, err |
| } |
| baseUrl.Path += fmt.Sprintf("/v1alpha/%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).GetChannelGroup[0:len((*c.CallOptions).GetChannelGroup):len((*c.CallOptions).GetChannelGroup)], opts...) |
| unm := protojson.UnmarshalOptions{AllowPartial: true, DiscardUnknown: true} |
| resp := &adminpb.ChannelGroup{} |
| 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 |
| |
| httpRsp, err := c.httpClient.Do(httpReq) |
| if err != nil { |
| return err |
| } |
| defer httpRsp.Body.Close() |
| |
| if err = googleapi.CheckResponse(httpRsp); err != nil { |
| return err |
| } |
| |
| buf, err := io.ReadAll(httpRsp.Body) |
| 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 |
| } |
| |
| // ListChannelGroups lists ChannelGroups on a property. |
| func (c *analyticsAdminRESTClient) ListChannelGroups(ctx context.Context, req *adminpb.ListChannelGroupsRequest, opts ...gax.CallOption) *ChannelGroupIterator { |
| it := &ChannelGroupIterator{} |
| req = proto.Clone(req).(*adminpb.ListChannelGroupsRequest) |
| unm := protojson.UnmarshalOptions{AllowPartial: true, DiscardUnknown: true} |
| it.InternalFetch = func(pageSize int, pageToken string) ([]*adminpb.ChannelGroup, string, error) { |
| resp := &adminpb.ListChannelGroupsResponse{} |
| 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("/v1alpha/%v/channelGroups", 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 |
| |
| httpRsp, err := c.httpClient.Do(httpReq) |
| if err != nil { |
| return err |
| } |
| defer httpRsp.Body.Close() |
| |
| if err = googleapi.CheckResponse(httpRsp); err != nil { |
| return err |
| } |
| |
| buf, err := io.ReadAll(httpRsp.Body) |
| 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.GetChannelGroups(), 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 |
| } |
| |
| // CreateChannelGroup creates a ChannelGroup. |
| func (c *analyticsAdminRESTClient) CreateChannelGroup(ctx context.Context, req *adminpb.CreateChannelGroupRequest, opts ...gax.CallOption) (*adminpb.ChannelGroup, error) { |
| m := protojson.MarshalOptions{AllowPartial: true, UseEnumNumbers: true} |
| body := req.GetChannelGroup() |
| 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("/v1alpha/%v/channelGroups", 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).CreateChannelGroup[0:len((*c.CallOptions).CreateChannelGroup):len((*c.CallOptions).CreateChannelGroup)], opts...) |
| unm := protojson.UnmarshalOptions{AllowPartial: true, DiscardUnknown: true} |
| resp := &adminpb.ChannelGroup{} |
| 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 |
| |
| httpRsp, err := c.httpClient.Do(httpReq) |
| if err != nil { |
| return err |
| } |
| defer httpRsp.Body.Close() |
| |
| if err = googleapi.CheckResponse(httpRsp); err != nil { |
| return err |
| } |
| |
| buf, err := io.ReadAll(httpRsp.Body) |
| 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 |
| } |
| |
| // UpdateChannelGroup updates a ChannelGroup. |
| func (c *analyticsAdminRESTClient) UpdateChannelGroup(ctx context.Context, req *adminpb.UpdateChannelGroupRequest, opts ...gax.CallOption) (*adminpb.ChannelGroup, error) { |
| m := protojson.MarshalOptions{AllowPartial: true, UseEnumNumbers: true} |
| body := req.GetChannelGroup() |
| 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("/v1alpha/%v", req.GetChannelGroup().GetName()) |
| |
| params := url.Values{} |
| params.Add("$alt", "json;enum-encoding=int") |
| if req.GetUpdateMask() != nil { |
| updateMask, err := protojson.Marshal(req.GetUpdateMask()) |
| if err != nil { |
| return nil, err |
| } |
| params.Add("updateMask", string(updateMask[1:len(updateMask)-1])) |
| } |
| |
| baseUrl.RawQuery = params.Encode() |
| |
| // Build HTTP headers from client and context metadata. |
| hds := []string{"x-goog-request-params", fmt.Sprintf("%s=%v", "channel_group.name", url.QueryEscape(req.GetChannelGroup().GetName()))} |
| |
| hds = append(c.xGoogHeaders, hds...) |
| hds = append(hds, "Content-Type", "application/json") |
| headers := gax.BuildHeaders(ctx, hds...) |
| opts = append((*c.CallOptions).UpdateChannelGroup[0:len((*c.CallOptions).UpdateChannelGroup):len((*c.CallOptions).UpdateChannelGroup)], opts...) |
| unm := protojson.UnmarshalOptions{AllowPartial: true, DiscardUnknown: true} |
| resp := &adminpb.ChannelGroup{} |
| 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 |
| |
| httpRsp, err := c.httpClient.Do(httpReq) |
| if err != nil { |
| return err |
| } |
| defer httpRsp.Body.Close() |
| |
| if err = googleapi.CheckResponse(httpRsp); err != nil { |
| return err |
| } |
| |
| buf, err := io.ReadAll(httpRsp.Body) |
| 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 |
| } |
| |
| // DeleteChannelGroup deletes a ChannelGroup on a property. |
| func (c *analyticsAdminRESTClient) DeleteChannelGroup(ctx context.Context, req *adminpb.DeleteChannelGroupRequest, opts ...gax.CallOption) error { |
| baseUrl, err := url.Parse(c.endpoint) |
| if err != nil { |
| return err |
| } |
| baseUrl.Path += fmt.Sprintf("/v1alpha/%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 |
| |
| httpRsp, err := c.httpClient.Do(httpReq) |
| if err != nil { |
| return err |
| } |
| defer httpRsp.Body.Close() |
| |
| // Returns nil if there is no error, otherwise wraps |
| // the response code and body into a non-nil error |
| return googleapi.CheckResponse(httpRsp) |
| }, opts...) |
| } |
| |
| // SetAutomatedGa4ConfigurationOptOut sets the opt out status for the automated GA4 setup process for a UA |
| // property. |
| // Note: this has no effect on GA4 property. |
| func (c *analyticsAdminRESTClient) SetAutomatedGa4ConfigurationOptOut(ctx context.Context, req *adminpb.SetAutomatedGa4ConfigurationOptOutRequest, opts ...gax.CallOption) (*adminpb.SetAutomatedGa4ConfigurationOptOutResponse, 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("/v1alpha/properties:setAutomatedGa4ConfigurationOptOut") |
| |
| params := url.Values{} |
| params.Add("$alt", "json;enum-encoding=int") |
| |
| 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...) |
| opts = append((*c.CallOptions).SetAutomatedGa4ConfigurationOptOut[0:len((*c.CallOptions).SetAutomatedGa4ConfigurationOptOut):len((*c.CallOptions).SetAutomatedGa4ConfigurationOptOut)], opts...) |
| unm := protojson.UnmarshalOptions{AllowPartial: true, DiscardUnknown: true} |
| resp := &adminpb.SetAutomatedGa4ConfigurationOptOutResponse{} |
| 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 |
| |
| httpRsp, err := c.httpClient.Do(httpReq) |
| if err != nil { |
| return err |
| } |
| defer httpRsp.Body.Close() |
| |
| if err = googleapi.CheckResponse(httpRsp); err != nil { |
| return err |
| } |
| |
| buf, err := io.ReadAll(httpRsp.Body) |
| 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 |
| } |
| |
| // FetchAutomatedGa4ConfigurationOptOut fetches the opt out status for the automated GA4 setup process for a UA |
| // property. |
| // Note: this has no effect on GA4 property. |
| func (c *analyticsAdminRESTClient) FetchAutomatedGa4ConfigurationOptOut(ctx context.Context, req *adminpb.FetchAutomatedGa4ConfigurationOptOutRequest, opts ...gax.CallOption) (*adminpb.FetchAutomatedGa4ConfigurationOptOutResponse, 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("/v1alpha/properties:fetchAutomatedGa4ConfigurationOptOut") |
| |
| params := url.Values{} |
| params.Add("$alt", "json;enum-encoding=int") |
| |
| 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...) |
| opts = append((*c.CallOptions).FetchAutomatedGa4ConfigurationOptOut[0:len((*c.CallOptions).FetchAutomatedGa4ConfigurationOptOut):len((*c.CallOptions).FetchAutomatedGa4ConfigurationOptOut)], opts...) |
| unm := protojson.UnmarshalOptions{AllowPartial: true, DiscardUnknown: true} |
| resp := &adminpb.FetchAutomatedGa4ConfigurationOptOutResponse{} |
| 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 |
| |
| httpRsp, err := c.httpClient.Do(httpReq) |
| if err != nil { |
| return err |
| } |
| defer httpRsp.Body.Close() |
| |
| if err = googleapi.CheckResponse(httpRsp); err != nil { |
| return err |
| } |
| |
| buf, err := io.ReadAll(httpRsp.Body) |
| 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 |
| } |
| |
| // GetBigQueryLink lookup for a single BigQuery Link. |
| func (c *analyticsAdminRESTClient) GetBigQueryLink(ctx context.Context, req *adminpb.GetBigQueryLinkRequest, opts ...gax.CallOption) (*adminpb.BigQueryLink, error) { |
| baseUrl, err := url.Parse(c.endpoint) |
| if err != nil { |
| return nil, err |
| } |
| baseUrl.Path += fmt.Sprintf("/v1alpha/%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).GetBigQueryLink[0:len((*c.CallOptions).GetBigQueryLink):len((*c.CallOptions).GetBigQueryLink)], opts...) |
| unm := protojson.UnmarshalOptions{AllowPartial: true, DiscardUnknown: true} |
| resp := &adminpb.BigQueryLink{} |
| 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 |
| |
| httpRsp, err := c.httpClient.Do(httpReq) |
| if err != nil { |
| return err |
| } |
| defer httpRsp.Body.Close() |
| |
| if err = googleapi.CheckResponse(httpRsp); err != nil { |
| return err |
| } |
| |
| buf, err := io.ReadAll(httpRsp.Body) |
| 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 |
| } |
| |
| // ListBigQueryLinks lists BigQuery Links on a property. |
| func (c *analyticsAdminRESTClient) ListBigQueryLinks(ctx context.Context, req *adminpb.ListBigQueryLinksRequest, opts ...gax.CallOption) *BigQueryLinkIterator { |
| it := &BigQueryLinkIterator{} |
| req = proto.Clone(req).(*adminpb.ListBigQueryLinksRequest) |
| unm := protojson.UnmarshalOptions{AllowPartial: true, DiscardUnknown: true} |
| it.InternalFetch = func(pageSize int, pageToken string) ([]*adminpb.BigQueryLink, string, error) { |
| resp := &adminpb.ListBigQueryLinksResponse{} |
| 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("/v1alpha/%v/bigQueryLinks", 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 |
| |
| httpRsp, err := c.httpClient.Do(httpReq) |
| if err != nil { |
| return err |
| } |
| defer httpRsp.Body.Close() |
| |
| if err = googleapi.CheckResponse(httpRsp); err != nil { |
| return err |
| } |
| |
| buf, err := io.ReadAll(httpRsp.Body) |
| 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.GetBigqueryLinks(), 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 |
| } |
| |
| // GetEnhancedMeasurementSettings returns the enhanced measurement settings for this data stream. |
| // Note that the stream must enable enhanced measurement for these settings to |
| // take effect. |
| func (c *analyticsAdminRESTClient) GetEnhancedMeasurementSettings(ctx context.Context, req *adminpb.GetEnhancedMeasurementSettingsRequest, opts ...gax.CallOption) (*adminpb.EnhancedMeasurementSettings, error) { |
| baseUrl, err := url.Parse(c.endpoint) |
| if err != nil { |
| return nil, err |
| } |
| baseUrl.Path += fmt.Sprintf("/v1alpha/%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).GetEnhancedMeasurementSettings[0:len((*c.CallOptions).GetEnhancedMeasurementSettings):len((*c.CallOptions).GetEnhancedMeasurementSettings)], opts...) |
| unm := protojson.UnmarshalOptions{AllowPartial: true, DiscardUnknown: true} |
| resp := &adminpb.EnhancedMeasurementSettings{} |
| 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 |
| |
| httpRsp, err := c.httpClient.Do(httpReq) |
| if err != nil { |
| return err |
| } |
| defer httpRsp.Body.Close() |
| |
| if err = googleapi.CheckResponse(httpRsp); err != nil { |
| return err |
| } |
| |
| buf, err := io.ReadAll(httpRsp.Body) |
| 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 |
| } |
| |
| // UpdateEnhancedMeasurementSettings updates the enhanced measurement settings for this data stream. |
| // Note that the stream must enable enhanced measurement for these settings to |
| // take effect. |
| func (c *analyticsAdminRESTClient) UpdateEnhancedMeasurementSettings(ctx context.Context, req *adminpb.UpdateEnhancedMeasurementSettingsRequest, opts ...gax.CallOption) (*adminpb.EnhancedMeasurementSettings, error) { |
| m := protojson.MarshalOptions{AllowPartial: true, UseEnumNumbers: true} |
| body := req.GetEnhancedMeasurementSettings() |
| 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("/v1alpha/%v", req.GetEnhancedMeasurementSettings().GetName()) |
| |
| params := url.Values{} |
| params.Add("$alt", "json;enum-encoding=int") |
| if req.GetUpdateMask() != nil { |
| updateMask, err := protojson.Marshal(req.GetUpdateMask()) |
| if err != nil { |
| return nil, err |
| } |
| params.Add("updateMask", string(updateMask[1:len(updateMask)-1])) |
| } |
| |
| baseUrl.RawQuery = params.Encode() |
| |
| // Build HTTP headers from client and context metadata. |
| hds := []string{"x-goog-request-params", fmt.Sprintf("%s=%v", "enhanced_measurement_settings.name", url.QueryEscape(req.GetEnhancedMeasurementSettings().GetName()))} |
| |
| hds = append(c.xGoogHeaders, hds...) |
| hds = append(hds, "Content-Type", "application/json") |
| headers := gax.BuildHeaders(ctx, hds...) |
| opts = append((*c.CallOptions).UpdateEnhancedMeasurementSettings[0:len((*c.CallOptions).UpdateEnhancedMeasurementSettings):len((*c.CallOptions).UpdateEnhancedMeasurementSettings)], opts...) |
| unm := protojson.UnmarshalOptions{AllowPartial: true, DiscardUnknown: true} |
| resp := &adminpb.EnhancedMeasurementSettings{} |
| 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 |
| |
| httpRsp, err := c.httpClient.Do(httpReq) |
| if err != nil { |
| return err |
| } |
| defer httpRsp.Body.Close() |
| |
| if err = googleapi.CheckResponse(httpRsp); err != nil { |
| return err |
| } |
| |
| buf, err := io.ReadAll(httpRsp.Body) |
| 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 |
| } |
| |
| // CreateConnectedSiteTag creates a connected site tag for a Universal Analytics property. You can |
| // create a maximum of 20 connected site tags per property. |
| // Note: This API cannot be used on GA4 properties. |
| func (c *analyticsAdminRESTClient) CreateConnectedSiteTag(ctx context.Context, req *adminpb.CreateConnectedSiteTagRequest, opts ...gax.CallOption) (*adminpb.CreateConnectedSiteTagResponse, 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("/v1alpha/properties:createConnectedSiteTag") |
| |
| params := url.Values{} |
| params.Add("$alt", "json;enum-encoding=int") |
| |
| 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...) |
| opts = append((*c.CallOptions).CreateConnectedSiteTag[0:len((*c.CallOptions).CreateConnectedSiteTag):len((*c.CallOptions).CreateConnectedSiteTag)], opts...) |
| unm := protojson.UnmarshalOptions{AllowPartial: true, DiscardUnknown: true} |
| resp := &adminpb.CreateConnectedSiteTagResponse{} |
| 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 |
| |
| httpRsp, err := c.httpClient.Do(httpReq) |
| if err != nil { |
| return err |
| } |
| defer httpRsp.Body.Close() |
| |
| if err = googleapi.CheckResponse(httpRsp); err != nil { |
| return err |
| } |
| |
| buf, err := io.ReadAll(httpRsp.Body) |
| 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 |
| } |
| |
| // DeleteConnectedSiteTag deletes a connected site tag for a Universal Analytics property. |
| // Note: this has no effect on GA4 properties. |
| func (c *analyticsAdminRESTClient) DeleteConnectedSiteTag(ctx context.Context, req *adminpb.DeleteConnectedSiteTagRequest, opts ...gax.CallOption) error { |
| m := protojson.MarshalOptions{AllowPartial: true, UseEnumNumbers: true} |
| jsonReq, err := m.Marshal(req) |
| if err != nil { |
| return err |
| } |
| |
| baseUrl, err := url.Parse(c.endpoint) |
| if err != nil { |
| return err |
| } |
| baseUrl.Path += fmt.Sprintf("/v1alpha/properties:deleteConnectedSiteTag") |
| |
| params := url.Values{} |
| params.Add("$alt", "json;enum-encoding=int") |
| |
| 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...) |
| 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(), bytes.NewReader(jsonReq)) |
| if err != nil { |
| return err |
| } |
| httpReq = httpReq.WithContext(ctx) |
| httpReq.Header = headers |
| |
| httpRsp, err := c.httpClient.Do(httpReq) |
| if err != nil { |
| return err |
| } |
| defer httpRsp.Body.Close() |
| |
| // Returns nil if there is no error, otherwise wraps |
| // the response code and body into a non-nil error |
| return googleapi.CheckResponse(httpRsp) |
| }, opts...) |
| } |
| |
| // ListConnectedSiteTags lists the connected site tags for a Universal Analytics property. A maximum |
| // of 20 connected site tags will be returned. Note: this has no effect on GA4 |
| // property. |
| func (c *analyticsAdminRESTClient) ListConnectedSiteTags(ctx context.Context, req *adminpb.ListConnectedSiteTagsRequest, opts ...gax.CallOption) (*adminpb.ListConnectedSiteTagsResponse, 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("/v1alpha/properties:listConnectedSiteTags") |
| |
| params := url.Values{} |
| params.Add("$alt", "json;enum-encoding=int") |
| |
| 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...) |
| opts = append((*c.CallOptions).ListConnectedSiteTags[0:len((*c.CallOptions).ListConnectedSiteTags):len((*c.CallOptions).ListConnectedSiteTags)], opts...) |
| unm := protojson.UnmarshalOptions{AllowPartial: true, DiscardUnknown: true} |
| resp := &adminpb.ListConnectedSiteTagsResponse{} |
| 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 |
| |
| httpRsp, err := c.httpClient.Do(httpReq) |
| if err != nil { |
| return err |
| } |
| defer httpRsp.Body.Close() |
| |
| if err = googleapi.CheckResponse(httpRsp); err != nil { |
| return err |
| } |
| |
| buf, err := io.ReadAll(httpRsp.Body) |
| 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 |
| } |
| |
| // FetchConnectedGa4Property given a specified UA property, looks up the GA4 property connected to it. |
| // Note: this cannot be used with GA4 properties. |
| func (c *analyticsAdminRESTClient) FetchConnectedGa4Property(ctx context.Context, req *adminpb.FetchConnectedGa4PropertyRequest, opts ...gax.CallOption) (*adminpb.FetchConnectedGa4PropertyResponse, error) { |
| baseUrl, err := url.Parse(c.endpoint) |
| if err != nil { |
| return nil, err |
| } |
| baseUrl.Path += fmt.Sprintf("/v1alpha/properties:fetchConnectedGa4Property") |
| |
| params := url.Values{} |
| params.Add("$alt", "json;enum-encoding=int") |
| params.Add("property", fmt.Sprintf("%v", req.GetProperty())) |
| |
| 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...) |
| opts = append((*c.CallOptions).FetchConnectedGa4Property[0:len((*c.CallOptions).FetchConnectedGa4Property):len((*c.CallOptions).FetchConnectedGa4Property)], opts...) |
| unm := protojson.UnmarshalOptions{AllowPartial: true, DiscardUnknown: true} |
| resp := &adminpb.FetchConnectedGa4PropertyResponse{} |
| 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 |
| |
| httpRsp, err := c.httpClient.Do(httpReq) |
| if err != nil { |
| return err |
| } |
| defer httpRsp.Body.Close() |
| |
| if err = googleapi.CheckResponse(httpRsp); err != nil { |
| return err |
| } |
| |
| buf, err := io.ReadAll(httpRsp.Body) |
| 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 |
| } |
| |
| // GetAdSenseLink looks up a single AdSenseLink. |
| func (c *analyticsAdminRESTClient) GetAdSenseLink(ctx context.Context, req *adminpb.GetAdSenseLinkRequest, opts ...gax.CallOption) (*adminpb.AdSenseLink, error) { |
| baseUrl, err := url.Parse(c.endpoint) |
| if err != nil { |
| return nil, err |
| } |
| baseUrl.Path += fmt.Sprintf("/v1alpha/%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).GetAdSenseLink[0:len((*c.CallOptions).GetAdSenseLink):len((*c.CallOptions).GetAdSenseLink)], opts...) |
| unm := protojson.UnmarshalOptions{AllowPartial: true, DiscardUnknown: true} |
| resp := &adminpb.AdSenseLink{} |
| 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 |
| |
| httpRsp, err := c.httpClient.Do(httpReq) |
| if err != nil { |
| return err |
| } |
| defer httpRsp.Body.Close() |
| |
| if err = googleapi.CheckResponse(httpRsp); err != nil { |
| return err |
| } |
| |
| buf, err := io.ReadAll(httpRsp.Body) |
| 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 |
| } |
| |
| // CreateAdSenseLink creates an AdSenseLink. |
| func (c *analyticsAdminRESTClient) CreateAdSenseLink(ctx context.Context, req *adminpb.CreateAdSenseLinkRequest, opts ...gax.CallOption) (*adminpb.AdSenseLink, error) { |
| m := protojson.MarshalOptions{AllowPartial: true, UseEnumNumbers: true} |
| body := req.GetAdsenseLink() |
| 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("/v1alpha/%v/adSenseLinks", 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).CreateAdSenseLink[0:len((*c.CallOptions).CreateAdSenseLink):len((*c.CallOptions).CreateAdSenseLink)], opts...) |
| unm := protojson.UnmarshalOptions{AllowPartial: true, DiscardUnknown: true} |
| resp := &adminpb.AdSenseLink{} |
| 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 |
| |
| httpRsp, err := c.httpClient.Do(httpReq) |
| if err != nil { |
| return err |
| } |
| defer httpRsp.Body.Close() |
| |
| if err = googleapi.CheckResponse(httpRsp); err != nil { |
| return err |
| } |
| |
| buf, err := io.ReadAll(httpRsp.Body) |
| 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 |
| } |
| |
| // DeleteAdSenseLink deletes an AdSenseLink. |
| func (c *analyticsAdminRESTClient) DeleteAdSenseLink(ctx context.Context, req *adminpb.DeleteAdSenseLinkRequest, opts ...gax.CallOption) error { |
| baseUrl, err := url.Parse(c.endpoint) |
| if err != nil { |
| return err |
| } |
| baseUrl.Path += fmt.Sprintf("/v1alpha/%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 |
| |
| httpRsp, err := c.httpClient.Do(httpReq) |
| if err != nil { |
| return err |
| } |
| defer httpRsp.Body.Close() |
| |
| // Returns nil if there is no error, otherwise wraps |
| // the response code and body into a non-nil error |
| return googleapi.CheckResponse(httpRsp) |
| }, opts...) |
| } |
| |
| // ListAdSenseLinks lists AdSenseLinks on a property. |
| func (c *analyticsAdminRESTClient) ListAdSenseLinks(ctx context.Context, req *adminpb.ListAdSenseLinksRequest, opts ...gax.CallOption) *AdSenseLinkIterator { |
| it := &AdSenseLinkIterator{} |
| req = proto.Clone(req).(*adminpb.ListAdSenseLinksRequest) |
| unm := protojson.UnmarshalOptions{AllowPartial: true, DiscardUnknown: true} |
| it.InternalFetch = func(pageSize int, pageToken string) ([]*adminpb.AdSenseLink, string, error) { |
| resp := &adminpb.ListAdSenseLinksResponse{} |
| 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("/v1alpha/%v/adSenseLinks", 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 |
| |
| httpRsp, err := c.httpClient.Do(httpReq) |
| if err != nil { |
| return err |
| } |
| defer httpRsp.Body.Close() |
| |
| if err = googleapi.CheckResponse(httpRsp); err != nil { |
| return err |
| } |
| |
| buf, err := io.ReadAll(httpRsp.Body) |
| 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.GetAdsenseLinks(), 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 |
| } |
| |
| // GetEventCreateRule lookup for a single EventCreateRule. |
| func (c *analyticsAdminRESTClient) GetEventCreateRule(ctx context.Context, req *adminpb.GetEventCreateRuleRequest, opts ...gax.CallOption) (*adminpb.EventCreateRule, error) { |
| baseUrl, err := url.Parse(c.endpoint) |
| if err != nil { |
| return nil, err |
| } |
| baseUrl.Path += fmt.Sprintf("/v1alpha/%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).GetEventCreateRule[0:len((*c.CallOptions).GetEventCreateRule):len((*c.CallOptions).GetEventCreateRule)], opts...) |
| unm := protojson.UnmarshalOptions{AllowPartial: true, DiscardUnknown: true} |
| resp := &adminpb.EventCreateRule{} |
| 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 |
| |
| httpRsp, err := c.httpClient.Do(httpReq) |
| if err != nil { |
| return err |
| } |
| defer httpRsp.Body.Close() |
| |
| if err = googleapi.CheckResponse(httpRsp); err != nil { |
| return err |
| } |
| |
| buf, err := io.ReadAll(httpRsp.Body) |
| 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 |
| } |
| |
| // ListEventCreateRules lists EventCreateRules on a web data stream. |
| func (c *analyticsAdminRESTClient) ListEventCreateRules(ctx context.Context, req *adminpb.ListEventCreateRulesRequest, opts ...gax.CallOption) *EventCreateRuleIterator { |
| it := &EventCreateRuleIterator{} |
| req = proto.Clone(req).(*adminpb.ListEventCreateRulesRequest) |
| unm := protojson.UnmarshalOptions{AllowPartial: true, DiscardUnknown: true} |
| it.InternalFetch = func(pageSize int, pageToken string) ([]*adminpb.EventCreateRule, string, error) { |
| resp := &adminpb.ListEventCreateRulesResponse{} |
| 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("/v1alpha/%v/eventCreateRules", 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 |
| |
| httpRsp, err := c.httpClient.Do(httpReq) |
| if err != nil { |
| return err |
| } |
| defer httpRsp.Body.Close() |
| |
| if err = googleapi.CheckResponse(httpRsp); err != nil { |
| return err |
| } |
| |
| buf, err := io.ReadAll(httpRsp.Body) |
| 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.GetEventCreateRules(), 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 |
| } |
| |
| // CreateEventCreateRule creates an EventCreateRule. |
| func (c *analyticsAdminRESTClient) CreateEventCreateRule(ctx context.Context, req *adminpb.CreateEventCreateRuleRequest, opts ...gax.CallOption) (*adminpb.EventCreateRule, error) { |
| m := protojson.MarshalOptions{AllowPartial: true, UseEnumNumbers: true} |
| body := req.GetEventCreateRule() |
| 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("/v1alpha/%v/eventCreateRules", 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).CreateEventCreateRule[0:len((*c.CallOptions).CreateEventCreateRule):len((*c.CallOptions).CreateEventCreateRule)], opts...) |
| unm := protojson.UnmarshalOptions{AllowPartial: true, DiscardUnknown: true} |
| resp := &adminpb.EventCreateRule{} |
| 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 |
| |
| httpRsp, err := c.httpClient.Do(httpReq) |
| if err != nil { |
| return err |
| } |
| defer httpRsp.Body.Close() |
| |
| if err = googleapi.CheckResponse(httpRsp); err != nil { |
| return err |
| } |
| |
| buf, err := io.ReadAll(httpRsp.Body) |
| 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 |
| } |
| |
| // UpdateEventCreateRule updates an EventCreateRule. |
| func (c *analyticsAdminRESTClient) UpdateEventCreateRule(ctx context.Context, req *adminpb.UpdateEventCreateRuleRequest, opts ...gax.CallOption) (*adminpb.EventCreateRule, error) { |
| m := protojson.MarshalOptions{AllowPartial: true, UseEnumNumbers: true} |
| body := req.GetEventCreateRule() |
| 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("/v1alpha/%v", req.GetEventCreateRule().GetName()) |
| |
| params := url.Values{} |
| params.Add("$alt", "json;enum-encoding=int") |
| if req.GetUpdateMask() != nil { |
| updateMask, err := protojson.Marshal(req.GetUpdateMask()) |
| if err != nil { |
| return nil, err |
| } |
| params.Add("updateMask", string(updateMask[1:len(updateMask)-1])) |
| } |
| |
| baseUrl.RawQuery = params.Encode() |
| |
| // Build HTTP headers from client and context metadata. |
| hds := []string{"x-goog-request-params", fmt.Sprintf("%s=%v", "event_create_rule.name", url.QueryEscape(req.GetEventCreateRule().GetName()))} |
| |
| hds = append(c.xGoogHeaders, hds...) |
| hds = append(hds, "Content-Type", "application/json") |
| headers := gax.BuildHeaders(ctx, hds...) |
| opts = append((*c.CallOptions).UpdateEventCreateRule[0:len((*c.CallOptions).UpdateEventCreateRule):len((*c.CallOptions).UpdateEventCreateRule)], opts...) |
| unm := protojson.UnmarshalOptions{AllowPartial: true, DiscardUnknown: true} |
| resp := &adminpb.EventCreateRule{} |
| 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 |
| |
| httpRsp, err := c.httpClient.Do(httpReq) |
| if err != nil { |
| return err |
| } |
| defer httpRsp.Body.Close() |
| |
| if err = googleapi.CheckResponse(httpRsp); err != nil { |
| return err |
| } |
| |
| buf, err := io.ReadAll(httpRsp.Body) |
| 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 |
| } |
| |
| // DeleteEventCreateRule deletes an EventCreateRule. |
| func (c *analyticsAdminRESTClient) DeleteEventCreateRule(ctx context.Context, req *adminpb.DeleteEventCreateRuleRequest, opts ...gax.CallOption) error { |
| baseUrl, err := url.Parse(c.endpoint) |
| if err != nil { |
| return err |
| } |
| baseUrl.Path += fmt.Sprintf("/v1alpha/%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 |
| |
| httpRsp, err := c.httpClient.Do(httpReq) |
| if err != nil { |
| return err |
| } |
| defer httpRsp.Body.Close() |
| |
| // Returns nil if there is no error, otherwise wraps |
| // the response code and body into a non-nil error |
| return googleapi.CheckResponse(httpRsp) |
| }, opts...) |
| } |
| |
| // UpdateDataRedactionSettings updates a DataRedactionSettings on a property. |
| func (c *analyticsAdminRESTClient) UpdateDataRedactionSettings(ctx context.Context, req *adminpb.UpdateDataRedactionSettingsRequest, opts ...gax.CallOption) (*adminpb.DataRedactionSettings, error) { |
| m := protojson.MarshalOptions{AllowPartial: true, UseEnumNumbers: true} |
| body := req.GetDataRedactionSettings() |
| 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("/v1alpha/%v", req.GetDataRedactionSettings().GetName()) |
| |
| params := url.Values{} |
| params.Add("$alt", "json;enum-encoding=int") |
| if req.GetUpdateMask() != nil { |
| updateMask, err := protojson.Marshal(req.GetUpdateMask()) |
| if err != nil { |
| return nil, err |
| } |
| params.Add("updateMask", string(updateMask[1:len(updateMask)-1])) |
| } |
| |
| baseUrl.RawQuery = params.Encode() |
| |
| // Build HTTP headers from client and context metadata. |
| hds := []string{"x-goog-request-params", fmt.Sprintf("%s=%v", "data_redaction_settings.name", url.QueryEscape(req.GetDataRedactionSettings().GetName()))} |
| |
| hds = append(c.xGoogHeaders, hds...) |
| hds = append(hds, "Content-Type", "application/json") |
| headers := gax.BuildHeaders(ctx, hds...) |
| opts = append((*c.CallOptions).UpdateDataRedactionSettings[0:len((*c.CallOptions).UpdateDataRedactionSettings):len((*c.CallOptions).UpdateDataRedactionSettings)], opts...) |
| unm := protojson.UnmarshalOptions{AllowPartial: true, DiscardUnknown: true} |
| resp := &adminpb.DataRedactionSettings{} |
| 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 |
| |
| httpRsp, err := c.httpClient.Do(httpReq) |
| if err != nil { |
| return err |
| } |
| defer httpRsp.Body.Close() |
| |
| if err = googleapi.CheckResponse(httpRsp); err != nil { |
| return err |
| } |
| |
| buf, err := io.ReadAll(httpRsp.Body) |
| 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 |
| } |
| |
| // GetDataRedactionSettings lookup for a single DataRedactionSettings. |
| func (c *analyticsAdminRESTClient) GetDataRedactionSettings(ctx context.Context, req *adminpb.GetDataRedactionSettingsRequest, opts ...gax.CallOption) (*adminpb.DataRedactionSettings, error) { |
| baseUrl, err := url.Parse(c.endpoint) |
| if err != nil { |
| return nil, err |
| } |
| baseUrl.Path += fmt.Sprintf("/v1alpha/%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).GetDataRedactionSettings[0:len((*c.CallOptions).GetDataRedactionSettings):len((*c.CallOptions).GetDataRedactionSettings)], opts...) |
| unm := protojson.UnmarshalOptions{AllowPartial: true, DiscardUnknown: true} |
| resp := &adminpb.DataRedactionSettings{} |
| 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 |
| |
| httpRsp, err := c.httpClient.Do(httpReq) |
| if err != nil { |
| return err |
| } |
| defer httpRsp.Body.Close() |
| |
| if err = googleapi.CheckResponse(httpRsp); err != nil { |
| return err |
| } |
| |
| buf, err := io.ReadAll(httpRsp.Body) |
| 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 |
| } |
| |
| // GetCalculatedMetric lookup for a single CalculatedMetric. |
| func (c *analyticsAdminRESTClient) GetCalculatedMetric(ctx context.Context, req *adminpb.GetCalculatedMetricRequest, opts ...gax.CallOption) (*adminpb.CalculatedMetric, error) { |
| baseUrl, err := url.Parse(c.endpoint) |
| if err != nil { |
| return nil, err |
| } |
| baseUrl.Path += fmt.Sprintf("/v1alpha/%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).GetCalculatedMetric[0:len((*c.CallOptions).GetCalculatedMetric):len((*c.CallOptions).GetCalculatedMetric)], opts...) |
| unm := protojson.UnmarshalOptions{AllowPartial: true, DiscardUnknown: true} |
| resp := &adminpb.CalculatedMetric{} |
| 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 |
| |
| httpRsp, err := c.httpClient.Do(httpReq) |
| if err != nil { |
| return err |
| } |
| defer httpRsp.Body.Close() |
| |
| if err = googleapi.CheckResponse(httpRsp); err != nil { |
| return err |
| } |
| |
| buf, err := io.ReadAll(httpRsp.Body) |
| 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 |
| } |
| |
| // CreateCalculatedMetric creates a CalculatedMetric. |
| func (c *analyticsAdminRESTClient) CreateCalculatedMetric(ctx context.Context, req *adminpb.CreateCalculatedMetricRequest, opts ...gax.CallOption) (*adminpb.CalculatedMetric, error) { |
| m := protojson.MarshalOptions{AllowPartial: true, UseEnumNumbers: true} |
| body := req.GetCalculatedMetric() |
| 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("/v1alpha/%v/calculatedMetrics", req.GetParent()) |
| |
| params := url.Values{} |
| params.Add("$alt", "json;enum-encoding=int") |
| params.Add("calculatedMetricId", fmt.Sprintf("%v", req.GetCalculatedMetricId())) |
| |
| 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).CreateCalculatedMetric[0:len((*c.CallOptions).CreateCalculatedMetric):len((*c.CallOptions).CreateCalculatedMetric)], opts...) |
| unm := protojson.UnmarshalOptions{AllowPartial: true, DiscardUnknown: true} |
| resp := &adminpb.CalculatedMetric{} |
| 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 |
| |
| httpRsp, err := c.httpClient.Do(httpReq) |
| if err != nil { |
| return err |
| } |
| defer httpRsp.Body.Close() |
| |
| if err = googleapi.CheckResponse(httpRsp); err != nil { |
| return err |
| } |
| |
| buf, err := io.ReadAll(httpRsp.Body) |
| 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 |
| } |
| |
| // ListCalculatedMetrics lists CalculatedMetrics on a property. |
| func (c *analyticsAdminRESTClient) ListCalculatedMetrics(ctx context.Context, req *adminpb.ListCalculatedMetricsRequest, opts ...gax.CallOption) *CalculatedMetricIterator { |
| it := &CalculatedMetricIterator{} |
| req = proto.Clone(req).(*adminpb.ListCalculatedMetricsRequest) |
| unm := protojson.UnmarshalOptions{AllowPartial: true, DiscardUnknown: true} |
| it.InternalFetch = func(pageSize int, pageToken string) ([]*adminpb.CalculatedMetric, string, error) { |
| resp := &adminpb.ListCalculatedMetricsResponse{} |
| 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("/v1alpha/%v/calculatedMetrics", 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 |
| |
| httpRsp, err := c.httpClient.Do(httpReq) |
| if err != nil { |
| return err |
| } |
| defer httpRsp.Body.Close() |
| |
| if err = googleapi.CheckResponse(httpRsp); err != nil { |
| return err |
| } |
| |
| buf, err := io.ReadAll(httpRsp.Body) |
| 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.GetCalculatedMetrics(), 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 |
| } |
| |
| // UpdateCalculatedMetric updates a CalculatedMetric on a property. |
| func (c *analyticsAdminRESTClient) UpdateCalculatedMetric(ctx context.Context, req *adminpb.UpdateCalculatedMetricRequest, opts ...gax.CallOption) (*adminpb.CalculatedMetric, error) { |
| m := protojson.MarshalOptions{AllowPartial: true, UseEnumNumbers: true} |
| body := req.GetCalculatedMetric() |
| 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("/v1alpha/%v", req.GetCalculatedMetric().GetName()) |
| |
| params := url.Values{} |
| params.Add("$alt", "json;enum-encoding=int") |
| if req.GetUpdateMask() != nil { |
| updateMask, err := protojson.Marshal(req.GetUpdateMask()) |
| if err != nil { |
| return nil, err |
| } |
| params.Add("updateMask", string(updateMask[1:len(updateMask)-1])) |
| } |
| |
| baseUrl.RawQuery = params.Encode() |
| |
| // Build HTTP headers from client and context metadata. |
| hds := []string{"x-goog-request-params", fmt.Sprintf("%s=%v", "calculated_metric.name", url.QueryEscape(req.GetCalculatedMetric().GetName()))} |
| |
| hds = append(c.xGoogHeaders, hds...) |
| hds = append(hds, "Content-Type", "application/json") |
| headers := gax.BuildHeaders(ctx, hds...) |
| opts = append((*c.CallOptions).UpdateCalculatedMetric[0:len((*c.CallOptions).UpdateCalculatedMetric):len((*c.CallOptions).UpdateCalculatedMetric)], opts...) |
| unm := protojson.UnmarshalOptions{AllowPartial: true, DiscardUnknown: true} |
| resp := &adminpb.CalculatedMetric{} |
| 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 |
| |
| httpRsp, err := c.httpClient.Do(httpReq) |
| if err != nil { |
| return err |
| } |
| defer httpRsp.Body.Close() |
| |
| if err = googleapi.CheckResponse(httpRsp); err != nil { |
| return err |
| } |
| |
| buf, err := io.ReadAll(httpRsp.Body) |
| 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 |
| } |
| |
| // DeleteCalculatedMetric deletes a CalculatedMetric on a property. |
| func (c *analyticsAdminRESTClient) DeleteCalculatedMetric(ctx context.Context, req *adminpb.DeleteCalculatedMetricRequest, opts ...gax.CallOption) error { |
| baseUrl, err := url.Parse(c.endpoint) |
| if err != nil { |
| return err |
| } |
| baseUrl.Path += fmt.Sprintf("/v1alpha/%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 |
| |
| httpRsp, err := c.httpClient.Do(httpReq) |
| if err != nil { |
| return err |
| } |
| defer httpRsp.Body.Close() |
| |
| // Returns nil if there is no error, otherwise wraps |
| // the response code and body into a non-nil error |
| return googleapi.CheckResponse(httpRsp) |
| }, opts...) |
| } |
| |
| // CreateRollupProperty create a roll-up property and all roll-up property source links. |
| func (c *analyticsAdminRESTClient) CreateRollupProperty(ctx context.Context, req *adminpb.CreateRollupPropertyRequest, opts ...gax.CallOption) (*adminpb.CreateRollupPropertyResponse, 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("/v1alpha/properties:createRollupProperty") |
| |
| params := url.Values{} |
| params.Add("$alt", "json;enum-encoding=int") |
| |
| 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...) |
| opts = append((*c.CallOptions).CreateRollupProperty[0:len((*c.CallOptions).CreateRollupProperty):len((*c.CallOptions).CreateRollupProperty)], opts...) |
| unm := protojson.UnmarshalOptions{AllowPartial: true, DiscardUnknown: true} |
| resp := &adminpb.CreateRollupPropertyResponse{} |
| 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 |
| |
| httpRsp, err := c.httpClient.Do(httpReq) |
| if err != nil { |
| return err |
| } |
| defer httpRsp.Body.Close() |
| |
| if err = googleapi.CheckResponse(httpRsp); err != nil { |
| return err |
| } |
| |
| buf, err := io.ReadAll(httpRsp.Body) |
| 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 |
| } |
| |
| // GetRollupPropertySourceLink lookup for a single roll-up property source Link. |
| // Only roll-up properties can have source links, so this method will throw an |
| // error if used on other types of properties. |
| func (c *analyticsAdminRESTClient) GetRollupPropertySourceLink(ctx context.Context, req *adminpb.GetRollupPropertySourceLinkRequest, opts ...gax.CallOption) (*adminpb.RollupPropertySourceLink, error) { |
| baseUrl, err := url.Parse(c.endpoint) |
| if err != nil { |
| return nil, err |
| } |
| baseUrl.Path += fmt.Sprintf("/v1alpha/%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).GetRollupPropertySourceLink[0:len((*c.CallOptions).GetRollupPropertySourceLink):len((*c.CallOptions).GetRollupPropertySourceLink)], opts...) |
| unm := protojson.UnmarshalOptions{AllowPartial: true, DiscardUnknown: true} |
| resp := &adminpb.RollupPropertySourceLink{} |
| 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 |
| |
| httpRsp, err := c.httpClient.Do(httpReq) |
| if err != nil { |
| return err |
| } |
| defer httpRsp.Body.Close() |
| |
| if err = googleapi.CheckResponse(httpRsp); err != nil { |
| return err |
| } |
| |
| buf, err := io.ReadAll(httpRsp.Body) |
| 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 |
| } |
| |
| // ListRollupPropertySourceLinks lists roll-up property source Links on a property. |
| // Only roll-up properties can have source links, so this method will throw an |
| // error if used on other types of properties. |
| func (c *analyticsAdminRESTClient) ListRollupPropertySourceLinks(ctx context.Context, req *adminpb.ListRollupPropertySourceLinksRequest, opts ...gax.CallOption) *RollupPropertySourceLinkIterator { |
| it := &RollupPropertySourceLinkIterator{} |
| req = proto.Clone(req).(*adminpb.ListRollupPropertySourceLinksRequest) |
| unm := protojson.UnmarshalOptions{AllowPartial: true, DiscardUnknown: true} |
| it.InternalFetch = func(pageSize int, pageToken string) ([]*adminpb.RollupPropertySourceLink, string, error) { |
| resp := &adminpb.ListRollupPropertySourceLinksResponse{} |
| 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("/v1alpha/%v/rollupPropertySourceLinks", 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 |
| |
| httpRsp, err := c.httpClient.Do(httpReq) |
| if err != nil { |
| return err |
| } |
| defer httpRsp.Body.Close() |
| |
| if err = googleapi.CheckResponse(httpRsp); err != nil { |
| return err |
| } |
| |
| buf, err := io.ReadAll(httpRsp.Body) |
| 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.GetRollupPropertySourceLinks(), 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 |
| } |
| |
| // CreateRollupPropertySourceLink creates a roll-up property source link. |
| // Only roll-up properties can have source links, so this method will throw an |
| // error if used on other types of properties. |
| func (c *analyticsAdminRESTClient) CreateRollupPropertySourceLink(ctx context.Context, req *adminpb.CreateRollupPropertySourceLinkRequest, opts ...gax.CallOption) (*adminpb.RollupPropertySourceLink, error) { |
| m := protojson.MarshalOptions{AllowPartial: true, UseEnumNumbers: true} |
| body := req.GetRollupPropertySourceLink() |
| 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("/v1alpha/%v/rollupPropertySourceLinks", 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).CreateRollupPropertySourceLink[0:len((*c.CallOptions).CreateRollupPropertySourceLink):len((*c.CallOptions).CreateRollupPropertySourceLink)], opts...) |
| unm := protojson.UnmarshalOptions{AllowPartial: true, DiscardUnknown: true} |
| resp := &adminpb.RollupPropertySourceLink{} |
| 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 |
| |
| httpRsp, err := c.httpClient.Do(httpReq) |
| if err != nil { |
| return err |
| } |
| defer httpRsp.Body.Close() |
| |
| if err = googleapi.CheckResponse(httpRsp); err != nil { |
| return err |
| } |
| |
| buf, err := io.ReadAll(httpRsp.Body) |
| 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 |
| } |
| |
| // DeleteRollupPropertySourceLink deletes a roll-up property source link. |
| // Only roll-up properties can have source links, so this method will throw an |
| // error if used on other types of properties. |
| func (c *analyticsAdminRESTClient) DeleteRollupPropertySourceLink(ctx context.Context, req *adminpb.DeleteRollupPropertySourceLinkRequest, opts ...gax.CallOption) error { |
| baseUrl, err := url.Parse(c.endpoint) |
| if err != nil { |
| return err |
| } |
| baseUrl.Path += fmt.Sprintf("/v1alpha/%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 |
| |
| httpRsp, err := c.httpClient.Do(httpReq) |
| if err != nil { |
| return err |
| } |
| defer httpRsp.Body.Close() |
| |
| // Returns nil if there is no error, otherwise wraps |
| // the response code and body into a non-nil error |
| return googleapi.CheckResponse(httpRsp) |
| }, opts...) |
| } |
| |
| // CreateSubproperty create a subproperty and a subproperty event filter that applies to the |
| // created subproperty. |
| func (c *analyticsAdminRESTClient) CreateSubproperty(ctx context.Context, req *adminpb.CreateSubpropertyRequest, opts ...gax.CallOption) (*adminpb.CreateSubpropertyResponse, 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("/v1alpha/properties:createSubproperty") |
| |
| params := url.Values{} |
| params.Add("$alt", "json;enum-encoding=int") |
| |
| 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...) |
| opts = append((*c.CallOptions).CreateSubproperty[0:len((*c.CallOptions).CreateSubproperty):len((*c.CallOptions).CreateSubproperty)], opts...) |
| unm := protojson.UnmarshalOptions{AllowPartial: true, DiscardUnknown: true} |
| resp := &adminpb.CreateSubpropertyResponse{} |
| 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 |
| |
| httpRsp, err := c.httpClient.Do(httpReq) |
| if err != nil { |
| return err |
| } |
| defer httpRsp.Body.Close() |
| |
| if err = googleapi.CheckResponse(httpRsp); err != nil { |
| return err |
| } |
| |
| buf, err := io.ReadAll(httpRsp.Body) |
| 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 |
| } |
| |
| // CreateSubpropertyEventFilter creates a subproperty Event Filter. |
| func (c *analyticsAdminRESTClient) CreateSubpropertyEventFilter(ctx context.Context, req *adminpb.CreateSubpropertyEventFilterRequest, opts ...gax.CallOption) (*adminpb.SubpropertyEventFilter, error) { |
| m := protojson.MarshalOptions{AllowPartial: true, UseEnumNumbers: true} |
| body := req.GetSubpropertyEventFilter() |
| 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("/v1alpha/%v/subpropertyEventFilters", 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).CreateSubpropertyEventFilter[0:len((*c.CallOptions).CreateSubpropertyEventFilter):len((*c.CallOptions).CreateSubpropertyEventFilter)], opts...) |
| unm := protojson.UnmarshalOptions{AllowPartial: true, DiscardUnknown: true} |
| resp := &adminpb.SubpropertyEventFilter{} |
| 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 |
| |
| httpRsp, err := c.httpClient.Do(httpReq) |
| if err != nil { |
| return err |
| } |
| defer httpRsp.Body.Close() |
| |
| if err = googleapi.CheckResponse(httpRsp); err != nil { |
| return err |
| } |
| |
| buf, err := io.ReadAll(httpRsp.Body) |
| 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 |
| } |
| |
| // GetSubpropertyEventFilter lookup for a single subproperty Event Filter. |
| func (c *analyticsAdminRESTClient) GetSubpropertyEventFilter(ctx context.Context, req *adminpb.GetSubpropertyEventFilterRequest, opts ...gax.CallOption) (*adminpb.SubpropertyEventFilter, error) { |
| baseUrl, err := url.Parse(c.endpoint) |
| if err != nil { |
| return nil, err |
| } |
| baseUrl.Path += fmt.Sprintf("/v1alpha/%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).GetSubpropertyEventFilter[0:len((*c.CallOptions).GetSubpropertyEventFilter):len((*c.CallOptions).GetSubpropertyEventFilter)], opts...) |
| unm := protojson.UnmarshalOptions{AllowPartial: true, DiscardUnknown: true} |
| resp := &adminpb.SubpropertyEventFilter{} |
| 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 |
| |
| httpRsp, err := c.httpClient.Do(httpReq) |
| if err != nil { |
| return err |
| } |
| defer httpRsp.Body.Close() |
| |
| if err = googleapi.CheckResponse(httpRsp); err != nil { |
| return err |
| } |
| |
| buf, err := io.ReadAll(httpRsp.Body) |
| 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 |
| } |
| |
| // ListSubpropertyEventFilters list all subproperty Event Filters on a property. |
| func (c *analyticsAdminRESTClient) ListSubpropertyEventFilters(ctx context.Context, req *adminpb.ListSubpropertyEventFiltersRequest, opts ...gax.CallOption) *SubpropertyEventFilterIterator { |
| it := &SubpropertyEventFilterIterator{} |
| req = proto.Clone(req).(*adminpb.ListSubpropertyEventFiltersRequest) |
| unm := protojson.UnmarshalOptions{AllowPartial: true, DiscardUnknown: true} |
| it.InternalFetch = func(pageSize int, pageToken string) ([]*adminpb.SubpropertyEventFilter, string, error) { |
| resp := &adminpb.ListSubpropertyEventFiltersResponse{} |
| 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("/v1alpha/%v/subpropertyEventFilters", 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 |
| |
| httpRsp, err := c.httpClient.Do(httpReq) |
| if err != nil { |
| return err |
| } |
| defer httpRsp.Body.Close() |
| |
| if err = googleapi.CheckResponse(httpRsp); err != nil { |
| return err |
| } |
| |
| buf, err := io.ReadAll(httpRsp.Body) |
| 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.GetSubpropertyEventFilters(), 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 |
| } |
| |
| // UpdateSubpropertyEventFilter updates a subproperty Event Filter. |
| func (c *analyticsAdminRESTClient) UpdateSubpropertyEventFilter(ctx context.Context, req *adminpb.UpdateSubpropertyEventFilterRequest, opts ...gax.CallOption) (*adminpb.SubpropertyEventFilter, error) { |
| m := protojson.MarshalOptions{AllowPartial: true, UseEnumNumbers: true} |
| body := req.GetSubpropertyEventFilter() |
| 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("/v1alpha/%v", req.GetSubpropertyEventFilter().GetName()) |
| |
| params := url.Values{} |
| params.Add("$alt", "json;enum-encoding=int") |
| if req.GetUpdateMask() != nil { |
| updateMask, err := protojson.Marshal(req.GetUpdateMask()) |
| if err != nil { |
| return nil, err |
| } |
| params.Add("updateMask", string(updateMask[1:len(updateMask)-1])) |
| } |
| |
| baseUrl.RawQuery = params.Encode() |
| |
| // Build HTTP headers from client and context metadata. |
| hds := []string{"x-goog-request-params", fmt.Sprintf("%s=%v", "subproperty_event_filter.name", url.QueryEscape(req.GetSubpropertyEventFilter().GetName()))} |
| |
| hds = append(c.xGoogHeaders, hds...) |
| hds = append(hds, "Content-Type", "application/json") |
| headers := gax.BuildHeaders(ctx, hds...) |
| opts = append((*c.CallOptions).UpdateSubpropertyEventFilter[0:len((*c.CallOptions).UpdateSubpropertyEventFilter):len((*c.CallOptions).UpdateSubpropertyEventFilter)], opts...) |
| unm := protojson.UnmarshalOptions{AllowPartial: true, DiscardUnknown: true} |
| resp := &adminpb.SubpropertyEventFilter{} |
| 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 |
| |
| httpRsp, err := c.httpClient.Do(httpReq) |
| if err != nil { |
| return err |
| } |
| defer httpRsp.Body.Close() |
| |
| if err = googleapi.CheckResponse(httpRsp); err != nil { |
| return err |
| } |
| |
| buf, err := io.ReadAll(httpRsp.Body) |
| 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 |
| } |
| |
| // DeleteSubpropertyEventFilter deletes a subproperty event filter. |
| func (c *analyticsAdminRESTClient) DeleteSubpropertyEventFilter(ctx context.Context, req *adminpb.DeleteSubpropertyEventFilterRequest, opts ...gax.CallOption) error { |
| baseUrl, err := url.Parse(c.endpoint) |
| if err != nil { |
| return err |
| } |
| baseUrl.Path += fmt.Sprintf("/v1alpha/%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 |
| |
| httpRsp, err := c.httpClient.Do(httpReq) |
| if err != nil { |
| return err |
| } |
| defer httpRsp.Body.Close() |
| |
| // Returns nil if there is no error, otherwise wraps |
| // the response code and body into a non-nil error |
| return googleapi.CheckResponse(httpRsp) |
| }, opts...) |
| } |