From 83d8e8dde9d8601db20096fb869b50c7abf1ba7e Mon Sep 17 00:00:00 2001 From: Yoshi Automation Bot Date: Mon, 8 Aug 2022 07:53:15 -0700 Subject: [PATCH] chore(all): auto-regenerate gapics (#6482) This is an auto-generated regeneration of the gapic clients by cloud.google.com/go/internal/gapicgen. Once the corresponding genproto PR is submitted, genbot will update this PR with a newer dependency to the newer version of genproto and assign reviewers to this PR. If you have been assigned to review this PR, please: - Ensure that the version of genproto in go.mod has been updated. - Ensure that CI is passing. If it's failing, it requires your manual attention. - Approve and submit this PR if you believe it's ready to ship. Corresponding genproto PR: https://github.com/googleapis/go-genproto/pull/874 Changes: feat(monitoring/apiv3): Added support for evaluating missing data in AlertPolicy PiperOrigin-RevId: 465650583 Source-Link: https://github.com/googleapis/googleapis/commit/9f7c0ffdaa8ceb2f27982bad713a03306157a4d2 feat(analytics/admin): add `RunAccessReport` method to the Admin API v1alpha PiperOrigin-RevId: 465589484 Source-Link: https://github.com/googleapis/googleapis/commit/80bf61314ccea09709feb8e2e681da956cd0ba95 feat(analytics/admin): add `GetAudience`, 'ListAudience', 'CreateAudience', 'UpdateAudience', 'ArchiveAudience' methods to the Admin API v1alpha feat: add `GetAttributionSettings`, `UpdateAttributionSettings` methods to the Admin API v1alpha PiperOrigin-RevId: 465469599 Source-Link: https://github.com/googleapis/googleapis/commit/2f00b9a0691e88fcb466976a86ba79cd04313100 --- .../apiv1alpha/analytics_admin_client.go | 1173 +++++++++++++++-- .../analytics_admin_client_example_test.go | 164 +++ .../admin/apiv1alpha/gapic_metadata.json | 80 ++ analytics/go.mod | 4 +- analytics/go.sum | 8 +- go.mod | 2 +- go.sum | 4 +- .../ArchiveAudience/main.go | 46 + .../CreateAudience/main.go | 48 + .../GetAttributionSettings/main.go | 48 + .../AnalyticsAdminClient/GetAudience/main.go | 48 + .../ListAudiences/main.go | 55 + .../RunAccessReport/main.go | 48 + .../UpdateAttributionSettings/main.go | 48 + .../UpdateAudience/main.go | 48 + ...tadata.google.analytics.admin.v1alpha.json | 367 ++++++ internal/generated/snippets/go.mod | 2 +- internal/generated/snippets/go.sum | 4 +- internal/godocfx/go.mod | 2 +- internal/godocfx/go.sum | 4 +- monitoring/apiv3/v2/alert_policy_client.go | 12 +- monitoring/go.mod | 10 +- monitoring/go.sum | 20 +- 23 files changed, 2123 insertions(+), 122 deletions(-) create mode 100644 internal/generated/snippets/analytics/admin/apiv1alpha/AnalyticsAdminClient/ArchiveAudience/main.go create mode 100644 internal/generated/snippets/analytics/admin/apiv1alpha/AnalyticsAdminClient/CreateAudience/main.go create mode 100644 internal/generated/snippets/analytics/admin/apiv1alpha/AnalyticsAdminClient/GetAttributionSettings/main.go create mode 100644 internal/generated/snippets/analytics/admin/apiv1alpha/AnalyticsAdminClient/GetAudience/main.go create mode 100644 internal/generated/snippets/analytics/admin/apiv1alpha/AnalyticsAdminClient/ListAudiences/main.go create mode 100644 internal/generated/snippets/analytics/admin/apiv1alpha/AnalyticsAdminClient/RunAccessReport/main.go create mode 100644 internal/generated/snippets/analytics/admin/apiv1alpha/AnalyticsAdminClient/UpdateAttributionSettings/main.go create mode 100644 internal/generated/snippets/analytics/admin/apiv1alpha/AnalyticsAdminClient/UpdateAudience/main.go diff --git a/analytics/admin/apiv1alpha/analytics_admin_client.go b/analytics/admin/apiv1alpha/analytics_admin_client.go index ee5f6e8d12b..c0a0f8a1942 100644 --- a/analytics/admin/apiv1alpha/analytics_admin_client.go +++ b/analytics/admin/apiv1alpha/analytics_admin_client.go @@ -116,6 +116,14 @@ type AnalyticsAdminCallOptions struct { UpdateDataStream []gax.CallOption ListDataStreams []gax.CallOption GetDataStream []gax.CallOption + GetAudience []gax.CallOption + ListAudiences []gax.CallOption + CreateAudience []gax.CallOption + UpdateAudience []gax.CallOption + ArchiveAudience []gax.CallOption + GetAttributionSettings []gax.CallOption + UpdateAttributionSettings []gax.CallOption + RunAccessReport []gax.CallOption } func defaultAnalyticsAdminGRPCClientOptions() []option.ClientOption { @@ -984,6 +992,102 @@ func defaultAnalyticsAdminCallOptions() *AnalyticsAdminCallOptions { }) }), }, + GetAudience: []gax.CallOption{ + 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.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.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.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.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.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.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.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, + }) + }), + }, } } @@ -1770,6 +1874,94 @@ func defaultAnalyticsAdminRESTCallOptions() *AnalyticsAdminCallOptions { http.StatusInternalServerError) }), }, + GetAudience: []gax.CallOption{ + 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.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.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.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.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.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.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.WithRetry(func() gax.Retryer { + return gax.OnHTTPCodes(gax.Backoff{ + Initial: 1000 * time.Millisecond, + Max: 60000 * time.Millisecond, + Multiplier: 1.30, + }, + http.StatusServiceUnavailable, + http.StatusInternalServerError) + }), + }, } } @@ -1849,6 +2041,14 @@ type internalAnalyticsAdminClient interface { 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 + 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) } // AnalyticsAdminClient is a client for interacting with Google Analytics Admin API. @@ -2309,6 +2509,60 @@ func (c *AnalyticsAdminClient) GetDataStream(ctx context.Context, req *adminpb.G return c.internalClient.GetDataStream(ctx, req, opts...) } +// GetAudience lookup for a single Audience. +// Audiences created before 2020 may not be supported. +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. +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...) +} + +// 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. The property must be +// in Google Analytics 360. 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...) +} + // 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. @@ -4306,70 +4560,37 @@ func (c *analyticsAdminGRPCClient) GetDataStream(ctx context.Context, req *admin return resp, nil } -// 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 +func (c *analyticsAdminGRPCClient) GetAudience(ctx context.Context, req *adminpb.GetAudienceRequest, opts ...gax.CallOption) (*adminpb.Audience, error) { + if _, ok := ctx.Deadline(); !ok && !c.disableDeadlines { + cctx, cancel := context.WithTimeout(ctx, 60000*time.Millisecond) + defer cancel() + ctx = cctx } - baseUrl.Path += fmt.Sprintf("/v1alpha/%v", req.GetName()) - - // Build HTTP headers from client and context metadata. md := metadata.Pairs("x-goog-request-params", fmt.Sprintf("%s=%v", "name", url.QueryEscape(req.GetName()))) - headers := buildHeaders(ctx, c.xGoogMetadata, md, metadata.Pairs("Content-Type", "application/json")) - 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 := ioutil.ReadAll(httpRsp.Body) - if err != nil { - return err - } - - if err := unm.Unmarshal(buf, resp); err != nil { - return maybeUnknownEnum(err) - } - - return nil + ctx = insertMetadata(ctx, c.xGoogMetadata, md) + 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 e != nil { - return nil, e + if err != nil { + return nil, err } 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{} +func (c *analyticsAdminGRPCClient) ListAudiences(ctx context.Context, req *adminpb.ListAudiencesRequest, opts ...gax.CallOption) *AudienceIterator { + md := metadata.Pairs("x-goog-request-params", fmt.Sprintf("%s=%v", "parent", url.QueryEscape(req.GetParent()))) + + ctx = insertMetadata(ctx, c.xGoogMetadata, md) + 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 } @@ -4378,7 +4599,235 @@ func (c *analyticsAdminRESTClient) ListAccounts(ctx context.Context, req *adminp } else if pageSize != 0 { req.PageSize = int32(pageSize) } - baseUrl, err := url.Parse(c.endpoint) + 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) { + if _, ok := ctx.Deadline(); !ok && !c.disableDeadlines { + cctx, cancel := context.WithTimeout(ctx, 60000*time.Millisecond) + defer cancel() + ctx = cctx + } + md := metadata.Pairs("x-goog-request-params", fmt.Sprintf("%s=%v", "parent", url.QueryEscape(req.GetParent()))) + + ctx = insertMetadata(ctx, c.xGoogMetadata, md) + 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) { + if _, ok := ctx.Deadline(); !ok && !c.disableDeadlines { + cctx, cancel := context.WithTimeout(ctx, 60000*time.Millisecond) + defer cancel() + ctx = cctx + } + md := metadata.Pairs("x-goog-request-params", fmt.Sprintf("%s=%v", "audience.name", url.QueryEscape(req.GetAudience().GetName()))) + + ctx = insertMetadata(ctx, c.xGoogMetadata, md) + 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 { + if _, ok := ctx.Deadline(); !ok && !c.disableDeadlines { + cctx, cancel := context.WithTimeout(ctx, 60000*time.Millisecond) + defer cancel() + ctx = cctx + } + md := metadata.Pairs("x-goog-request-params", fmt.Sprintf("%s=%v", "name", url.QueryEscape(req.GetName()))) + + ctx = insertMetadata(ctx, c.xGoogMetadata, md) + 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) GetAttributionSettings(ctx context.Context, req *adminpb.GetAttributionSettingsRequest, opts ...gax.CallOption) (*adminpb.AttributionSettings, error) { + if _, ok := ctx.Deadline(); !ok && !c.disableDeadlines { + cctx, cancel := context.WithTimeout(ctx, 60000*time.Millisecond) + defer cancel() + ctx = cctx + } + md := metadata.Pairs("x-goog-request-params", fmt.Sprintf("%s=%v", "name", url.QueryEscape(req.GetName()))) + + ctx = insertMetadata(ctx, c.xGoogMetadata, md) + 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) { + if _, ok := ctx.Deadline(); !ok && !c.disableDeadlines { + cctx, cancel := context.WithTimeout(ctx, 60000*time.Millisecond) + defer cancel() + ctx = cctx + } + md := metadata.Pairs("x-goog-request-params", fmt.Sprintf("%s=%v", "attribution_settings.name", url.QueryEscape(req.GetAttributionSettings().GetName()))) + + ctx = insertMetadata(ctx, c.xGoogMetadata, md) + 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) { + if _, ok := ctx.Deadline(); !ok && !c.disableDeadlines { + cctx, cancel := context.WithTimeout(ctx, 60000*time.Millisecond) + defer cancel() + ctx = cctx + } + md := metadata.Pairs("x-goog-request-params", fmt.Sprintf("%s=%v", "entity", url.QueryEscape(req.GetEntity()))) + + ctx = insertMetadata(ctx, c.xGoogMetadata, md) + 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 +} + +// 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()) + + // Build HTTP headers from client and context metadata. + md := metadata.Pairs("x-goog-request-params", fmt.Sprintf("%s=%v", "name", url.QueryEscape(req.GetName()))) + + headers := buildHeaders(ctx, c.xGoogMetadata, md, metadata.Pairs("Content-Type", "application/json")) + 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 := ioutil.ReadAll(httpRsp.Body) + if err != nil { + return err + } + + if err := unm.Unmarshal(buf, resp); err != nil { + return maybeUnknownEnum(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 } @@ -8719,41 +9168,542 @@ func (c *analyticsAdminRESTClient) GetDataStream(ctx context.Context, req *admin return resp, nil } -// AccountIterator manages a stream of *adminpb.Account. -type AccountIterator struct { - items []*adminpb.Account - pageInfo *iterator.PageInfo - nextFunc func() error +// GetAudience lookup for a single Audience. +// Audiences created before 2020 may not be supported. +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()) - // Response is the raw response for the current page. - // It must be cast to the RPC response type. - // Calling Next() or InternalFetch() updates this value. - Response interface{} + // Build HTTP headers from client and context metadata. + md := metadata.Pairs("x-goog-request-params", fmt.Sprintf("%s=%v", "name", url.QueryEscape(req.GetName()))) - // InternalFetch is for use by the Google Cloud Libraries only. - // It is not part of the stable interface of this package. - // - // InternalFetch returns results from a single call to the underlying RPC. - // The number of results is no greater than pageSize. - // If there are no more results, nextPageToken is empty and err is nil. - InternalFetch func(pageSize int, pageToken string) (results []*adminpb.Account, nextPageToken string, err error) -} + headers := buildHeaders(ctx, c.xGoogMetadata, md, metadata.Pairs("Content-Type", "application/json")) + 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 -// PageInfo supports pagination. See the google.golang.org/api/iterator package for details. -func (it *AccountIterator) PageInfo() *iterator.PageInfo { - return it.pageInfo -} + httpRsp, err := c.httpClient.Do(httpReq) + if err != nil { + return err + } + defer httpRsp.Body.Close() -// Next returns the next result. Its second return value is iterator.Done if there are no more -// results. Once Next returns Done, all subsequent calls will return Done. -func (it *AccountIterator) Next() (*adminpb.Account, error) { - var item *adminpb.Account - if err := it.nextFunc(); err != nil { - return item, err - } - item = it.items[0] - it.items = it.items[1:] - return item, nil + if err = googleapi.CheckResponse(httpRsp); err != nil { + return err + } + + buf, err := ioutil.ReadAll(httpRsp.Body) + if err != nil { + return err + } + + if err := unm.Unmarshal(buf, resp); err != nil { + return maybeUnknownEnum(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. +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{} + 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. + headers := buildHeaders(ctx, c.xGoogMetadata, metadata.Pairs("Content-Type", "application/json")) + 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 := ioutil.ReadAll(httpRsp.Body) + if err != nil { + return err + } + + if err := unm.Unmarshal(buf, resp); err != nil { + return maybeUnknownEnum(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()) + + // Build HTTP headers from client and context metadata. + md := metadata.Pairs("x-goog-request-params", fmt.Sprintf("%s=%v", "parent", url.QueryEscape(req.GetParent()))) + + headers := buildHeaders(ctx, c.xGoogMetadata, md, metadata.Pairs("Content-Type", "application/json")) + 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 := ioutil.ReadAll(httpRsp.Body) + if err != nil { + return err + } + + if err := unm.Unmarshal(buf, resp); err != nil { + return maybeUnknownEnum(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{} + if req.GetUpdateMask().GetPaths() != nil { + params.Add("updateMask.paths", fmt.Sprintf("%v", req.GetUpdateMask().GetPaths())) + } + + baseUrl.RawQuery = params.Encode() + + // Build HTTP headers from client and context metadata. + md := metadata.Pairs("x-goog-request-params", fmt.Sprintf("%s=%v", "audience.name", url.QueryEscape(req.GetAudience().GetName()))) + + headers := buildHeaders(ctx, c.xGoogMetadata, md, metadata.Pairs("Content-Type", "application/json")) + 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 := ioutil.ReadAll(httpRsp.Body) + if err != nil { + return err + } + + if err := unm.Unmarshal(buf, resp); err != nil { + return maybeUnknownEnum(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()) + + // Build HTTP headers from client and context metadata. + md := metadata.Pairs("x-goog-request-params", fmt.Sprintf("%s=%v", "name", url.QueryEscape(req.GetName()))) + + headers := buildHeaders(ctx, c.xGoogMetadata, md, metadata.Pairs("Content-Type", "application/json")) + 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...) +} + +// 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()) + + // Build HTTP headers from client and context metadata. + md := metadata.Pairs("x-goog-request-params", fmt.Sprintf("%s=%v", "name", url.QueryEscape(req.GetName()))) + + headers := buildHeaders(ctx, c.xGoogMetadata, md, metadata.Pairs("Content-Type", "application/json")) + 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 := ioutil.ReadAll(httpRsp.Body) + if err != nil { + return err + } + + if err := unm.Unmarshal(buf, resp); err != nil { + return maybeUnknownEnum(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{} + if req.GetUpdateMask().GetPaths() != nil { + params.Add("updateMask.paths", fmt.Sprintf("%v", req.GetUpdateMask().GetPaths())) + } + + baseUrl.RawQuery = params.Encode() + + // Build HTTP headers from client and context metadata. + md := metadata.Pairs("x-goog-request-params", fmt.Sprintf("%s=%v", "attribution_settings.name", url.QueryEscape(req.GetAttributionSettings().GetName()))) + + headers := buildHeaders(ctx, c.xGoogMetadata, md, metadata.Pairs("Content-Type", "application/json")) + 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 := ioutil.ReadAll(httpRsp.Body) + if err != nil { + return err + } + + if err := unm.Unmarshal(buf, resp); err != nil { + return maybeUnknownEnum(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. The property must be +// in Google Analytics 360. 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()) + + // Build HTTP headers from client and context metadata. + md := metadata.Pairs("x-goog-request-params", fmt.Sprintf("%s=%v", "entity", url.QueryEscape(req.GetEntity()))) + + headers := buildHeaders(ctx, c.xGoogMetadata, md, metadata.Pairs("Content-Type", "application/json")) + 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 := ioutil.ReadAll(httpRsp.Body) + if err != nil { + return err + } + + if err := unm.Unmarshal(buf, resp); err != nil { + return maybeUnknownEnum(err) + } + + return nil + }, opts...) + if e != nil { + return nil, e + } + return resp, nil +} + +// AccountIterator manages a stream of *adminpb.Account. +type AccountIterator struct { + items []*adminpb.Account + pageInfo *iterator.PageInfo + nextFunc func() error + + // Response is the raw response for the current page. + // It must be cast to the RPC response type. + // Calling Next() or InternalFetch() updates this value. + Response interface{} + + // InternalFetch is for use by the Google Cloud Libraries only. + // It is not part of the stable interface of this package. + // + // InternalFetch returns results from a single call to the underlying RPC. + // The number of results is no greater than pageSize. + // If there are no more results, nextPageToken is empty and err is nil. + InternalFetch func(pageSize int, pageToken string) (results []*adminpb.Account, nextPageToken string, err error) +} + +// PageInfo supports pagination. See the google.golang.org/api/iterator package for details. +func (it *AccountIterator) PageInfo() *iterator.PageInfo { + return it.pageInfo +} + +// Next returns the next result. Its second return value is iterator.Done if there are no more +// results. Once Next returns Done, all subsequent calls will return Done. +func (it *AccountIterator) Next() (*adminpb.Account, error) { + var item *adminpb.Account + if err := it.nextFunc(); err != nil { + return item, err + } + item = it.items[0] + it.items = it.items[1:] + return item, nil } func (it *AccountIterator) bufLen() int { @@ -8813,6 +9763,53 @@ func (it *AccountSummaryIterator) takeBuf() interface{} { return b } +// AudienceIterator manages a stream of *adminpb.Audience. +type AudienceIterator struct { + items []*adminpb.Audience + pageInfo *iterator.PageInfo + nextFunc func() error + + // Response is the raw response for the current page. + // It must be cast to the RPC response type. + // Calling Next() or InternalFetch() updates this value. + Response interface{} + + // InternalFetch is for use by the Google Cloud Libraries only. + // It is not part of the stable interface of this package. + // + // InternalFetch returns results from a single call to the underlying RPC. + // The number of results is no greater than pageSize. + // If there are no more results, nextPageToken is empty and err is nil. + InternalFetch func(pageSize int, pageToken string) (results []*adminpb.Audience, nextPageToken string, err error) +} + +// PageInfo supports pagination. See the google.golang.org/api/iterator package for details. +func (it *AudienceIterator) PageInfo() *iterator.PageInfo { + return it.pageInfo +} + +// Next returns the next result. Its second return value is iterator.Done if there are no more +// results. Once Next returns Done, all subsequent calls will return Done. +func (it *AudienceIterator) Next() (*adminpb.Audience, error) { + var item *adminpb.Audience + if err := it.nextFunc(); err != nil { + return item, err + } + item = it.items[0] + it.items = it.items[1:] + return item, nil +} + +func (it *AudienceIterator) bufLen() int { + return len(it.items) +} + +func (it *AudienceIterator) takeBuf() interface{} { + b := it.items + it.items = nil + return b +} + // AuditUserLinkIterator manages a stream of *adminpb.AuditUserLink. type AuditUserLinkIterator struct { items []*adminpb.AuditUserLink diff --git a/analytics/admin/apiv1alpha/analytics_admin_client_example_test.go b/analytics/admin/apiv1alpha/analytics_admin_client_example_test.go index c5183221f6c..5d093c00346 100644 --- a/analytics/admin/apiv1alpha/analytics_admin_client_example_test.go +++ b/analytics/admin/apiv1alpha/analytics_admin_client_example_test.go @@ -1533,3 +1533,167 @@ func ExampleAnalyticsAdminClient_GetDataStream() { // TODO: Use resp. _ = resp } + +func ExampleAnalyticsAdminClient_GetAudience() { + ctx := context.Background() + c, err := admin.NewAnalyticsAdminClient(ctx) + if err != nil { + // TODO: Handle error. + } + defer c.Close() + + req := &adminpb.GetAudienceRequest{ + // TODO: Fill request struct fields. + // See https://pkg.go.dev/google.golang.org/genproto/googleapis/analytics/admin/v1alpha#GetAudienceRequest. + } + resp, err := c.GetAudience(ctx, req) + if err != nil { + // TODO: Handle error. + } + // TODO: Use resp. + _ = resp +} + +func ExampleAnalyticsAdminClient_ListAudiences() { + ctx := context.Background() + c, err := admin.NewAnalyticsAdminClient(ctx) + if err != nil { + // TODO: Handle error. + } + defer c.Close() + + req := &adminpb.ListAudiencesRequest{ + // TODO: Fill request struct fields. + // See https://pkg.go.dev/google.golang.org/genproto/googleapis/analytics/admin/v1alpha#ListAudiencesRequest. + } + it := c.ListAudiences(ctx, req) + for { + resp, err := it.Next() + if err == iterator.Done { + break + } + if err != nil { + // TODO: Handle error. + } + // TODO: Use resp. + _ = resp + } +} + +func ExampleAnalyticsAdminClient_CreateAudience() { + ctx := context.Background() + c, err := admin.NewAnalyticsAdminClient(ctx) + if err != nil { + // TODO: Handle error. + } + defer c.Close() + + req := &adminpb.CreateAudienceRequest{ + // TODO: Fill request struct fields. + // See https://pkg.go.dev/google.golang.org/genproto/googleapis/analytics/admin/v1alpha#CreateAudienceRequest. + } + resp, err := c.CreateAudience(ctx, req) + if err != nil { + // TODO: Handle error. + } + // TODO: Use resp. + _ = resp +} + +func ExampleAnalyticsAdminClient_UpdateAudience() { + ctx := context.Background() + c, err := admin.NewAnalyticsAdminClient(ctx) + if err != nil { + // TODO: Handle error. + } + defer c.Close() + + req := &adminpb.UpdateAudienceRequest{ + // TODO: Fill request struct fields. + // See https://pkg.go.dev/google.golang.org/genproto/googleapis/analytics/admin/v1alpha#UpdateAudienceRequest. + } + resp, err := c.UpdateAudience(ctx, req) + if err != nil { + // TODO: Handle error. + } + // TODO: Use resp. + _ = resp +} + +func ExampleAnalyticsAdminClient_ArchiveAudience() { + ctx := context.Background() + c, err := admin.NewAnalyticsAdminClient(ctx) + if err != nil { + // TODO: Handle error. + } + defer c.Close() + + req := &adminpb.ArchiveAudienceRequest{ + // TODO: Fill request struct fields. + // See https://pkg.go.dev/google.golang.org/genproto/googleapis/analytics/admin/v1alpha#ArchiveAudienceRequest. + } + err = c.ArchiveAudience(ctx, req) + if err != nil { + // TODO: Handle error. + } +} + +func ExampleAnalyticsAdminClient_GetAttributionSettings() { + ctx := context.Background() + c, err := admin.NewAnalyticsAdminClient(ctx) + if err != nil { + // TODO: Handle error. + } + defer c.Close() + + req := &adminpb.GetAttributionSettingsRequest{ + // TODO: Fill request struct fields. + // See https://pkg.go.dev/google.golang.org/genproto/googleapis/analytics/admin/v1alpha#GetAttributionSettingsRequest. + } + resp, err := c.GetAttributionSettings(ctx, req) + if err != nil { + // TODO: Handle error. + } + // TODO: Use resp. + _ = resp +} + +func ExampleAnalyticsAdminClient_UpdateAttributionSettings() { + ctx := context.Background() + c, err := admin.NewAnalyticsAdminClient(ctx) + if err != nil { + // TODO: Handle error. + } + defer c.Close() + + req := &adminpb.UpdateAttributionSettingsRequest{ + // TODO: Fill request struct fields. + // See https://pkg.go.dev/google.golang.org/genproto/googleapis/analytics/admin/v1alpha#UpdateAttributionSettingsRequest. + } + resp, err := c.UpdateAttributionSettings(ctx, req) + if err != nil { + // TODO: Handle error. + } + // TODO: Use resp. + _ = resp +} + +func ExampleAnalyticsAdminClient_RunAccessReport() { + ctx := context.Background() + c, err := admin.NewAnalyticsAdminClient(ctx) + if err != nil { + // TODO: Handle error. + } + defer c.Close() + + req := &adminpb.RunAccessReportRequest{ + // TODO: Fill request struct fields. + // See https://pkg.go.dev/google.golang.org/genproto/googleapis/analytics/admin/v1alpha#RunAccessReportRequest. + } + resp, err := c.RunAccessReport(ctx, req) + if err != nil { + // TODO: Handle error. + } + // TODO: Use resp. + _ = resp +} diff --git a/analytics/admin/apiv1alpha/gapic_metadata.json b/analytics/admin/apiv1alpha/gapic_metadata.json index 2d48d9f6a98..610a0f2de8e 100644 --- a/analytics/admin/apiv1alpha/gapic_metadata.json +++ b/analytics/admin/apiv1alpha/gapic_metadata.json @@ -20,6 +20,11 @@ "ApproveDisplayVideo360AdvertiserLinkProposal" ] }, + "ArchiveAudience": { + "methods": [ + "ArchiveAudience" + ] + }, "ArchiveCustomDimension": { "methods": [ "ArchiveCustomDimension" @@ -60,6 +65,11 @@ "CancelDisplayVideo360AdvertiserLinkProposal" ] }, + "CreateAudience": { + "methods": [ + "CreateAudience" + ] + }, "CreateConversionEvent": { "methods": [ "CreateConversionEvent" @@ -170,6 +180,16 @@ "GetAccount" ] }, + "GetAttributionSettings": { + "methods": [ + "GetAttributionSettings" + ] + }, + "GetAudience": { + "methods": [ + "GetAudience" + ] + }, "GetConversionEvent": { "methods": [ "GetConversionEvent" @@ -245,6 +265,11 @@ "ListAccounts" ] }, + "ListAudiences": { + "methods": [ + "ListAudiences" + ] + }, "ListConversionEvents": { "methods": [ "ListConversionEvents" @@ -305,6 +330,11 @@ "ProvisionAccountTicket" ] }, + "RunAccessReport": { + "methods": [ + "RunAccessReport" + ] + }, "SearchChangeHistoryEvents": { "methods": [ "SearchChangeHistoryEvents" @@ -315,6 +345,16 @@ "UpdateAccount" ] }, + "UpdateAttributionSettings": { + "methods": [ + "UpdateAttributionSettings" + ] + }, + "UpdateAudience": { + "methods": [ + "UpdateAudience" + ] + }, "UpdateCustomDimension": { "methods": [ "UpdateCustomDimension" @@ -380,6 +420,11 @@ "ApproveDisplayVideo360AdvertiserLinkProposal" ] }, + "ArchiveAudience": { + "methods": [ + "ArchiveAudience" + ] + }, "ArchiveCustomDimension": { "methods": [ "ArchiveCustomDimension" @@ -420,6 +465,11 @@ "CancelDisplayVideo360AdvertiserLinkProposal" ] }, + "CreateAudience": { + "methods": [ + "CreateAudience" + ] + }, "CreateConversionEvent": { "methods": [ "CreateConversionEvent" @@ -530,6 +580,16 @@ "GetAccount" ] }, + "GetAttributionSettings": { + "methods": [ + "GetAttributionSettings" + ] + }, + "GetAudience": { + "methods": [ + "GetAudience" + ] + }, "GetConversionEvent": { "methods": [ "GetConversionEvent" @@ -605,6 +665,11 @@ "ListAccounts" ] }, + "ListAudiences": { + "methods": [ + "ListAudiences" + ] + }, "ListConversionEvents": { "methods": [ "ListConversionEvents" @@ -665,6 +730,11 @@ "ProvisionAccountTicket" ] }, + "RunAccessReport": { + "methods": [ + "RunAccessReport" + ] + }, "SearchChangeHistoryEvents": { "methods": [ "SearchChangeHistoryEvents" @@ -675,6 +745,16 @@ "UpdateAccount" ] }, + "UpdateAttributionSettings": { + "methods": [ + "UpdateAttributionSettings" + ] + }, + "UpdateAudience": { + "methods": [ + "UpdateAudience" + ] + }, "UpdateCustomDimension": { "methods": [ "UpdateCustomDimension" diff --git a/analytics/go.mod b/analytics/go.mod index 55b7b00fa2c..b1811473b72 100644 --- a/analytics/go.mod +++ b/analytics/go.mod @@ -4,8 +4,8 @@ go 1.17 require ( github.com/googleapis/gax-go/v2 v2.4.0 - google.golang.org/api v0.90.0 - google.golang.org/genproto v0.0.0-20220801145646-83ce21fca29f + google.golang.org/api v0.91.0 + google.golang.org/genproto v0.0.0-20220808131553-a91ffa7f803e google.golang.org/grpc v1.48.0 google.golang.org/protobuf v1.28.0 ) diff --git a/analytics/go.sum b/analytics/go.sum index 73927e22c07..84ab2847760 100644 --- a/analytics/go.sum +++ b/analytics/go.sum @@ -498,8 +498,8 @@ google.golang.org/api v0.75.0/go.mod h1:pU9QmyHLnzlpar1Mjt4IbapUCy8J+6HD6GeELN69 google.golang.org/api v0.78.0/go.mod h1:1Sg78yoMLOhlQTeF+ARBoytAcH1NNyyl390YMy6rKmw= google.golang.org/api v0.80.0/go.mod h1:xY3nI94gbvBrE0J6NHXhxOmW97HG7Khjkku6AFB3Hyg= google.golang.org/api v0.84.0/go.mod h1:NTsGnUFJMYROtiquksZHBWtHfeMC7iYthki7Eq3pa8o= -google.golang.org/api v0.90.0 h1:WMnUWAvihIClUYFNeFA69VTuR3duKS3IalMGDQcLvq8= -google.golang.org/api v0.90.0/go.mod h1:+Sem1dnrKlrXMR/X0bPnMWyluQe4RsNoYfmNLhOIkzw= +google.golang.org/api v0.91.0 h1:731+JzuwaJoZXRQGmPoBiV+SrsAfUaIkdMCWTcQNPyA= +google.golang.org/api v0.91.0/go.mod h1:+Sem1dnrKlrXMR/X0bPnMWyluQe4RsNoYfmNLhOIkzw= google.golang.org/appengine v1.1.0/go.mod h1:EbEs0AVv82hx2wNQdGPgUI5lhzA/G0D9YwlJXL52JkM= google.golang.org/appengine v1.4.0/go.mod h1:xpcJRLb0r/rnEns0DIKYYv+WjYCduHsrkT7/EB5XEv4= google.golang.org/appengine v1.5.0/go.mod h1:xpcJRLb0r/rnEns0DIKYYv+WjYCduHsrkT7/EB5XEv4= @@ -587,8 +587,8 @@ google.golang.org/genproto v0.0.0-20220523171625-347a074981d8/go.mod h1:RAyBrSAP google.golang.org/genproto v0.0.0-20220608133413-ed9918b62aac/go.mod h1:KEWEmljWE5zPzLBa/oHl6DaEt9LmfH6WtH1OHIvleBA= google.golang.org/genproto v0.0.0-20220616135557-88e70c0c3a90/go.mod h1:KEWEmljWE5zPzLBa/oHl6DaEt9LmfH6WtH1OHIvleBA= google.golang.org/genproto v0.0.0-20220624142145-8cd45d7dbd1f/go.mod h1:KEWEmljWE5zPzLBa/oHl6DaEt9LmfH6WtH1OHIvleBA= -google.golang.org/genproto v0.0.0-20220801145646-83ce21fca29f h1:XVHpVMvPs4MtH3h6cThzKs2snNexcfd35vQx2T3IuIY= -google.golang.org/genproto v0.0.0-20220801145646-83ce21fca29f/go.mod h1:iHe1svFLAZg9VWz891+QbRMwUv9O/1Ww+/mngYeThbc= +google.golang.org/genproto v0.0.0-20220808131553-a91ffa7f803e h1:yXLYwnRRqNHIwwHZLiA9/aC9uieNrOF0owsijAiZJr8= +google.golang.org/genproto v0.0.0-20220808131553-a91ffa7f803e/go.mod h1:iHe1svFLAZg9VWz891+QbRMwUv9O/1Ww+/mngYeThbc= google.golang.org/grpc v1.19.0/go.mod h1:mqu4LbDTu4XGKhr4mRzUsmM4RtVoemTSY81AxZiDr8c= google.golang.org/grpc v1.20.1/go.mod h1:10oTOabMzJvdu6/UiuZezV6QK5dSlG84ov/aaiqXj38= google.golang.org/grpc v1.21.1/go.mod h1:oYelfM1adQP15Ek0mdvEgi9Df8B9CZIaU1084ijfRaM= diff --git a/go.mod b/go.mod index 4f002c6d9e9..59add580617 100644 --- a/go.mod +++ b/go.mod @@ -13,7 +13,7 @@ require ( golang.org/x/oauth2 v0.0.0-20220622183110-fd043fe589d2 golang.org/x/xerrors v0.0.0-20220609144429-65e65417b02f google.golang.org/api v0.91.0 - google.golang.org/genproto v0.0.0-20220805133916-01dd62135a58 + google.golang.org/genproto v0.0.0-20220808131553-a91ffa7f803e google.golang.org/grpc v1.48.0 google.golang.org/protobuf v1.28.0 ) diff --git a/go.sum b/go.sum index f3a4804b98f..15f44ef3990 100644 --- a/go.sum +++ b/go.sum @@ -600,8 +600,8 @@ google.golang.org/genproto v0.0.0-20220608133413-ed9918b62aac/go.mod h1:KEWEmljW google.golang.org/genproto v0.0.0-20220616135557-88e70c0c3a90/go.mod h1:KEWEmljWE5zPzLBa/oHl6DaEt9LmfH6WtH1OHIvleBA= google.golang.org/genproto v0.0.0-20220617124728-180714bec0ad/go.mod h1:KEWEmljWE5zPzLBa/oHl6DaEt9LmfH6WtH1OHIvleBA= google.golang.org/genproto v0.0.0-20220624142145-8cd45d7dbd1f/go.mod h1:KEWEmljWE5zPzLBa/oHl6DaEt9LmfH6WtH1OHIvleBA= -google.golang.org/genproto v0.0.0-20220805133916-01dd62135a58 h1:sRT5xdTkj1Kbk30qbYC7VyMj73N5pZYsw6v+Nrzdhno= -google.golang.org/genproto v0.0.0-20220805133916-01dd62135a58/go.mod h1:iHe1svFLAZg9VWz891+QbRMwUv9O/1Ww+/mngYeThbc= +google.golang.org/genproto v0.0.0-20220808131553-a91ffa7f803e h1:yXLYwnRRqNHIwwHZLiA9/aC9uieNrOF0owsijAiZJr8= +google.golang.org/genproto v0.0.0-20220808131553-a91ffa7f803e/go.mod h1:iHe1svFLAZg9VWz891+QbRMwUv9O/1Ww+/mngYeThbc= google.golang.org/grpc v1.19.0/go.mod h1:mqu4LbDTu4XGKhr4mRzUsmM4RtVoemTSY81AxZiDr8c= google.golang.org/grpc v1.20.1/go.mod h1:10oTOabMzJvdu6/UiuZezV6QK5dSlG84ov/aaiqXj38= google.golang.org/grpc v1.21.1/go.mod h1:oYelfM1adQP15Ek0mdvEgi9Df8B9CZIaU1084ijfRaM= diff --git a/internal/generated/snippets/analytics/admin/apiv1alpha/AnalyticsAdminClient/ArchiveAudience/main.go b/internal/generated/snippets/analytics/admin/apiv1alpha/AnalyticsAdminClient/ArchiveAudience/main.go new file mode 100644 index 00000000000..81d02c9bb33 --- /dev/null +++ b/internal/generated/snippets/analytics/admin/apiv1alpha/AnalyticsAdminClient/ArchiveAudience/main.go @@ -0,0 +1,46 @@ +// Copyright 2022 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 +// +// http://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 cloud.google.com/go/internal/gapicgen/gensnippets. DO NOT EDIT. + +// [START analyticsadmin_v1alpha_generated_AnalyticsAdminService_ArchiveAudience_sync] + +package main + +import ( + "context" + + admin "cloud.google.com/go/analytics/admin/apiv1alpha" + adminpb "google.golang.org/genproto/googleapis/analytics/admin/v1alpha" +) + +func main() { + ctx := context.Background() + c, err := admin.NewAnalyticsAdminClient(ctx) + if err != nil { + // TODO: Handle error. + } + defer c.Close() + + req := &adminpb.ArchiveAudienceRequest{ + // TODO: Fill request struct fields. + // See https://pkg.go.dev/google.golang.org/genproto/googleapis/analytics/admin/v1alpha#ArchiveAudienceRequest. + } + err = c.ArchiveAudience(ctx, req) + if err != nil { + // TODO: Handle error. + } +} + +// [END analyticsadmin_v1alpha_generated_AnalyticsAdminService_ArchiveAudience_sync] diff --git a/internal/generated/snippets/analytics/admin/apiv1alpha/AnalyticsAdminClient/CreateAudience/main.go b/internal/generated/snippets/analytics/admin/apiv1alpha/AnalyticsAdminClient/CreateAudience/main.go new file mode 100644 index 00000000000..439ea7c6fc9 --- /dev/null +++ b/internal/generated/snippets/analytics/admin/apiv1alpha/AnalyticsAdminClient/CreateAudience/main.go @@ -0,0 +1,48 @@ +// Copyright 2022 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 +// +// http://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 cloud.google.com/go/internal/gapicgen/gensnippets. DO NOT EDIT. + +// [START analyticsadmin_v1alpha_generated_AnalyticsAdminService_CreateAudience_sync] + +package main + +import ( + "context" + + admin "cloud.google.com/go/analytics/admin/apiv1alpha" + adminpb "google.golang.org/genproto/googleapis/analytics/admin/v1alpha" +) + +func main() { + ctx := context.Background() + c, err := admin.NewAnalyticsAdminClient(ctx) + if err != nil { + // TODO: Handle error. + } + defer c.Close() + + req := &adminpb.CreateAudienceRequest{ + // TODO: Fill request struct fields. + // See https://pkg.go.dev/google.golang.org/genproto/googleapis/analytics/admin/v1alpha#CreateAudienceRequest. + } + resp, err := c.CreateAudience(ctx, req) + if err != nil { + // TODO: Handle error. + } + // TODO: Use resp. + _ = resp +} + +// [END analyticsadmin_v1alpha_generated_AnalyticsAdminService_CreateAudience_sync] diff --git a/internal/generated/snippets/analytics/admin/apiv1alpha/AnalyticsAdminClient/GetAttributionSettings/main.go b/internal/generated/snippets/analytics/admin/apiv1alpha/AnalyticsAdminClient/GetAttributionSettings/main.go new file mode 100644 index 00000000000..c1964f8e458 --- /dev/null +++ b/internal/generated/snippets/analytics/admin/apiv1alpha/AnalyticsAdminClient/GetAttributionSettings/main.go @@ -0,0 +1,48 @@ +// Copyright 2022 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 +// +// http://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 cloud.google.com/go/internal/gapicgen/gensnippets. DO NOT EDIT. + +// [START analyticsadmin_v1alpha_generated_AnalyticsAdminService_GetAttributionSettings_sync] + +package main + +import ( + "context" + + admin "cloud.google.com/go/analytics/admin/apiv1alpha" + adminpb "google.golang.org/genproto/googleapis/analytics/admin/v1alpha" +) + +func main() { + ctx := context.Background() + c, err := admin.NewAnalyticsAdminClient(ctx) + if err != nil { + // TODO: Handle error. + } + defer c.Close() + + req := &adminpb.GetAttributionSettingsRequest{ + // TODO: Fill request struct fields. + // See https://pkg.go.dev/google.golang.org/genproto/googleapis/analytics/admin/v1alpha#GetAttributionSettingsRequest. + } + resp, err := c.GetAttributionSettings(ctx, req) + if err != nil { + // TODO: Handle error. + } + // TODO: Use resp. + _ = resp +} + +// [END analyticsadmin_v1alpha_generated_AnalyticsAdminService_GetAttributionSettings_sync] diff --git a/internal/generated/snippets/analytics/admin/apiv1alpha/AnalyticsAdminClient/GetAudience/main.go b/internal/generated/snippets/analytics/admin/apiv1alpha/AnalyticsAdminClient/GetAudience/main.go new file mode 100644 index 00000000000..443a017ffc0 --- /dev/null +++ b/internal/generated/snippets/analytics/admin/apiv1alpha/AnalyticsAdminClient/GetAudience/main.go @@ -0,0 +1,48 @@ +// Copyright 2022 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 +// +// http://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 cloud.google.com/go/internal/gapicgen/gensnippets. DO NOT EDIT. + +// [START analyticsadmin_v1alpha_generated_AnalyticsAdminService_GetAudience_sync] + +package main + +import ( + "context" + + admin "cloud.google.com/go/analytics/admin/apiv1alpha" + adminpb "google.golang.org/genproto/googleapis/analytics/admin/v1alpha" +) + +func main() { + ctx := context.Background() + c, err := admin.NewAnalyticsAdminClient(ctx) + if err != nil { + // TODO: Handle error. + } + defer c.Close() + + req := &adminpb.GetAudienceRequest{ + // TODO: Fill request struct fields. + // See https://pkg.go.dev/google.golang.org/genproto/googleapis/analytics/admin/v1alpha#GetAudienceRequest. + } + resp, err := c.GetAudience(ctx, req) + if err != nil { + // TODO: Handle error. + } + // TODO: Use resp. + _ = resp +} + +// [END analyticsadmin_v1alpha_generated_AnalyticsAdminService_GetAudience_sync] diff --git a/internal/generated/snippets/analytics/admin/apiv1alpha/AnalyticsAdminClient/ListAudiences/main.go b/internal/generated/snippets/analytics/admin/apiv1alpha/AnalyticsAdminClient/ListAudiences/main.go new file mode 100644 index 00000000000..49914750507 --- /dev/null +++ b/internal/generated/snippets/analytics/admin/apiv1alpha/AnalyticsAdminClient/ListAudiences/main.go @@ -0,0 +1,55 @@ +// Copyright 2022 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 +// +// http://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 cloud.google.com/go/internal/gapicgen/gensnippets. DO NOT EDIT. + +// [START analyticsadmin_v1alpha_generated_AnalyticsAdminService_ListAudiences_sync] + +package main + +import ( + "context" + + admin "cloud.google.com/go/analytics/admin/apiv1alpha" + "google.golang.org/api/iterator" + adminpb "google.golang.org/genproto/googleapis/analytics/admin/v1alpha" +) + +func main() { + ctx := context.Background() + c, err := admin.NewAnalyticsAdminClient(ctx) + if err != nil { + // TODO: Handle error. + } + defer c.Close() + + req := &adminpb.ListAudiencesRequest{ + // TODO: Fill request struct fields. + // See https://pkg.go.dev/google.golang.org/genproto/googleapis/analytics/admin/v1alpha#ListAudiencesRequest. + } + it := c.ListAudiences(ctx, req) + for { + resp, err := it.Next() + if err == iterator.Done { + break + } + if err != nil { + // TODO: Handle error. + } + // TODO: Use resp. + _ = resp + } +} + +// [END analyticsadmin_v1alpha_generated_AnalyticsAdminService_ListAudiences_sync] diff --git a/internal/generated/snippets/analytics/admin/apiv1alpha/AnalyticsAdminClient/RunAccessReport/main.go b/internal/generated/snippets/analytics/admin/apiv1alpha/AnalyticsAdminClient/RunAccessReport/main.go new file mode 100644 index 00000000000..e779e240dca --- /dev/null +++ b/internal/generated/snippets/analytics/admin/apiv1alpha/AnalyticsAdminClient/RunAccessReport/main.go @@ -0,0 +1,48 @@ +// Copyright 2022 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 +// +// http://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 cloud.google.com/go/internal/gapicgen/gensnippets. DO NOT EDIT. + +// [START analyticsadmin_v1alpha_generated_AnalyticsAdminService_RunAccessReport_sync] + +package main + +import ( + "context" + + admin "cloud.google.com/go/analytics/admin/apiv1alpha" + adminpb "google.golang.org/genproto/googleapis/analytics/admin/v1alpha" +) + +func main() { + ctx := context.Background() + c, err := admin.NewAnalyticsAdminClient(ctx) + if err != nil { + // TODO: Handle error. + } + defer c.Close() + + req := &adminpb.RunAccessReportRequest{ + // TODO: Fill request struct fields. + // See https://pkg.go.dev/google.golang.org/genproto/googleapis/analytics/admin/v1alpha#RunAccessReportRequest. + } + resp, err := c.RunAccessReport(ctx, req) + if err != nil { + // TODO: Handle error. + } + // TODO: Use resp. + _ = resp +} + +// [END analyticsadmin_v1alpha_generated_AnalyticsAdminService_RunAccessReport_sync] diff --git a/internal/generated/snippets/analytics/admin/apiv1alpha/AnalyticsAdminClient/UpdateAttributionSettings/main.go b/internal/generated/snippets/analytics/admin/apiv1alpha/AnalyticsAdminClient/UpdateAttributionSettings/main.go new file mode 100644 index 00000000000..06a6c9be3be --- /dev/null +++ b/internal/generated/snippets/analytics/admin/apiv1alpha/AnalyticsAdminClient/UpdateAttributionSettings/main.go @@ -0,0 +1,48 @@ +// Copyright 2022 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 +// +// http://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 cloud.google.com/go/internal/gapicgen/gensnippets. DO NOT EDIT. + +// [START analyticsadmin_v1alpha_generated_AnalyticsAdminService_UpdateAttributionSettings_sync] + +package main + +import ( + "context" + + admin "cloud.google.com/go/analytics/admin/apiv1alpha" + adminpb "google.golang.org/genproto/googleapis/analytics/admin/v1alpha" +) + +func main() { + ctx := context.Background() + c, err := admin.NewAnalyticsAdminClient(ctx) + if err != nil { + // TODO: Handle error. + } + defer c.Close() + + req := &adminpb.UpdateAttributionSettingsRequest{ + // TODO: Fill request struct fields. + // See https://pkg.go.dev/google.golang.org/genproto/googleapis/analytics/admin/v1alpha#UpdateAttributionSettingsRequest. + } + resp, err := c.UpdateAttributionSettings(ctx, req) + if err != nil { + // TODO: Handle error. + } + // TODO: Use resp. + _ = resp +} + +// [END analyticsadmin_v1alpha_generated_AnalyticsAdminService_UpdateAttributionSettings_sync] diff --git a/internal/generated/snippets/analytics/admin/apiv1alpha/AnalyticsAdminClient/UpdateAudience/main.go b/internal/generated/snippets/analytics/admin/apiv1alpha/AnalyticsAdminClient/UpdateAudience/main.go new file mode 100644 index 00000000000..166c7227300 --- /dev/null +++ b/internal/generated/snippets/analytics/admin/apiv1alpha/AnalyticsAdminClient/UpdateAudience/main.go @@ -0,0 +1,48 @@ +// Copyright 2022 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 +// +// http://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 cloud.google.com/go/internal/gapicgen/gensnippets. DO NOT EDIT. + +// [START analyticsadmin_v1alpha_generated_AnalyticsAdminService_UpdateAudience_sync] + +package main + +import ( + "context" + + admin "cloud.google.com/go/analytics/admin/apiv1alpha" + adminpb "google.golang.org/genproto/googleapis/analytics/admin/v1alpha" +) + +func main() { + ctx := context.Background() + c, err := admin.NewAnalyticsAdminClient(ctx) + if err != nil { + // TODO: Handle error. + } + defer c.Close() + + req := &adminpb.UpdateAudienceRequest{ + // TODO: Fill request struct fields. + // See https://pkg.go.dev/google.golang.org/genproto/googleapis/analytics/admin/v1alpha#UpdateAudienceRequest. + } + resp, err := c.UpdateAudience(ctx, req) + if err != nil { + // TODO: Handle error. + } + // TODO: Use resp. + _ = resp +} + +// [END analyticsadmin_v1alpha_generated_AnalyticsAdminService_UpdateAudience_sync] diff --git a/internal/generated/snippets/analytics/admin/apiv1alpha/snippet_metadata.google.analytics.admin.v1alpha.json b/internal/generated/snippets/analytics/admin/apiv1alpha/snippet_metadata.google.analytics.admin.v1alpha.json index 8c549026f99..827fcaaecaa 100644 --- a/internal/generated/snippets/analytics/admin/apiv1alpha/snippet_metadata.google.analytics.admin.v1alpha.json +++ b/internal/generated/snippets/analytics/admin/apiv1alpha/snippet_metadata.google.analytics.admin.v1alpha.json @@ -103,6 +103,51 @@ } ] }, + { + "regionTag": "analyticsadmin_v1alpha_generated_AnalyticsAdminService_ArchiveAudience_sync", + "title": "analyticsadmin ArchiveAudience Sample", + "description": "ArchiveAudience archives an Audience on a property.", + "file": "AnalyticsAdminClient/ArchiveAudience/main.go", + "language": "GO", + "clientMethod": { + "shortName": "ArchiveAudience", + "fullName": "google.analytics.admin.v1alpha.AnalyticsAdminClient.ArchiveAudience", + "parameters": [ + { + "type": "context.Context", + "name": "ctx" + }, + { + "type": "adminpb.ArchiveAudienceRequest", + "name": "req" + }, + { + "type": "...gax.CallOption", + "name": "opts" + } + ], + "client": { + "shortName": "AnalyticsAdminClient", + "fullName": "google.analytics.admin.v1alpha.AnalyticsAdminClient" + }, + "method": { + "shortName": "ArchiveAudience", + "fullName": "google.analytics.admin.v1alpha.AnalyticsAdminService.ArchiveAudience", + "service": { + "shortName": "AnalyticsAdminService", + "fullName": "google.analytics.admin.v1alpha.AnalyticsAdminService" + } + } + }, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 18, + "end": 45, + "type": "FULL" + } + ] + }, { "regionTag": "analyticsadmin_v1alpha_generated_AnalyticsAdminService_ArchiveCustomDimension_sync", "title": "analyticsadmin ArchiveCustomDimension Sample", @@ -468,6 +513,52 @@ } ] }, + { + "regionTag": "analyticsadmin_v1alpha_generated_AnalyticsAdminService_CreateAudience_sync", + "title": "analyticsadmin CreateAudience Sample", + "description": "CreateAudience creates an Audience.", + "file": "AnalyticsAdminClient/CreateAudience/main.go", + "language": "GO", + "clientMethod": { + "shortName": "CreateAudience", + "fullName": "google.analytics.admin.v1alpha.AnalyticsAdminClient.CreateAudience", + "parameters": [ + { + "type": "context.Context", + "name": "ctx" + }, + { + "type": "adminpb.CreateAudienceRequest", + "name": "req" + }, + { + "type": "...gax.CallOption", + "name": "opts" + } + ], + "resultType": "adminpb.Audience", + "client": { + "shortName": "AnalyticsAdminClient", + "fullName": "google.analytics.admin.v1alpha.AnalyticsAdminClient" + }, + "method": { + "shortName": "CreateAudience", + "fullName": "google.analytics.admin.v1alpha.AnalyticsAdminService.CreateAudience", + "service": { + "shortName": "AnalyticsAdminService", + "fullName": "google.analytics.admin.v1alpha.AnalyticsAdminService" + } + } + }, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 18, + "end": 47, + "type": "FULL" + } + ] + }, { "regionTag": "analyticsadmin_v1alpha_generated_AnalyticsAdminService_CreateConversionEvent_sync", "title": "analyticsadmin CreateConversionEvent Sample", @@ -1471,6 +1562,98 @@ } ] }, + { + "regionTag": "analyticsadmin_v1alpha_generated_AnalyticsAdminService_GetAttributionSettings_sync", + "title": "analyticsadmin GetAttributionSettings Sample", + "description": "GetAttributionSettings lookup for a AttributionSettings singleton.", + "file": "AnalyticsAdminClient/GetAttributionSettings/main.go", + "language": "GO", + "clientMethod": { + "shortName": "GetAttributionSettings", + "fullName": "google.analytics.admin.v1alpha.AnalyticsAdminClient.GetAttributionSettings", + "parameters": [ + { + "type": "context.Context", + "name": "ctx" + }, + { + "type": "adminpb.GetAttributionSettingsRequest", + "name": "req" + }, + { + "type": "...gax.CallOption", + "name": "opts" + } + ], + "resultType": "adminpb.AttributionSettings", + "client": { + "shortName": "AnalyticsAdminClient", + "fullName": "google.analytics.admin.v1alpha.AnalyticsAdminClient" + }, + "method": { + "shortName": "GetAttributionSettings", + "fullName": "google.analytics.admin.v1alpha.AnalyticsAdminService.GetAttributionSettings", + "service": { + "shortName": "AnalyticsAdminService", + "fullName": "google.analytics.admin.v1alpha.AnalyticsAdminService" + } + } + }, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 18, + "end": 47, + "type": "FULL" + } + ] + }, + { + "regionTag": "analyticsadmin_v1alpha_generated_AnalyticsAdminService_GetAudience_sync", + "title": "analyticsadmin GetAudience Sample", + "description": "GetAudience lookup for a single Audience.\nAudiences created before 2020 may not be supported.", + "file": "AnalyticsAdminClient/GetAudience/main.go", + "language": "GO", + "clientMethod": { + "shortName": "GetAudience", + "fullName": "google.analytics.admin.v1alpha.AnalyticsAdminClient.GetAudience", + "parameters": [ + { + "type": "context.Context", + "name": "ctx" + }, + { + "type": "adminpb.GetAudienceRequest", + "name": "req" + }, + { + "type": "...gax.CallOption", + "name": "opts" + } + ], + "resultType": "adminpb.Audience", + "client": { + "shortName": "AnalyticsAdminClient", + "fullName": "google.analytics.admin.v1alpha.AnalyticsAdminClient" + }, + "method": { + "shortName": "GetAudience", + "fullName": "google.analytics.admin.v1alpha.AnalyticsAdminService.GetAudience", + "service": { + "shortName": "AnalyticsAdminService", + "fullName": "google.analytics.admin.v1alpha.AnalyticsAdminService" + } + } + }, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 18, + "end": 47, + "type": "FULL" + } + ] + }, { "regionTag": "analyticsadmin_v1alpha_generated_AnalyticsAdminService_GetConversionEvent_sync", "title": "analyticsadmin GetConversionEvent Sample", @@ -2161,6 +2344,52 @@ } ] }, + { + "regionTag": "analyticsadmin_v1alpha_generated_AnalyticsAdminService_ListAudiences_sync", + "title": "analyticsadmin ListAudiences Sample", + "description": "ListAudiences lists Audiences on a property.\nAudiences created before 2020 may not be supported.", + "file": "AnalyticsAdminClient/ListAudiences/main.go", + "language": "GO", + "clientMethod": { + "shortName": "ListAudiences", + "fullName": "google.analytics.admin.v1alpha.AnalyticsAdminClient.ListAudiences", + "parameters": [ + { + "type": "context.Context", + "name": "ctx" + }, + { + "type": "adminpb.ListAudiencesRequest", + "name": "req" + }, + { + "type": "...gax.CallOption", + "name": "opts" + } + ], + "resultType": "AudienceIterator", + "client": { + "shortName": "AnalyticsAdminClient", + "fullName": "google.analytics.admin.v1alpha.AnalyticsAdminClient" + }, + "method": { + "shortName": "ListAudiences", + "fullName": "google.analytics.admin.v1alpha.AnalyticsAdminService.ListAudiences", + "service": { + "shortName": "AnalyticsAdminService", + "fullName": "google.analytics.admin.v1alpha.AnalyticsAdminService" + } + } + }, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 18, + "end": 54, + "type": "FULL" + } + ] + }, { "regionTag": "analyticsadmin_v1alpha_generated_AnalyticsAdminService_ListConversionEvents_sync", "title": "analyticsadmin ListConversionEvents Sample", @@ -2713,6 +2942,52 @@ } ] }, + { + "regionTag": "analyticsadmin_v1alpha_generated_AnalyticsAdminService_RunAccessReport_sync", + "title": "analyticsadmin RunAccessReport Sample", + "description": "RunAccessReport returns a customized report of data access records. The report provides\nrecords of each time a user reads Google Analytics reporting data. Access\nrecords are retained for up to 2 years.\n\nData Access Reports can be requested for a property. The property must be\nin Google Analytics 360. This method is only available to Administrators.\n\nThese data access records include GA4 UI Reporting, GA4 UI Explorations,\nGA4 Data API, and other products like Firebase & Admob that can retrieve\ndata from Google Analytics through a linkage. These records don’t include\nproperty configuration changes like adding a stream or changing a\nproperty’s time zone. For configuration change history, see\nsearchChangeHistoryEvents (at https: //developers.google.com/analytics/devguides/config/admin/v1/rest/v1alpha/accounts/searchChangeHistoryEvents).", + "file": "AnalyticsAdminClient/RunAccessReport/main.go", + "language": "GO", + "clientMethod": { + "shortName": "RunAccessReport", + "fullName": "google.analytics.admin.v1alpha.AnalyticsAdminClient.RunAccessReport", + "parameters": [ + { + "type": "context.Context", + "name": "ctx" + }, + { + "type": "adminpb.RunAccessReportRequest", + "name": "req" + }, + { + "type": "...gax.CallOption", + "name": "opts" + } + ], + "resultType": "adminpb.RunAccessReportResponse", + "client": { + "shortName": "AnalyticsAdminClient", + "fullName": "google.analytics.admin.v1alpha.AnalyticsAdminClient" + }, + "method": { + "shortName": "RunAccessReport", + "fullName": "google.analytics.admin.v1alpha.AnalyticsAdminService.RunAccessReport", + "service": { + "shortName": "AnalyticsAdminService", + "fullName": "google.analytics.admin.v1alpha.AnalyticsAdminService" + } + } + }, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 18, + "end": 47, + "type": "FULL" + } + ] + }, { "regionTag": "analyticsadmin_v1alpha_generated_AnalyticsAdminService_SearchChangeHistoryEvents_sync", "title": "analyticsadmin SearchChangeHistoryEvents Sample", @@ -2805,6 +3080,98 @@ } ] }, + { + "regionTag": "analyticsadmin_v1alpha_generated_AnalyticsAdminService_UpdateAttributionSettings_sync", + "title": "analyticsadmin UpdateAttributionSettings Sample", + "description": "UpdateAttributionSettings updates attribution settings on a property.", + "file": "AnalyticsAdminClient/UpdateAttributionSettings/main.go", + "language": "GO", + "clientMethod": { + "shortName": "UpdateAttributionSettings", + "fullName": "google.analytics.admin.v1alpha.AnalyticsAdminClient.UpdateAttributionSettings", + "parameters": [ + { + "type": "context.Context", + "name": "ctx" + }, + { + "type": "adminpb.UpdateAttributionSettingsRequest", + "name": "req" + }, + { + "type": "...gax.CallOption", + "name": "opts" + } + ], + "resultType": "adminpb.AttributionSettings", + "client": { + "shortName": "AnalyticsAdminClient", + "fullName": "google.analytics.admin.v1alpha.AnalyticsAdminClient" + }, + "method": { + "shortName": "UpdateAttributionSettings", + "fullName": "google.analytics.admin.v1alpha.AnalyticsAdminService.UpdateAttributionSettings", + "service": { + "shortName": "AnalyticsAdminService", + "fullName": "google.analytics.admin.v1alpha.AnalyticsAdminService" + } + } + }, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 18, + "end": 47, + "type": "FULL" + } + ] + }, + { + "regionTag": "analyticsadmin_v1alpha_generated_AnalyticsAdminService_UpdateAudience_sync", + "title": "analyticsadmin UpdateAudience Sample", + "description": "UpdateAudience updates an Audience on a property.", + "file": "AnalyticsAdminClient/UpdateAudience/main.go", + "language": "GO", + "clientMethod": { + "shortName": "UpdateAudience", + "fullName": "google.analytics.admin.v1alpha.AnalyticsAdminClient.UpdateAudience", + "parameters": [ + { + "type": "context.Context", + "name": "ctx" + }, + { + "type": "adminpb.UpdateAudienceRequest", + "name": "req" + }, + { + "type": "...gax.CallOption", + "name": "opts" + } + ], + "resultType": "adminpb.Audience", + "client": { + "shortName": "AnalyticsAdminClient", + "fullName": "google.analytics.admin.v1alpha.AnalyticsAdminClient" + }, + "method": { + "shortName": "UpdateAudience", + "fullName": "google.analytics.admin.v1alpha.AnalyticsAdminService.UpdateAudience", + "service": { + "shortName": "AnalyticsAdminService", + "fullName": "google.analytics.admin.v1alpha.AnalyticsAdminService" + } + } + }, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 18, + "end": 47, + "type": "FULL" + } + ] + }, { "regionTag": "analyticsadmin_v1alpha_generated_AnalyticsAdminService_UpdateCustomDimension_sync", "title": "analyticsadmin UpdateCustomDimension Sample", diff --git a/internal/generated/snippets/go.mod b/internal/generated/snippets/go.mod index 2df7aaaea87..36e44482a1c 100644 --- a/internal/generated/snippets/go.mod +++ b/internal/generated/snippets/go.mod @@ -120,7 +120,7 @@ require ( cloud.google.com/go/workflows v1.1.0 github.com/golang/groupcache v0.0.0-20210331224755-41bb18bfe9da // indirect google.golang.org/api v0.91.0 - google.golang.org/genproto v0.0.0-20220805133916-01dd62135a58 + google.golang.org/genproto v0.0.0-20220808131553-a91ffa7f803e ) require cloud.google.com/go/apigeeregistry v0.0.0-00010101000000-000000000000 diff --git a/internal/generated/snippets/go.sum b/internal/generated/snippets/go.sum index 95fad599e41..aae7e7d62c1 100644 --- a/internal/generated/snippets/go.sum +++ b/internal/generated/snippets/go.sum @@ -233,8 +233,8 @@ google.golang.org/genproto v0.0.0-20220725144611-272f38e5d71b/go.mod h1:iHe1svFL google.golang.org/genproto v0.0.0-20220801145646-83ce21fca29f/go.mod h1:iHe1svFLAZg9VWz891+QbRMwUv9O/1Ww+/mngYeThbc= google.golang.org/genproto v0.0.0-20220802133213-ce4fa296bf78/go.mod h1:iHe1svFLAZg9VWz891+QbRMwUv9O/1Ww+/mngYeThbc= google.golang.org/genproto v0.0.0-20220804142021-4e6b2dfa6612/go.mod h1:iHe1svFLAZg9VWz891+QbRMwUv9O/1Ww+/mngYeThbc= -google.golang.org/genproto v0.0.0-20220805133916-01dd62135a58 h1:sRT5xdTkj1Kbk30qbYC7VyMj73N5pZYsw6v+Nrzdhno= -google.golang.org/genproto v0.0.0-20220805133916-01dd62135a58/go.mod h1:iHe1svFLAZg9VWz891+QbRMwUv9O/1Ww+/mngYeThbc= +google.golang.org/genproto v0.0.0-20220808131553-a91ffa7f803e h1:yXLYwnRRqNHIwwHZLiA9/aC9uieNrOF0owsijAiZJr8= +google.golang.org/genproto v0.0.0-20220808131553-a91ffa7f803e/go.mod h1:iHe1svFLAZg9VWz891+QbRMwUv9O/1Ww+/mngYeThbc= google.golang.org/grpc v1.19.0/go.mod h1:mqu4LbDTu4XGKhr4mRzUsmM4RtVoemTSY81AxZiDr8c= google.golang.org/grpc v1.23.0/go.mod h1:Y5yQAOtifL1yxbo5wqy6BxZv8vAUGQwXBOALyacEbxg= google.golang.org/grpc v1.25.1/go.mod h1:c3i+UQWmh7LiEpx4sFZnkU36qjEYZ0imhYfXVyQciAY= diff --git a/internal/godocfx/go.mod b/internal/godocfx/go.mod index f7d1ee5f57a..7027780c7d1 100644 --- a/internal/godocfx/go.mod +++ b/internal/godocfx/go.mod @@ -32,7 +32,7 @@ require ( golang.org/x/xerrors v0.0.0-20220609144429-65e65417b02f // indirect google.golang.org/api v0.91.0 // indirect google.golang.org/appengine v1.6.7 // indirect - google.golang.org/genproto v0.0.0-20220805133916-01dd62135a58 // indirect + google.golang.org/genproto v0.0.0-20220808131553-a91ffa7f803e // indirect google.golang.org/grpc v1.48.0 // indirect google.golang.org/protobuf v1.28.0 // indirect ) diff --git a/internal/godocfx/go.sum b/internal/godocfx/go.sum index 33c9d436482..c4563ad79e2 100644 --- a/internal/godocfx/go.sum +++ b/internal/godocfx/go.sum @@ -272,8 +272,8 @@ google.golang.org/genproto v0.0.0-20220616135557-88e70c0c3a90/go.mod h1:KEWEmljW google.golang.org/genproto v0.0.0-20220617124728-180714bec0ad/go.mod h1:KEWEmljWE5zPzLBa/oHl6DaEt9LmfH6WtH1OHIvleBA= google.golang.org/genproto v0.0.0-20220622131801-db39fadba55f/go.mod h1:KEWEmljWE5zPzLBa/oHl6DaEt9LmfH6WtH1OHIvleBA= google.golang.org/genproto v0.0.0-20220624142145-8cd45d7dbd1f/go.mod h1:KEWEmljWE5zPzLBa/oHl6DaEt9LmfH6WtH1OHIvleBA= -google.golang.org/genproto v0.0.0-20220805133916-01dd62135a58 h1:sRT5xdTkj1Kbk30qbYC7VyMj73N5pZYsw6v+Nrzdhno= -google.golang.org/genproto v0.0.0-20220805133916-01dd62135a58/go.mod h1:iHe1svFLAZg9VWz891+QbRMwUv9O/1Ww+/mngYeThbc= +google.golang.org/genproto v0.0.0-20220808131553-a91ffa7f803e h1:yXLYwnRRqNHIwwHZLiA9/aC9uieNrOF0owsijAiZJr8= +google.golang.org/genproto v0.0.0-20220808131553-a91ffa7f803e/go.mod h1:iHe1svFLAZg9VWz891+QbRMwUv9O/1Ww+/mngYeThbc= google.golang.org/grpc v1.19.0/go.mod h1:mqu4LbDTu4XGKhr4mRzUsmM4RtVoemTSY81AxZiDr8c= google.golang.org/grpc v1.23.0/go.mod h1:Y5yQAOtifL1yxbo5wqy6BxZv8vAUGQwXBOALyacEbxg= google.golang.org/grpc v1.25.1/go.mod h1:c3i+UQWmh7LiEpx4sFZnkU36qjEYZ0imhYfXVyQciAY= diff --git a/monitoring/apiv3/v2/alert_policy_client.go b/monitoring/apiv3/v2/alert_policy_client.go index fbdee6fbf95..8bfbcc3978a 100644 --- a/monitoring/apiv3/v2/alert_policy_client.go +++ b/monitoring/apiv3/v2/alert_policy_client.go @@ -114,14 +114,14 @@ type internalAlertPolicyClient interface { // Methods, except Close, may be called concurrently. However, fields must not be modified concurrently with method calls. // // The AlertPolicyService API is used to manage (list, create, delete, -// edit) alert policies in Stackdriver Monitoring. An alerting policy is +// edit) alert policies in Cloud Monitoring. An alerting policy is // a description of the conditions under which some aspect of your // system is considered to be “unhealthy” and the ways to notify // people or services about this state. In addition to using this API, alert // policies can also be managed through -// Stackdriver Monitoring (at https://cloud.google.com/monitoring/docs/), +// Cloud Monitoring (at https://cloud.google.com/monitoring/docs/), // which can be reached by clicking the “Monitoring” tab in -// Cloud Console (at https://console.cloud.google.com/). +// Cloud console (at https://console.cloud.google.com/). type AlertPolicyClient struct { // The internal transport-dependent client. internalClient internalAlertPolicyClient @@ -204,14 +204,14 @@ type alertPolicyGRPCClient struct { // The returned client must be Closed when it is done being used to clean up its underlying connections. // // The AlertPolicyService API is used to manage (list, create, delete, -// edit) alert policies in Stackdriver Monitoring. An alerting policy is +// edit) alert policies in Cloud Monitoring. An alerting policy is // a description of the conditions under which some aspect of your // system is considered to be “unhealthy” and the ways to notify // people or services about this state. In addition to using this API, alert // policies can also be managed through -// Stackdriver Monitoring (at https://cloud.google.com/monitoring/docs/), +// Cloud Monitoring (at https://cloud.google.com/monitoring/docs/), // which can be reached by clicking the “Monitoring” tab in -// Cloud Console (at https://console.cloud.google.com/). +// Cloud console (at https://console.cloud.google.com/). func NewAlertPolicyClient(ctx context.Context, opts ...option.ClientOption) (*AlertPolicyClient, error) { clientOpts := defaultAlertPolicyGRPCClientOptions() if newAlertPolicyClientHook != nil { diff --git a/monitoring/go.mod b/monitoring/go.mod index fbd77eadc4a..7f3582a01c2 100644 --- a/monitoring/go.mod +++ b/monitoring/go.mod @@ -6,8 +6,8 @@ require ( cloud.google.com/go v0.102.1 github.com/golang/protobuf v1.5.2 github.com/googleapis/gax-go/v2 v2.4.0 - google.golang.org/api v0.85.0 - google.golang.org/genproto v0.0.0-20220617124728-180714bec0ad + google.golang.org/api v0.91.0 + google.golang.org/genproto v0.0.0-20220808131553-a91ffa7f803e google.golang.org/grpc v1.48.0 google.golang.org/protobuf v1.28.0 ) @@ -18,9 +18,9 @@ require ( github.com/google/go-cmp v0.5.8 // indirect github.com/googleapis/enterprise-certificate-proxy v0.1.0 // indirect go.opencensus.io v0.23.0 // indirect - golang.org/x/net v0.0.0-20220617184016-355a448f1bc9 // indirect - golang.org/x/oauth2 v0.0.0-20220608161450-d0670ef3b1eb // indirect - golang.org/x/sys v0.0.0-20220615213510-4f61da869c0c // indirect + golang.org/x/net v0.0.0-20220624214902-1bab6f366d9e // indirect + golang.org/x/oauth2 v0.0.0-20220622183110-fd043fe589d2 // indirect + golang.org/x/sys v0.0.0-20220624220833-87e55d714810 // indirect golang.org/x/text v0.3.7 // indirect google.golang.org/appengine v1.6.7 // indirect ) diff --git a/monitoring/go.sum b/monitoring/go.sum index 0180b571594..a8b0272366f 100644 --- a/monitoring/go.sum +++ b/monitoring/go.sum @@ -162,6 +162,7 @@ github.com/google/pprof v0.0.0-20210609004039-a478d1d731e9/go.mod h1:kpwsk12EmLe github.com/google/pprof v0.0.0-20210720184732-4bb14d4b1be1/go.mod h1:kpwsk12EmLew5upagYY7GY0pfYCcupk39gWOCRROcvE= github.com/google/renameio v0.1.0/go.mod h1:KWCgfxg9yswjAJkECMjeO8J8rahYeXnNhOm40UhjYkI= github.com/google/uuid v1.1.2/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= +github.com/google/uuid v1.3.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= github.com/googleapis/enterprise-certificate-proxy v0.0.0-20220520183353-fd19c99a87aa/go.mod h1:17drOmN3MwGY7t0e+Ei9b45FFGA3fBs3x36SsCg1hq8= github.com/googleapis/enterprise-certificate-proxy v0.1.0 h1:zO8WHNx/MYiAKJ3d5spxZXZE6KHmIQGQcAzwUzV7qQw= github.com/googleapis/enterprise-certificate-proxy v0.1.0/go.mod h1:17drOmN3MwGY7t0e+Ei9b45FFGA3fBs3x36SsCg1hq8= @@ -290,8 +291,8 @@ golang.org/x/net v0.0.0-20220325170049-de3da57026de/go.mod h1:CfG3xpIq0wQ8r1q4Su golang.org/x/net v0.0.0-20220412020605-290c469a71a5/go.mod h1:CfG3xpIq0wQ8r1q4Su4UZFWDARRcnwPjda9FqA0JpMk= golang.org/x/net v0.0.0-20220425223048-2871e0cb64e4/go.mod h1:CfG3xpIq0wQ8r1q4Su4UZFWDARRcnwPjda9FqA0JpMk= golang.org/x/net v0.0.0-20220607020251-c690dde0001d/go.mod h1:XRhObCWvk6IyKnWLug+ECip1KBveYUHfp+8e9klMJ9c= -golang.org/x/net v0.0.0-20220617184016-355a448f1bc9 h1:Yqz/iviulwKwAREEeUd3nbBFn0XuyJqkoft2IlrvOhc= -golang.org/x/net v0.0.0-20220617184016-355a448f1bc9/go.mod h1:XRhObCWvk6IyKnWLug+ECip1KBveYUHfp+8e9klMJ9c= +golang.org/x/net v0.0.0-20220624214902-1bab6f366d9e h1:TsQ7F31D3bUCLeqPT0u+yjp1guoArKaNKmCr22PYgTQ= +golang.org/x/net v0.0.0-20220624214902-1bab6f366d9e/go.mod h1:XRhObCWvk6IyKnWLug+ECip1KBveYUHfp+8e9klMJ9c= golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U= golang.org/x/oauth2 v0.0.0-20190226205417-e64efc72b421/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= golang.org/x/oauth2 v0.0.0-20190604053449-0f29369cfe45/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= @@ -311,8 +312,9 @@ golang.org/x/oauth2 v0.0.0-20211104180415-d3ed0bb246c8/go.mod h1:KelEdhl1UZF7XfJ golang.org/x/oauth2 v0.0.0-20220223155221-ee480838109b/go.mod h1:DAh4E804XQdzx2j+YRIaUnCqCV2RuMz24cGBJ5QYIrc= golang.org/x/oauth2 v0.0.0-20220309155454-6242fa91716a/go.mod h1:DAh4E804XQdzx2j+YRIaUnCqCV2RuMz24cGBJ5QYIrc= golang.org/x/oauth2 v0.0.0-20220411215720-9780585627b5/go.mod h1:DAh4E804XQdzx2j+YRIaUnCqCV2RuMz24cGBJ5QYIrc= -golang.org/x/oauth2 v0.0.0-20220608161450-d0670ef3b1eb h1:8tDJ3aechhddbdPAxpycgXHJRMLpk/Ab+aa4OgdN5/g= golang.org/x/oauth2 v0.0.0-20220608161450-d0670ef3b1eb/go.mod h1:jaDAt6Dkxork7LmZnYtzbRWj0W47D86a3TGe0YHBvmE= +golang.org/x/oauth2 v0.0.0-20220622183110-fd043fe589d2 h1:+jnHzr9VPj32ykQVai5DNahi9+NSp7yYuCsl5eAQtL0= +golang.org/x/oauth2 v0.0.0-20220622183110-fd043fe589d2/go.mod h1:jaDAt6Dkxork7LmZnYtzbRWj0W47D86a3TGe0YHBvmE= golang.org/x/sync v0.0.0-20180314180146-1d60e4601c6f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20181108010431-42b317875d0f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20181221193216-37e7f081c4d4/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= @@ -383,8 +385,8 @@ golang.org/x/sys v0.0.0-20220502124256-b6088ccd6cba/go.mod h1:oPkhp1MJrh7nUepCBc golang.org/x/sys v0.0.0-20220503163025-988cb79eb6c6/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20220520151302-bc2c85ada10a/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20220610221304-9f5ed59c137d/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.0.0-20220615213510-4f61da869c0c h1:aFV+BgZ4svzjfabn8ERpuB4JI4N6/rdy1iusx77G3oU= -golang.org/x/sys v0.0.0-20220615213510-4f61da869c0c/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.0.0-20220624220833-87e55d714810 h1:rHZQSjJdAI4Xf5Qzeh2bBc5YJIkPFVM6oDtMFYmgws0= +golang.org/x/sys v0.0.0-20220624220833-87e55d714810/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo= golang.org/x/term v0.0.0-20210927222741-03fcf44c2211/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8= golang.org/x/text v0.0.0-20170915032832-14c0d48ead0c/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= @@ -497,8 +499,8 @@ google.golang.org/api v0.75.0/go.mod h1:pU9QmyHLnzlpar1Mjt4IbapUCy8J+6HD6GeELN69 google.golang.org/api v0.78.0/go.mod h1:1Sg78yoMLOhlQTeF+ARBoytAcH1NNyyl390YMy6rKmw= google.golang.org/api v0.80.0/go.mod h1:xY3nI94gbvBrE0J6NHXhxOmW97HG7Khjkku6AFB3Hyg= google.golang.org/api v0.84.0/go.mod h1:NTsGnUFJMYROtiquksZHBWtHfeMC7iYthki7Eq3pa8o= -google.golang.org/api v0.85.0 h1:8rJoHuRxx+vCmZtAO/3k1dRLvYNVyTJtZ5oaFZvhgvc= -google.golang.org/api v0.85.0/go.mod h1:AqZf8Ep9uZ2pyTvgL+x0D3Zt0eoT9b5E8fmzfu6FO2g= +google.golang.org/api v0.91.0 h1:731+JzuwaJoZXRQGmPoBiV+SrsAfUaIkdMCWTcQNPyA= +google.golang.org/api v0.91.0/go.mod h1:+Sem1dnrKlrXMR/X0bPnMWyluQe4RsNoYfmNLhOIkzw= google.golang.org/appengine v1.1.0/go.mod h1:EbEs0AVv82hx2wNQdGPgUI5lhzA/G0D9YwlJXL52JkM= google.golang.org/appengine v1.4.0/go.mod h1:xpcJRLb0r/rnEns0DIKYYv+WjYCduHsrkT7/EB5XEv4= google.golang.org/appengine v1.5.0/go.mod h1:xpcJRLb0r/rnEns0DIKYYv+WjYCduHsrkT7/EB5XEv4= @@ -585,8 +587,10 @@ google.golang.org/genproto v0.0.0-20220518221133-4f43b3371335/go.mod h1:RAyBrSAP google.golang.org/genproto v0.0.0-20220523171625-347a074981d8/go.mod h1:RAyBrSAP7Fh3Nc84ghnVLDPuV51xc9agzmm4Ph6i0Q4= google.golang.org/genproto v0.0.0-20220608133413-ed9918b62aac/go.mod h1:KEWEmljWE5zPzLBa/oHl6DaEt9LmfH6WtH1OHIvleBA= google.golang.org/genproto v0.0.0-20220616135557-88e70c0c3a90/go.mod h1:KEWEmljWE5zPzLBa/oHl6DaEt9LmfH6WtH1OHIvleBA= -google.golang.org/genproto v0.0.0-20220617124728-180714bec0ad h1:kqrS+lhvaMHCxul6sKQvKJ8nAAhlVItmZV822hYFH/U= google.golang.org/genproto v0.0.0-20220617124728-180714bec0ad/go.mod h1:KEWEmljWE5zPzLBa/oHl6DaEt9LmfH6WtH1OHIvleBA= +google.golang.org/genproto v0.0.0-20220624142145-8cd45d7dbd1f/go.mod h1:KEWEmljWE5zPzLBa/oHl6DaEt9LmfH6WtH1OHIvleBA= +google.golang.org/genproto v0.0.0-20220808131553-a91ffa7f803e h1:yXLYwnRRqNHIwwHZLiA9/aC9uieNrOF0owsijAiZJr8= +google.golang.org/genproto v0.0.0-20220808131553-a91ffa7f803e/go.mod h1:iHe1svFLAZg9VWz891+QbRMwUv9O/1Ww+/mngYeThbc= google.golang.org/grpc v1.19.0/go.mod h1:mqu4LbDTu4XGKhr4mRzUsmM4RtVoemTSY81AxZiDr8c= google.golang.org/grpc v1.20.1/go.mod h1:10oTOabMzJvdu6/UiuZezV6QK5dSlG84ov/aaiqXj38= google.golang.org/grpc v1.21.1/go.mod h1:oYelfM1adQP15Ek0mdvEgi9Df8B9CZIaU1084ijfRaM=