admin

package
v0.71.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 2, 2020 License: Apache-2.0 Imports: 20 Imported by: 0

Documentation

Overview

NOTE: This package is in alpha. It is not stable, and is likely to change.

Use of Context

The ctx passed to NewClient is used for authentication requests and for creating the underlying connection, but is not used for subsequent calls. Individual methods on the client use the ctx given to them.

To close the open connection, use the Close() method.

For information about setting deadlines, reusing contexts, and more please visit pkg.go.dev/cloud.google.com/go.

Index

Examples

Constants

This section is empty.

Variables

This section is empty.

Functions

func DefaultAuthScopes

func DefaultAuthScopes() []string

DefaultAuthScopes reports the default set of authentication scopes to use with this package.

Types

type AccountIterator

type AccountIterator struct {

	// 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)
	// contains filtered or unexported fields
}

AccountIterator manages a stream of *adminpb.Account.

func (*AccountIterator) Next

func (it *AccountIterator) Next() (*adminpb.Account, error)

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 (*AccountIterator) PageInfo

func (it *AccountIterator) PageInfo() *iterator.PageInfo

PageInfo supports pagination. See the google.golang.org/api/iterator package for details.

type AccountSummaryIterator added in v0.69.0

type AccountSummaryIterator struct {

	// 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.AccountSummary, nextPageToken string, err error)
	// contains filtered or unexported fields
}

AccountSummaryIterator manages a stream of *adminpb.AccountSummary.

func (*AccountSummaryIterator) Next added in v0.69.0

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 (*AccountSummaryIterator) PageInfo added in v0.69.0

func (it *AccountSummaryIterator) PageInfo() *iterator.PageInfo

PageInfo supports pagination. See the google.golang.org/api/iterator package for details.

type AnalyticsAdminCallOptions

type AnalyticsAdminCallOptions struct {
	GetAccount                        []gax.CallOption
	ListAccounts                      []gax.CallOption
	DeleteAccount                     []gax.CallOption
	UpdateAccount                     []gax.CallOption
	ProvisionAccountTicket            []gax.CallOption
	ListAccountSummaries              []gax.CallOption
	GetProperty                       []gax.CallOption
	ListProperties                    []gax.CallOption
	CreateProperty                    []gax.CallOption
	DeleteProperty                    []gax.CallOption
	UpdateProperty                    []gax.CallOption
	GetUserLink                       []gax.CallOption
	BatchGetUserLinks                 []gax.CallOption
	ListUserLinks                     []gax.CallOption
	AuditUserLinks                    []gax.CallOption
	CreateUserLink                    []gax.CallOption
	BatchCreateUserLinks              []gax.CallOption
	UpdateUserLink                    []gax.CallOption
	BatchUpdateUserLinks              []gax.CallOption
	DeleteUserLink                    []gax.CallOption
	BatchDeleteUserLinks              []gax.CallOption
	GetWebDataStream                  []gax.CallOption
	DeleteWebDataStream               []gax.CallOption
	UpdateWebDataStream               []gax.CallOption
	CreateWebDataStream               []gax.CallOption
	ListWebDataStreams                []gax.CallOption
	GetIosAppDataStream               []gax.CallOption
	DeleteIosAppDataStream            []gax.CallOption
	UpdateIosAppDataStream            []gax.CallOption
	CreateIosAppDataStream            []gax.CallOption
	ListIosAppDataStreams             []gax.CallOption
	GetAndroidAppDataStream           []gax.CallOption
	DeleteAndroidAppDataStream        []gax.CallOption
	UpdateAndroidAppDataStream        []gax.CallOption
	CreateAndroidAppDataStream        []gax.CallOption
	ListAndroidAppDataStreams         []gax.CallOption
	GetEnhancedMeasurementSettings    []gax.CallOption
	UpdateEnhancedMeasurementSettings []gax.CallOption
	CreateFirebaseLink                []gax.CallOption
	UpdateFirebaseLink                []gax.CallOption
	DeleteFirebaseLink                []gax.CallOption
	ListFirebaseLinks                 []gax.CallOption
	GetGlobalSiteTag                  []gax.CallOption
	CreateGoogleAdsLink               []gax.CallOption
	UpdateGoogleAdsLink               []gax.CallOption
	DeleteGoogleAdsLink               []gax.CallOption
	ListGoogleAdsLinks                []gax.CallOption
	GetDataSharingSettings            []gax.CallOption
}

AnalyticsAdminCallOptions contains the retry settings for each method of AnalyticsAdminClient.

type AnalyticsAdminClient

type AnalyticsAdminClient struct {

	// The call options for this service.
	CallOptions *AnalyticsAdminCallOptions
	// contains filtered or unexported fields
}

AnalyticsAdminClient is a client for interacting with .

Methods, except Close, may be called concurrently. However, fields must not be modified concurrently with method calls.

func NewAnalyticsAdminClient

func NewAnalyticsAdminClient(ctx context.Context, opts ...option.ClientOption) (*AnalyticsAdminClient, error)

NewAnalyticsAdminClient creates a new analytics admin service client.

Service Interface for the Analytics Admin API (GA4).

Example
package main

import (
	"context"

	admin "cloud.google.com/go/analytics/admin/apiv1alpha"
)

func main() {
	ctx := context.Background()
	c, err := admin.NewAnalyticsAdminClient(ctx)
	if err != nil {
		// TODO: Handle error.
	}
	// TODO: Use client.
	_ = c
}
Output:

AuditUserLinks lists all user links on an account or property, including implicit ones that come from effective permissions granted by groups or organization admin roles.

If a returned user link does not have direct permissions, they cannot be removed from the account or property directly with the DeleteUserLink command. They have to be removed from the group/etc that gives them permissions, which is currently only usable/discoverable in the GA or GMP UIs.

BatchCreateUserLinks creates information about multiple users’ links to an account or property.

This method is transactional. If any UserLink cannot be created, none of the UserLinks will be created.

func (c *AnalyticsAdminClient) BatchDeleteUserLinks(ctx context.Context, req *adminpb.BatchDeleteUserLinksRequest, opts ...gax.CallOption) error

BatchDeleteUserLinks deletes information about multiple users’ links to an account or property.

BatchGetUserLinks gets information about multiple users’ links to an account or property.

BatchUpdateUserLinks updates information about multiple users’ links to an account or property.

func (*AnalyticsAdminClient) Close

func (c *AnalyticsAdminClient) Close() error

Close closes the connection to the API service. The user should invoke this when the client is no longer required.

func (*AnalyticsAdminClient) Connection

func (c *AnalyticsAdminClient) Connection() *grpc.ClientConn

Connection returns a connection to the API service.

Deprecated.

func (*AnalyticsAdminClient) CreateAndroidAppDataStream

CreateAndroidAppDataStream creates an android app stream with the specified location and attributes.

Example
package main

import (
	"context"

	admin "cloud.google.com/go/analytics/admin/apiv1alpha"

	adminpb "google.golang.org/genproto/googleapis/analytics/admin/v1alpha"
)

func main() {
	// import adminpb "google.golang.org/genproto/googleapis/analytics/admin/v1alpha"

	ctx := context.Background()
	c, err := admin.NewAnalyticsAdminClient(ctx)
	if err != nil {
		// TODO: Handle error.
	}

	req := &adminpb.CreateAndroidAppDataStreamRequest{
		// TODO: Fill request struct fields.
	}
	resp, err := c.CreateAndroidAppDataStream(ctx, req)
	if err != nil {
		// TODO: Handle error.
	}
	// TODO: Use resp.
	_ = resp
}
Output:

CreateFirebaseLink creates a FirebaseLink.

Properties can have at most one FirebaseLink.

CreateGoogleAdsLink creates a GoogleAdsLink.

func (*AnalyticsAdminClient) CreateIosAppDataStream

CreateIosAppDataStream creates an iOS app data stream with the specified location and attributes.

Example
package main

import (
	"context"

	admin "cloud.google.com/go/analytics/admin/apiv1alpha"

	adminpb "google.golang.org/genproto/googleapis/analytics/admin/v1alpha"
)

func main() {
	// import adminpb "google.golang.org/genproto/googleapis/analytics/admin/v1alpha"

	ctx := context.Background()
	c, err := admin.NewAnalyticsAdminClient(ctx)
	if err != nil {
		// TODO: Handle error.
	}

	req := &adminpb.CreateIosAppDataStreamRequest{
		// TODO: Fill request struct fields.
	}
	resp, err := c.CreateIosAppDataStream(ctx, req)
	if err != nil {
		// TODO: Handle error.
	}
	// TODO: Use resp.
	_ = resp
}
Output:

func (*AnalyticsAdminClient) CreateProperty

CreateProperty creates an “GA4” property with the specified location and attributes.

Example
package main

import (
	"context"

	admin "cloud.google.com/go/analytics/admin/apiv1alpha"

	adminpb "google.golang.org/genproto/googleapis/analytics/admin/v1alpha"
)

func main() {
	// import adminpb "google.golang.org/genproto/googleapis/analytics/admin/v1alpha"

	ctx := context.Background()
	c, err := admin.NewAnalyticsAdminClient(ctx)
	if err != nil {
		// TODO: Handle error.
	}

	req := &adminpb.CreatePropertyRequest{
		// TODO: Fill request struct fields.
	}
	resp, err := c.CreateProperty(ctx, req)
	if err != nil {
		// TODO: Handle error.
	}
	// TODO: Use resp.
	_ = resp
}
Output:

CreateUserLink creates a user link on an account or property.

If the user with the specified email already has permissions on the account or property, then the user’s existing permissions will be unioned with the permissions specified in the new UserLink.

func (*AnalyticsAdminClient) CreateWebDataStream

CreateWebDataStream creates a web stream with the specified location and attributes.

Example
package main

import (
	"context"

	admin "cloud.google.com/go/analytics/admin/apiv1alpha"

	adminpb "google.golang.org/genproto/googleapis/analytics/admin/v1alpha"
)

func main() {
	// import adminpb "google.golang.org/genproto/googleapis/analytics/admin/v1alpha"

	ctx := context.Background()
	c, err := admin.NewAnalyticsAdminClient(ctx)
	if err != nil {
		// TODO: Handle error.
	}

	req := &adminpb.CreateWebDataStreamRequest{
		// TODO: Fill request struct fields.
	}
	resp, err := c.CreateWebDataStream(ctx, req)
	if err != nil {
		// TODO: Handle error.
	}
	// TODO: Use resp.
	_ = resp
}
Output:

func (*AnalyticsAdminClient) DeleteAccount

func (c *AnalyticsAdminClient) DeleteAccount(ctx context.Context, req *adminpb.DeleteAccountRequest, opts ...gax.CallOption) error

DeleteAccount marks target Account as soft-deleted (ie: “trashed”) and returns it.

This API does not have a method to restore soft-deleted accounts. However, they can be restored using the Trash Can UI.

If the accounts are not restored before the expiration time, the account and all child resources (eg: Properties, GoogleAdsLinks, Streams, UserLinks) will be permanently purged. https://support.google.com/analytics/answer/6154772 (at https://support.google.com/analytics/answer/6154772)

Returns an error if the target is not found.

Example
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.
	}

	req := &adminpb.DeleteAccountRequest{
		// TODO: Fill request struct fields.
	}
	err = c.DeleteAccount(ctx, req)
	if err != nil {
		// TODO: Handle error.
	}
}
Output:

func (*AnalyticsAdminClient) DeleteAndroidAppDataStream

func (c *AnalyticsAdminClient) DeleteAndroidAppDataStream(ctx context.Context, req *adminpb.DeleteAndroidAppDataStreamRequest, opts ...gax.CallOption) error

DeleteAndroidAppDataStream deletes an android app stream on a property.

Example
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.
	}

	req := &adminpb.DeleteAndroidAppDataStreamRequest{
		// TODO: Fill request struct fields.
	}
	err = c.DeleteAndroidAppDataStream(ctx, req)
	if err != nil {
		// TODO: Handle error.
	}
}
Output:

func (c *AnalyticsAdminClient) DeleteFirebaseLink(ctx context.Context, req *adminpb.DeleteFirebaseLinkRequest, opts ...gax.CallOption) error

DeleteFirebaseLink deletes a FirebaseLink on a property

func (c *AnalyticsAdminClient) DeleteGoogleAdsLink(ctx context.Context, req *adminpb.DeleteGoogleAdsLinkRequest, opts ...gax.CallOption) error

DeleteGoogleAdsLink deletes a GoogleAdsLink on a property

func (*AnalyticsAdminClient) DeleteIosAppDataStream

func (c *AnalyticsAdminClient) DeleteIosAppDataStream(ctx context.Context, req *adminpb.DeleteIosAppDataStreamRequest, opts ...gax.CallOption) error

DeleteIosAppDataStream deletes an iOS app stream on a property.

Example
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.
	}

	req := &adminpb.DeleteIosAppDataStreamRequest{
		// TODO: Fill request struct fields.
	}
	err = c.DeleteIosAppDataStream(ctx, req)
	if err != nil {
		// TODO: Handle error.
	}
}
Output:

func (*AnalyticsAdminClient) DeleteProperty

func (c *AnalyticsAdminClient) DeleteProperty(ctx context.Context, req *adminpb.DeletePropertyRequest, opts ...gax.CallOption) error

DeleteProperty marks target Property as soft-deleted (ie: “trashed”) and returns it.

This API does not have a method to restore soft-deleted properties. However, they can be restored using the Trash Can UI.

If the properties are not restored before the expiration time, the Property and all child resources (eg: GoogleAdsLinks, Streams, UserLinks) will be permanently purged. https://support.google.com/analytics/answer/6154772 (at https://support.google.com/analytics/answer/6154772)

Returns an error if the target is not found, or is not an GA4 Property.

Example
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.
	}

	req := &adminpb.DeletePropertyRequest{
		// TODO: Fill request struct fields.
	}
	err = c.DeleteProperty(ctx, req)
	if err != nil {
		// TODO: Handle error.
	}
}
Output:

func (c *AnalyticsAdminClient) DeleteUserLink(ctx context.Context, req *adminpb.DeleteUserLinkRequest, opts ...gax.CallOption) error

DeleteUserLink deletes a user link on an account or property.

func (*AnalyticsAdminClient) DeleteWebDataStream

func (c *AnalyticsAdminClient) DeleteWebDataStream(ctx context.Context, req *adminpb.DeleteWebDataStreamRequest, opts ...gax.CallOption) error

DeleteWebDataStream deletes a web stream on a property.

Example
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.
	}

	req := &adminpb.DeleteWebDataStreamRequest{
		// TODO: Fill request struct fields.
	}
	err = c.DeleteWebDataStream(ctx, req)
	if err != nil {
		// TODO: Handle error.
	}
}
Output:

func (*AnalyticsAdminClient) GetAccount

GetAccount lookup for a single Account. Throws “Target not found” if no such account found, or if caller does not have permissions to access it.

Example
package main

import (
	"context"

	admin "cloud.google.com/go/analytics/admin/apiv1alpha"

	adminpb "google.golang.org/genproto/googleapis/analytics/admin/v1alpha"
)

func main() {
	// import adminpb "google.golang.org/genproto/googleapis/analytics/admin/v1alpha"

	ctx := context.Background()
	c, err := admin.NewAnalyticsAdminClient(ctx)
	if err != nil {
		// TODO: Handle error.
	}

	req := &adminpb.GetAccountRequest{
		// TODO: Fill request struct fields.
	}
	resp, err := c.GetAccount(ctx, req)
	if err != nil {
		// TODO: Handle error.
	}
	// TODO: Use resp.
	_ = resp
}
Output:

func (*AnalyticsAdminClient) GetAndroidAppDataStream

GetAndroidAppDataStream lookup for a single AndroidAppDataStream

Throws “Target not found” if no such android app data stream found, or if the caller does not have permissions to access it.

Example
package main

import (
	"context"

	admin "cloud.google.com/go/analytics/admin/apiv1alpha"

	adminpb "google.golang.org/genproto/googleapis/analytics/admin/v1alpha"
)

func main() {
	// import adminpb "google.golang.org/genproto/googleapis/analytics/admin/v1alpha"

	ctx := context.Background()
	c, err := admin.NewAnalyticsAdminClient(ctx)
	if err != nil {
		// TODO: Handle error.
	}

	req := &adminpb.GetAndroidAppDataStreamRequest{
		// TODO: Fill request struct fields.
	}
	resp, err := c.GetAndroidAppDataStream(ctx, req)
	if err != nil {
		// TODO: Handle error.
	}
	// TODO: Use resp.
	_ = resp
}
Output:

func (*AnalyticsAdminClient) GetDataSharingSettings

GetDataSharingSettings get data sharing settings on an account. Data sharing settings are singletons.

Example
package main

import (
	"context"

	admin "cloud.google.com/go/analytics/admin/apiv1alpha"

	adminpb "google.golang.org/genproto/googleapis/analytics/admin/v1alpha"
)

func main() {
	// import adminpb "google.golang.org/genproto/googleapis/analytics/admin/v1alpha"

	ctx := context.Background()
	c, err := admin.NewAnalyticsAdminClient(ctx)
	if err != nil {
		// TODO: Handle error.
	}

	req := &adminpb.GetDataSharingSettingsRequest{
		// TODO: Fill request struct fields.
	}
	resp, err := c.GetDataSharingSettings(ctx, req)
	if err != nil {
		// TODO: Handle error.
	}
	// TODO: Use resp.
	_ = resp
}
Output:

func (*AnalyticsAdminClient) GetEnhancedMeasurementSettings

GetEnhancedMeasurementSettings returns the singleton enhanced measurement settings for this web stream. Note that the stream must enable enhanced measurement for these settings to take effect.

Example
package main

import (
	"context"

	admin "cloud.google.com/go/analytics/admin/apiv1alpha"

	adminpb "google.golang.org/genproto/googleapis/analytics/admin/v1alpha"
)

func main() {
	// import adminpb "google.golang.org/genproto/googleapis/analytics/admin/v1alpha"

	ctx := context.Background()
	c, err := admin.NewAnalyticsAdminClient(ctx)
	if err != nil {
		// TODO: Handle error.
	}

	req := &adminpb.GetEnhancedMeasurementSettingsRequest{
		// TODO: Fill request struct fields.
	}
	resp, err := c.GetEnhancedMeasurementSettings(ctx, req)
	if err != nil {
		// TODO: Handle error.
	}
	// TODO: Use resp.
	_ = resp
}
Output:

func (*AnalyticsAdminClient) GetGlobalSiteTag

GetGlobalSiteTag returns the Site Tag for the specified web stream. Site Tags are immutable singletons.

Example
package main

import (
	"context"

	admin "cloud.google.com/go/analytics/admin/apiv1alpha"

	adminpb "google.golang.org/genproto/googleapis/analytics/admin/v1alpha"
)

func main() {
	// import adminpb "google.golang.org/genproto/googleapis/analytics/admin/v1alpha"

	ctx := context.Background()
	c, err := admin.NewAnalyticsAdminClient(ctx)
	if err != nil {
		// TODO: Handle error.
	}

	req := &adminpb.GetGlobalSiteTagRequest{
		// TODO: Fill request struct fields.
	}
	resp, err := c.GetGlobalSiteTag(ctx, req)
	if err != nil {
		// TODO: Handle error.
	}
	// TODO: Use resp.
	_ = resp
}
Output:

func (*AnalyticsAdminClient) GetIosAppDataStream

GetIosAppDataStream lookup for a single IosAppDataStream

Throws “Target not found” if no such iOS app data stream found, or if the caller does not have permissions to access it.

Example
package main

import (
	"context"

	admin "cloud.google.com/go/analytics/admin/apiv1alpha"

	adminpb "google.golang.org/genproto/googleapis/analytics/admin/v1alpha"
)

func main() {
	// import adminpb "google.golang.org/genproto/googleapis/analytics/admin/v1alpha"

	ctx := context.Background()
	c, err := admin.NewAnalyticsAdminClient(ctx)
	if err != nil {
		// TODO: Handle error.
	}

	req := &adminpb.GetIosAppDataStreamRequest{
		// TODO: Fill request struct fields.
	}
	resp, err := c.GetIosAppDataStream(ctx, req)
	if err != nil {
		// TODO: Handle error.
	}
	// TODO: Use resp.
	_ = resp
}
Output:

func (*AnalyticsAdminClient) GetProperty

GetProperty lookup for a single “GA4” Property.

Throws “Target not found” if no such property found, if property is not of the type “GA4”, or if caller does not have permissions to access it.

Example
package main

import (
	"context"

	admin "cloud.google.com/go/analytics/admin/apiv1alpha"

	adminpb "google.golang.org/genproto/googleapis/analytics/admin/v1alpha"
)

func main() {
	// import adminpb "google.golang.org/genproto/googleapis/analytics/admin/v1alpha"

	ctx := context.Background()
	c, err := admin.NewAnalyticsAdminClient(ctx)
	if err != nil {
		// TODO: Handle error.
	}

	req := &adminpb.GetPropertyRequest{
		// TODO: Fill request struct fields.
	}
	resp, err := c.GetProperty(ctx, req)
	if err != nil {
		// TODO: Handle error.
	}
	// TODO: Use resp.
	_ = resp
}
Output:

GetUserLink gets information about a user’s link to an account or property.

func (*AnalyticsAdminClient) GetWebDataStream

GetWebDataStream lookup for a single WebDataStream

Throws “Target not found” if no such web data stream found, or if the caller does not have permissions to access it.

Example
package main

import (
	"context"

	admin "cloud.google.com/go/analytics/admin/apiv1alpha"

	adminpb "google.golang.org/genproto/googleapis/analytics/admin/v1alpha"
)

func main() {
	// import adminpb "google.golang.org/genproto/googleapis/analytics/admin/v1alpha"

	ctx := context.Background()
	c, err := admin.NewAnalyticsAdminClient(ctx)
	if err != nil {
		// TODO: Handle error.
	}

	req := &adminpb.GetWebDataStreamRequest{
		// TODO: Fill request struct fields.
	}
	resp, err := c.GetWebDataStream(ctx, req)
	if err != nil {
		// TODO: Handle error.
	}
	// TODO: Use resp.
	_ = resp
}
Output:

func (*AnalyticsAdminClient) ListAccountSummaries added in v0.69.0

ListAccountSummaries returns summaries of all accounts accessible by the caller.

Example
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() {
	// import adminpb "google.golang.org/genproto/googleapis/analytics/admin/v1alpha"
	// import "google.golang.org/api/iterator"

	ctx := context.Background()
	c, err := admin.NewAnalyticsAdminClient(ctx)
	if err != nil {
		// TODO: Handle error.
	}

	req := &adminpb.ListAccountSummariesRequest{
		// TODO: Fill request struct fields.
	}
	it := c.ListAccountSummaries(ctx, req)
	for {
		resp, err := it.Next()
		if err == iterator.Done {
			break
		}
		if err != nil {
			// TODO: Handle error.
		}
		// TODO: Use resp.
		_ = resp
	}
}
Output:

func (*AnalyticsAdminClient) ListAccounts

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.

Example
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() {
	// import adminpb "google.golang.org/genproto/googleapis/analytics/admin/v1alpha"
	// import "google.golang.org/api/iterator"

	ctx := context.Background()
	c, err := admin.NewAnalyticsAdminClient(ctx)
	if err != nil {
		// TODO: Handle error.
	}

	req := &adminpb.ListAccountsRequest{
		// TODO: Fill request struct fields.
	}
	it := c.ListAccounts(ctx, req)
	for {
		resp, err := it.Next()
		if err == iterator.Done {
			break
		}
		if err != nil {
			// TODO: Handle error.
		}
		// TODO: Use resp.
		_ = resp
	}
}
Output:

func (*AnalyticsAdminClient) ListAndroidAppDataStreams

ListAndroidAppDataStreams returns child android app streams under the specified parent property.

Android app streams will be excluded if the caller does not have access. Returns an empty list if no relevant android app streams are found.

Example
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() {
	// import adminpb "google.golang.org/genproto/googleapis/analytics/admin/v1alpha"
	// import "google.golang.org/api/iterator"

	ctx := context.Background()
	c, err := admin.NewAnalyticsAdminClient(ctx)
	if err != nil {
		// TODO: Handle error.
	}

	req := &adminpb.ListAndroidAppDataStreamsRequest{
		// TODO: Fill request struct fields.
	}
	it := c.ListAndroidAppDataStreams(ctx, req)
	for {
		resp, err := it.Next()
		if err == iterator.Done {
			break
		}
		if err != nil {
			// TODO: Handle error.
		}
		// TODO: Use resp.
		_ = resp
	}
}
Output:

ListFirebaseLinks lists FirebaseLinks on a property. Properties can have at most one FirebaseLink.

ListGoogleAdsLinks lists GoogleAdsLinks on a property.

func (*AnalyticsAdminClient) ListIosAppDataStreams

ListIosAppDataStreams returns child iOS app data streams under the specified parent property.

iOS app data streams will be excluded if the caller does not have access. Returns an empty list if no relevant iOS app data streams are found.

Example
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() {
	// import adminpb "google.golang.org/genproto/googleapis/analytics/admin/v1alpha"
	// import "google.golang.org/api/iterator"

	ctx := context.Background()
	c, err := admin.NewAnalyticsAdminClient(ctx)
	if err != nil {
		// TODO: Handle error.
	}

	req := &adminpb.ListIosAppDataStreamsRequest{
		// TODO: Fill request struct fields.
	}
	it := c.ListIosAppDataStreams(ctx, req)
	for {
		resp, err := it.Next()
		if err == iterator.Done {
			break
		}
		if err != nil {
			// TODO: Handle error.
		}
		// TODO: Use resp.
		_ = resp
	}
}
Output:

func (*AnalyticsAdminClient) ListProperties

ListProperties returns child Properties under the specified parent Account.

Only “GA4” properties will be returned. Properties will be excluded if the caller does not have access. Soft-deleted (ie: “trashed”) properties are excluded by default. Returns an empty list if no relevant properties are found.

Example
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() {
	// import adminpb "google.golang.org/genproto/googleapis/analytics/admin/v1alpha"
	// import "google.golang.org/api/iterator"

	ctx := context.Background()
	c, err := admin.NewAnalyticsAdminClient(ctx)
	if err != nil {
		// TODO: Handle error.
	}

	req := &adminpb.ListPropertiesRequest{
		// TODO: Fill request struct fields.
	}
	it := c.ListProperties(ctx, req)
	for {
		resp, err := it.Next()
		if err == iterator.Done {
			break
		}
		if err != nil {
			// TODO: Handle error.
		}
		// TODO: Use resp.
		_ = resp
	}
}
Output:

ListUserLinks lists all user links on an account or property.

func (*AnalyticsAdminClient) ListWebDataStreams

ListWebDataStreams returns child web data streams under the specified parent property.

Web data streams will be excluded if the caller does not have access. Returns an empty list if no relevant web data streams are found.

Example
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() {
	// import adminpb "google.golang.org/genproto/googleapis/analytics/admin/v1alpha"
	// import "google.golang.org/api/iterator"

	ctx := context.Background()
	c, err := admin.NewAnalyticsAdminClient(ctx)
	if err != nil {
		// TODO: Handle error.
	}

	req := &adminpb.ListWebDataStreamsRequest{
		// TODO: Fill request struct fields.
	}
	it := c.ListWebDataStreams(ctx, req)
	for {
		resp, err := it.Next()
		if err == iterator.Done {
			break
		}
		if err != nil {
			// TODO: Handle error.
		}
		// TODO: Use resp.
		_ = resp
	}
}
Output:

func (*AnalyticsAdminClient) ProvisionAccountTicket

ProvisionAccountTicket requests a ticket for creating an account.

Example
package main

import (
	"context"

	admin "cloud.google.com/go/analytics/admin/apiv1alpha"

	adminpb "google.golang.org/genproto/googleapis/analytics/admin/v1alpha"
)

func main() {
	// import adminpb "google.golang.org/genproto/googleapis/analytics/admin/v1alpha"

	ctx := context.Background()
	c, err := admin.NewAnalyticsAdminClient(ctx)
	if err != nil {
		// TODO: Handle error.
	}

	req := &adminpb.ProvisionAccountTicketRequest{
		// TODO: Fill request struct fields.
	}
	resp, err := c.ProvisionAccountTicket(ctx, req)
	if err != nil {
		// TODO: Handle error.
	}
	// TODO: Use resp.
	_ = resp
}
Output:

func (*AnalyticsAdminClient) UpdateAccount

UpdateAccount updates an account.

Example
package main

import (
	"context"

	admin "cloud.google.com/go/analytics/admin/apiv1alpha"

	adminpb "google.golang.org/genproto/googleapis/analytics/admin/v1alpha"
)

func main() {
	// import adminpb "google.golang.org/genproto/googleapis/analytics/admin/v1alpha"

	ctx := context.Background()
	c, err := admin.NewAnalyticsAdminClient(ctx)
	if err != nil {
		// TODO: Handle error.
	}

	req := &adminpb.UpdateAccountRequest{
		// TODO: Fill request struct fields.
	}
	resp, err := c.UpdateAccount(ctx, req)
	if err != nil {
		// TODO: Handle error.
	}
	// TODO: Use resp.
	_ = resp
}
Output:

func (*AnalyticsAdminClient) UpdateAndroidAppDataStream

UpdateAndroidAppDataStream updates an android app stream on a property.

Example
package main

import (
	"context"

	admin "cloud.google.com/go/analytics/admin/apiv1alpha"

	adminpb "google.golang.org/genproto/googleapis/analytics/admin/v1alpha"
)

func main() {
	// import adminpb "google.golang.org/genproto/googleapis/analytics/admin/v1alpha"

	ctx := context.Background()
	c, err := admin.NewAnalyticsAdminClient(ctx)
	if err != nil {
		// TODO: Handle error.
	}

	req := &adminpb.UpdateAndroidAppDataStreamRequest{
		// TODO: Fill request struct fields.
	}
	resp, err := c.UpdateAndroidAppDataStream(ctx, req)
	if err != nil {
		// TODO: Handle error.
	}
	// TODO: Use resp.
	_ = resp
}
Output:

func (*AnalyticsAdminClient) UpdateEnhancedMeasurementSettings

UpdateEnhancedMeasurementSettings updates the singleton enhanced measurement settings for this web stream. Note that the stream must enable enhanced measurement for these settings to take effect.

Example
package main

import (
	"context"

	admin "cloud.google.com/go/analytics/admin/apiv1alpha"

	adminpb "google.golang.org/genproto/googleapis/analytics/admin/v1alpha"
)

func main() {
	// import adminpb "google.golang.org/genproto/googleapis/analytics/admin/v1alpha"

	ctx := context.Background()
	c, err := admin.NewAnalyticsAdminClient(ctx)
	if err != nil {
		// TODO: Handle error.
	}

	req := &adminpb.UpdateEnhancedMeasurementSettingsRequest{
		// TODO: Fill request struct fields.
	}
	resp, err := c.UpdateEnhancedMeasurementSettings(ctx, req)
	if err != nil {
		// TODO: Handle error.
	}
	// TODO: Use resp.
	_ = resp
}
Output:

UpdateFirebaseLink updates a FirebaseLink on a property

UpdateGoogleAdsLink updates a GoogleAdsLink on a property

func (*AnalyticsAdminClient) UpdateIosAppDataStream

UpdateIosAppDataStream updates an iOS app stream on a property.

Example
package main

import (
	"context"

	admin "cloud.google.com/go/analytics/admin/apiv1alpha"

	adminpb "google.golang.org/genproto/googleapis/analytics/admin/v1alpha"
)

func main() {
	// import adminpb "google.golang.org/genproto/googleapis/analytics/admin/v1alpha"

	ctx := context.Background()
	c, err := admin.NewAnalyticsAdminClient(ctx)
	if err != nil {
		// TODO: Handle error.
	}

	req := &adminpb.UpdateIosAppDataStreamRequest{
		// TODO: Fill request struct fields.
	}
	resp, err := c.UpdateIosAppDataStream(ctx, req)
	if err != nil {
		// TODO: Handle error.
	}
	// TODO: Use resp.
	_ = resp
}
Output:

func (*AnalyticsAdminClient) UpdateProperty

UpdateProperty updates a property.

Example
package main

import (
	"context"

	admin "cloud.google.com/go/analytics/admin/apiv1alpha"

	adminpb "google.golang.org/genproto/googleapis/analytics/admin/v1alpha"
)

func main() {
	// import adminpb "google.golang.org/genproto/googleapis/analytics/admin/v1alpha"

	ctx := context.Background()
	c, err := admin.NewAnalyticsAdminClient(ctx)
	if err != nil {
		// TODO: Handle error.
	}

	req := &adminpb.UpdatePropertyRequest{
		// TODO: Fill request struct fields.
	}
	resp, err := c.UpdateProperty(ctx, req)
	if err != nil {
		// TODO: Handle error.
	}
	// TODO: Use resp.
	_ = resp
}
Output:

UpdateUserLink updates a user link on an account or property.

func (*AnalyticsAdminClient) UpdateWebDataStream

UpdateWebDataStream updates a web stream on a property.

Example
package main

import (
	"context"

	admin "cloud.google.com/go/analytics/admin/apiv1alpha"

	adminpb "google.golang.org/genproto/googleapis/analytics/admin/v1alpha"
)

func main() {
	// import adminpb "google.golang.org/genproto/googleapis/analytics/admin/v1alpha"

	ctx := context.Background()
	c, err := admin.NewAnalyticsAdminClient(ctx)
	if err != nil {
		// TODO: Handle error.
	}

	req := &adminpb.UpdateWebDataStreamRequest{
		// TODO: Fill request struct fields.
	}
	resp, err := c.UpdateWebDataStream(ctx, req)
	if err != nil {
		// TODO: Handle error.
	}
	// TODO: Use resp.
	_ = resp
}
Output:

type AndroidAppDataStreamIterator

type AndroidAppDataStreamIterator struct {

	// 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.AndroidAppDataStream, nextPageToken string, err error)
	// contains filtered or unexported fields
}

AndroidAppDataStreamIterator manages a stream of *adminpb.AndroidAppDataStream.

func (*AndroidAppDataStreamIterator) Next

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 (*AndroidAppDataStreamIterator) PageInfo

PageInfo supports pagination. See the google.golang.org/api/iterator package for details.

type AuditUserLinkIterator

type AuditUserLinkIterator struct {

	// 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.AuditUserLink, nextPageToken string, err error)
	// contains filtered or unexported fields
}

AuditUserLinkIterator manages a stream of *adminpb.AuditUserLink.

func (*AuditUserLinkIterator) Next

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 (*AuditUserLinkIterator) PageInfo

func (it *AuditUserLinkIterator) PageInfo() *iterator.PageInfo

PageInfo supports pagination. See the google.golang.org/api/iterator package for details.

type GoogleAdsLinkIterator

type GoogleAdsLinkIterator struct {

	// 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.GoogleAdsLink, nextPageToken string, err error)
	// contains filtered or unexported fields
}

GoogleAdsLinkIterator manages a stream of *adminpb.GoogleAdsLink.

func (*GoogleAdsLinkIterator) Next

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 (*GoogleAdsLinkIterator) PageInfo

func (it *GoogleAdsLinkIterator) PageInfo() *iterator.PageInfo

PageInfo supports pagination. See the google.golang.org/api/iterator package for details.

type IosAppDataStreamIterator

type IosAppDataStreamIterator struct {

	// 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.IosAppDataStream, nextPageToken string, err error)
	// contains filtered or unexported fields
}

IosAppDataStreamIterator manages a stream of *adminpb.IosAppDataStream.

func (*IosAppDataStreamIterator) Next

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 (*IosAppDataStreamIterator) PageInfo

func (it *IosAppDataStreamIterator) PageInfo() *iterator.PageInfo

PageInfo supports pagination. See the google.golang.org/api/iterator package for details.

type PropertyIterator

type PropertyIterator struct {

	// 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.Property, nextPageToken string, err error)
	// contains filtered or unexported fields
}

PropertyIterator manages a stream of *adminpb.Property.

func (*PropertyIterator) Next

func (it *PropertyIterator) Next() (*adminpb.Property, error)

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 (*PropertyIterator) PageInfo

func (it *PropertyIterator) PageInfo() *iterator.PageInfo

PageInfo supports pagination. See the google.golang.org/api/iterator package for details.

type UserLinkIterator

type UserLinkIterator struct {

	// 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.UserLink, nextPageToken string, err error)
	// contains filtered or unexported fields
}

UserLinkIterator manages a stream of *adminpb.UserLink.

func (*UserLinkIterator) Next

func (it *UserLinkIterator) Next() (*adminpb.UserLink, error)

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 (*UserLinkIterator) PageInfo

func (it *UserLinkIterator) PageInfo() *iterator.PageInfo

PageInfo supports pagination. See the google.golang.org/api/iterator package for details.

type WebDataStreamIterator

type WebDataStreamIterator struct {

	// 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.WebDataStream, nextPageToken string, err error)
	// contains filtered or unexported fields
}

WebDataStreamIterator manages a stream of *adminpb.WebDataStream.

func (*WebDataStreamIterator) Next

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 (*WebDataStreamIterator) PageInfo

func (it *WebDataStreamIterator) PageInfo() *iterator.PageInfo

PageInfo supports pagination. See the google.golang.org/api/iterator package for details.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL