google-analytics-admin-v1alpha 0.12.0 → 0.13.0

Sign up to get free protection for your applications and to get access to all the features.
@@ -6654,6 +6654,789 @@ module Google
6654
6654
  raise ::Google::Cloud::Error.from_error(e)
6655
6655
  end
6656
6656
 
6657
+ ##
6658
+ # Lookup for a single Audience.
6659
+ # Audiences created before 2020 may not be supported.
6660
+ #
6661
+ # @overload get_audience(request, options = nil)
6662
+ # Pass arguments to `get_audience` via a request object, either of type
6663
+ # {::Google::Analytics::Admin::V1alpha::GetAudienceRequest} or an equivalent Hash.
6664
+ #
6665
+ # @param request [::Google::Analytics::Admin::V1alpha::GetAudienceRequest, ::Hash]
6666
+ # A request object representing the call parameters. Required. To specify no
6667
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
6668
+ # @param options [::Gapic::CallOptions, ::Hash]
6669
+ # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
6670
+ #
6671
+ # @overload get_audience(name: nil)
6672
+ # Pass arguments to `get_audience` via keyword arguments. Note that at
6673
+ # least one keyword argument is required. To specify no parameters, or to keep all
6674
+ # the default parameter values, pass an empty Hash as a request object (see above).
6675
+ #
6676
+ # @param name [::String]
6677
+ # Required. The name of the Audience to get.
6678
+ # Example format: properties/1234/audiences/5678
6679
+ #
6680
+ # @yield [response, operation] Access the result along with the RPC operation
6681
+ # @yieldparam response [::Google::Analytics::Admin::V1alpha::Audience]
6682
+ # @yieldparam operation [::GRPC::ActiveCall::Operation]
6683
+ #
6684
+ # @return [::Google::Analytics::Admin::V1alpha::Audience]
6685
+ #
6686
+ # @raise [::Google::Cloud::Error] if the RPC is aborted.
6687
+ #
6688
+ # @example Basic example
6689
+ # require "google/analytics/admin/v1alpha"
6690
+ #
6691
+ # # Create a client object. The client can be reused for multiple calls.
6692
+ # client = Google::Analytics::Admin::V1alpha::AnalyticsAdminService::Client.new
6693
+ #
6694
+ # # Create a request. To set request fields, pass in keyword arguments.
6695
+ # request = Google::Analytics::Admin::V1alpha::GetAudienceRequest.new
6696
+ #
6697
+ # # Call the get_audience method.
6698
+ # result = client.get_audience request
6699
+ #
6700
+ # # The returned object is of type Google::Analytics::Admin::V1alpha::Audience.
6701
+ # p result
6702
+ #
6703
+ def get_audience request, options = nil
6704
+ raise ::ArgumentError, "request must be provided" if request.nil?
6705
+
6706
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Analytics::Admin::V1alpha::GetAudienceRequest
6707
+
6708
+ # Converts hash and nil to an options object
6709
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
6710
+
6711
+ # Customize the options with defaults
6712
+ metadata = @config.rpcs.get_audience.metadata.to_h
6713
+
6714
+ # Set x-goog-api-client and x-goog-user-project headers
6715
+ metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
6716
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
6717
+ gapic_version: ::Google::Analytics::Admin::V1alpha::VERSION
6718
+ metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
6719
+
6720
+ header_params = {}
6721
+ if request.name
6722
+ header_params["name"] = request.name
6723
+ end
6724
+
6725
+ request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
6726
+ metadata[:"x-goog-request-params"] ||= request_params_header
6727
+
6728
+ options.apply_defaults timeout: @config.rpcs.get_audience.timeout,
6729
+ metadata: metadata,
6730
+ retry_policy: @config.rpcs.get_audience.retry_policy
6731
+
6732
+ options.apply_defaults timeout: @config.timeout,
6733
+ metadata: @config.metadata,
6734
+ retry_policy: @config.retry_policy
6735
+
6736
+ @analytics_admin_service_stub.call_rpc :get_audience, request, options: options do |response, operation|
6737
+ yield response, operation if block_given?
6738
+ return response
6739
+ end
6740
+ rescue ::GRPC::BadStatus => e
6741
+ raise ::Google::Cloud::Error.from_error(e)
6742
+ end
6743
+
6744
+ ##
6745
+ # Lists Audiences on a property.
6746
+ # Audiences created before 2020 may not be supported.
6747
+ #
6748
+ # @overload list_audiences(request, options = nil)
6749
+ # Pass arguments to `list_audiences` via a request object, either of type
6750
+ # {::Google::Analytics::Admin::V1alpha::ListAudiencesRequest} or an equivalent Hash.
6751
+ #
6752
+ # @param request [::Google::Analytics::Admin::V1alpha::ListAudiencesRequest, ::Hash]
6753
+ # A request object representing the call parameters. Required. To specify no
6754
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
6755
+ # @param options [::Gapic::CallOptions, ::Hash]
6756
+ # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
6757
+ #
6758
+ # @overload list_audiences(parent: nil, page_size: nil, page_token: nil)
6759
+ # Pass arguments to `list_audiences` via keyword arguments. Note that at
6760
+ # least one keyword argument is required. To specify no parameters, or to keep all
6761
+ # the default parameter values, pass an empty Hash as a request object (see above).
6762
+ #
6763
+ # @param parent [::String]
6764
+ # Required. Example format: properties/1234
6765
+ # @param page_size [::Integer]
6766
+ # The maximum number of resources to return.
6767
+ # If unspecified, at most 50 resources will be returned.
6768
+ # The maximum value is 200 (higher values will be coerced to the maximum).
6769
+ # @param page_token [::String]
6770
+ # A page token, received from a previous `ListAudiences` call. Provide this
6771
+ # to retrieve the subsequent page.
6772
+ #
6773
+ # When paginating, all other parameters provided to `ListAudiences` must
6774
+ # match the call that provided the page token.
6775
+ #
6776
+ # @yield [response, operation] Access the result along with the RPC operation
6777
+ # @yieldparam response [::Gapic::PagedEnumerable<::Google::Analytics::Admin::V1alpha::Audience>]
6778
+ # @yieldparam operation [::GRPC::ActiveCall::Operation]
6779
+ #
6780
+ # @return [::Gapic::PagedEnumerable<::Google::Analytics::Admin::V1alpha::Audience>]
6781
+ #
6782
+ # @raise [::Google::Cloud::Error] if the RPC is aborted.
6783
+ #
6784
+ # @example Basic example
6785
+ # require "google/analytics/admin/v1alpha"
6786
+ #
6787
+ # # Create a client object. The client can be reused for multiple calls.
6788
+ # client = Google::Analytics::Admin::V1alpha::AnalyticsAdminService::Client.new
6789
+ #
6790
+ # # Create a request. To set request fields, pass in keyword arguments.
6791
+ # request = Google::Analytics::Admin::V1alpha::ListAudiencesRequest.new
6792
+ #
6793
+ # # Call the list_audiences method.
6794
+ # result = client.list_audiences request
6795
+ #
6796
+ # # The returned object is of type Gapic::PagedEnumerable. You can
6797
+ # # iterate over all elements by calling #each, and the enumerable
6798
+ # # will lazily make API calls to fetch subsequent pages. Other
6799
+ # # methods are also available for managing paging directly.
6800
+ # result.each do |response|
6801
+ # # Each element is of type ::Google::Analytics::Admin::V1alpha::Audience.
6802
+ # p response
6803
+ # end
6804
+ #
6805
+ def list_audiences request, options = nil
6806
+ raise ::ArgumentError, "request must be provided" if request.nil?
6807
+
6808
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Analytics::Admin::V1alpha::ListAudiencesRequest
6809
+
6810
+ # Converts hash and nil to an options object
6811
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
6812
+
6813
+ # Customize the options with defaults
6814
+ metadata = @config.rpcs.list_audiences.metadata.to_h
6815
+
6816
+ # Set x-goog-api-client and x-goog-user-project headers
6817
+ metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
6818
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
6819
+ gapic_version: ::Google::Analytics::Admin::V1alpha::VERSION
6820
+ metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
6821
+
6822
+ header_params = {}
6823
+ if request.parent
6824
+ header_params["parent"] = request.parent
6825
+ end
6826
+
6827
+ request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
6828
+ metadata[:"x-goog-request-params"] ||= request_params_header
6829
+
6830
+ options.apply_defaults timeout: @config.rpcs.list_audiences.timeout,
6831
+ metadata: metadata,
6832
+ retry_policy: @config.rpcs.list_audiences.retry_policy
6833
+
6834
+ options.apply_defaults timeout: @config.timeout,
6835
+ metadata: @config.metadata,
6836
+ retry_policy: @config.retry_policy
6837
+
6838
+ @analytics_admin_service_stub.call_rpc :list_audiences, request, options: options do |response, operation|
6839
+ response = ::Gapic::PagedEnumerable.new @analytics_admin_service_stub, :list_audiences, request, response, operation, options
6840
+ yield response, operation if block_given?
6841
+ return response
6842
+ end
6843
+ rescue ::GRPC::BadStatus => e
6844
+ raise ::Google::Cloud::Error.from_error(e)
6845
+ end
6846
+
6847
+ ##
6848
+ # Creates an Audience.
6849
+ #
6850
+ # @overload create_audience(request, options = nil)
6851
+ # Pass arguments to `create_audience` via a request object, either of type
6852
+ # {::Google::Analytics::Admin::V1alpha::CreateAudienceRequest} or an equivalent Hash.
6853
+ #
6854
+ # @param request [::Google::Analytics::Admin::V1alpha::CreateAudienceRequest, ::Hash]
6855
+ # A request object representing the call parameters. Required. To specify no
6856
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
6857
+ # @param options [::Gapic::CallOptions, ::Hash]
6858
+ # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
6859
+ #
6860
+ # @overload create_audience(parent: nil, audience: nil)
6861
+ # Pass arguments to `create_audience` via keyword arguments. Note that at
6862
+ # least one keyword argument is required. To specify no parameters, or to keep all
6863
+ # the default parameter values, pass an empty Hash as a request object (see above).
6864
+ #
6865
+ # @param parent [::String]
6866
+ # Required. Example format: properties/1234
6867
+ # @param audience [::Google::Analytics::Admin::V1alpha::Audience, ::Hash]
6868
+ # Required. The audience to create.
6869
+ #
6870
+ # @yield [response, operation] Access the result along with the RPC operation
6871
+ # @yieldparam response [::Google::Analytics::Admin::V1alpha::Audience]
6872
+ # @yieldparam operation [::GRPC::ActiveCall::Operation]
6873
+ #
6874
+ # @return [::Google::Analytics::Admin::V1alpha::Audience]
6875
+ #
6876
+ # @raise [::Google::Cloud::Error] if the RPC is aborted.
6877
+ #
6878
+ # @example Basic example
6879
+ # require "google/analytics/admin/v1alpha"
6880
+ #
6881
+ # # Create a client object. The client can be reused for multiple calls.
6882
+ # client = Google::Analytics::Admin::V1alpha::AnalyticsAdminService::Client.new
6883
+ #
6884
+ # # Create a request. To set request fields, pass in keyword arguments.
6885
+ # request = Google::Analytics::Admin::V1alpha::CreateAudienceRequest.new
6886
+ #
6887
+ # # Call the create_audience method.
6888
+ # result = client.create_audience request
6889
+ #
6890
+ # # The returned object is of type Google::Analytics::Admin::V1alpha::Audience.
6891
+ # p result
6892
+ #
6893
+ def create_audience request, options = nil
6894
+ raise ::ArgumentError, "request must be provided" if request.nil?
6895
+
6896
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Analytics::Admin::V1alpha::CreateAudienceRequest
6897
+
6898
+ # Converts hash and nil to an options object
6899
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
6900
+
6901
+ # Customize the options with defaults
6902
+ metadata = @config.rpcs.create_audience.metadata.to_h
6903
+
6904
+ # Set x-goog-api-client and x-goog-user-project headers
6905
+ metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
6906
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
6907
+ gapic_version: ::Google::Analytics::Admin::V1alpha::VERSION
6908
+ metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
6909
+
6910
+ header_params = {}
6911
+ if request.parent
6912
+ header_params["parent"] = request.parent
6913
+ end
6914
+
6915
+ request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
6916
+ metadata[:"x-goog-request-params"] ||= request_params_header
6917
+
6918
+ options.apply_defaults timeout: @config.rpcs.create_audience.timeout,
6919
+ metadata: metadata,
6920
+ retry_policy: @config.rpcs.create_audience.retry_policy
6921
+
6922
+ options.apply_defaults timeout: @config.timeout,
6923
+ metadata: @config.metadata,
6924
+ retry_policy: @config.retry_policy
6925
+
6926
+ @analytics_admin_service_stub.call_rpc :create_audience, request, options: options do |response, operation|
6927
+ yield response, operation if block_given?
6928
+ return response
6929
+ end
6930
+ rescue ::GRPC::BadStatus => e
6931
+ raise ::Google::Cloud::Error.from_error(e)
6932
+ end
6933
+
6934
+ ##
6935
+ # Updates an Audience on a property.
6936
+ #
6937
+ # @overload update_audience(request, options = nil)
6938
+ # Pass arguments to `update_audience` via a request object, either of type
6939
+ # {::Google::Analytics::Admin::V1alpha::UpdateAudienceRequest} or an equivalent Hash.
6940
+ #
6941
+ # @param request [::Google::Analytics::Admin::V1alpha::UpdateAudienceRequest, ::Hash]
6942
+ # A request object representing the call parameters. Required. To specify no
6943
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
6944
+ # @param options [::Gapic::CallOptions, ::Hash]
6945
+ # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
6946
+ #
6947
+ # @overload update_audience(audience: nil, update_mask: nil)
6948
+ # Pass arguments to `update_audience` via keyword arguments. Note that at
6949
+ # least one keyword argument is required. To specify no parameters, or to keep all
6950
+ # the default parameter values, pass an empty Hash as a request object (see above).
6951
+ #
6952
+ # @param audience [::Google::Analytics::Admin::V1alpha::Audience, ::Hash]
6953
+ # Required. The audience to update.
6954
+ # The audience's `name` field is used to identify the audience to be updated.
6955
+ # @param update_mask [::Google::Protobuf::FieldMask, ::Hash]
6956
+ # Required. The list of fields to be updated. Field names must be in snake case
6957
+ # (e.g., "field_to_update"). Omitted fields will not be updated. To replace
6958
+ # the entire entity, use one path with the string "*" to match all fields.
6959
+ #
6960
+ # @yield [response, operation] Access the result along with the RPC operation
6961
+ # @yieldparam response [::Google::Analytics::Admin::V1alpha::Audience]
6962
+ # @yieldparam operation [::GRPC::ActiveCall::Operation]
6963
+ #
6964
+ # @return [::Google::Analytics::Admin::V1alpha::Audience]
6965
+ #
6966
+ # @raise [::Google::Cloud::Error] if the RPC is aborted.
6967
+ #
6968
+ # @example Basic example
6969
+ # require "google/analytics/admin/v1alpha"
6970
+ #
6971
+ # # Create a client object. The client can be reused for multiple calls.
6972
+ # client = Google::Analytics::Admin::V1alpha::AnalyticsAdminService::Client.new
6973
+ #
6974
+ # # Create a request. To set request fields, pass in keyword arguments.
6975
+ # request = Google::Analytics::Admin::V1alpha::UpdateAudienceRequest.new
6976
+ #
6977
+ # # Call the update_audience method.
6978
+ # result = client.update_audience request
6979
+ #
6980
+ # # The returned object is of type Google::Analytics::Admin::V1alpha::Audience.
6981
+ # p result
6982
+ #
6983
+ def update_audience request, options = nil
6984
+ raise ::ArgumentError, "request must be provided" if request.nil?
6985
+
6986
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Analytics::Admin::V1alpha::UpdateAudienceRequest
6987
+
6988
+ # Converts hash and nil to an options object
6989
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
6990
+
6991
+ # Customize the options with defaults
6992
+ metadata = @config.rpcs.update_audience.metadata.to_h
6993
+
6994
+ # Set x-goog-api-client and x-goog-user-project headers
6995
+ metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
6996
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
6997
+ gapic_version: ::Google::Analytics::Admin::V1alpha::VERSION
6998
+ metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
6999
+
7000
+ header_params = {}
7001
+ if request.audience&.name
7002
+ header_params["audience.name"] = request.audience.name
7003
+ end
7004
+
7005
+ request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
7006
+ metadata[:"x-goog-request-params"] ||= request_params_header
7007
+
7008
+ options.apply_defaults timeout: @config.rpcs.update_audience.timeout,
7009
+ metadata: metadata,
7010
+ retry_policy: @config.rpcs.update_audience.retry_policy
7011
+
7012
+ options.apply_defaults timeout: @config.timeout,
7013
+ metadata: @config.metadata,
7014
+ retry_policy: @config.retry_policy
7015
+
7016
+ @analytics_admin_service_stub.call_rpc :update_audience, request, options: options do |response, operation|
7017
+ yield response, operation if block_given?
7018
+ return response
7019
+ end
7020
+ rescue ::GRPC::BadStatus => e
7021
+ raise ::Google::Cloud::Error.from_error(e)
7022
+ end
7023
+
7024
+ ##
7025
+ # Archives an Audience on a property.
7026
+ #
7027
+ # @overload archive_audience(request, options = nil)
7028
+ # Pass arguments to `archive_audience` via a request object, either of type
7029
+ # {::Google::Analytics::Admin::V1alpha::ArchiveAudienceRequest} or an equivalent Hash.
7030
+ #
7031
+ # @param request [::Google::Analytics::Admin::V1alpha::ArchiveAudienceRequest, ::Hash]
7032
+ # A request object representing the call parameters. Required. To specify no
7033
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
7034
+ # @param options [::Gapic::CallOptions, ::Hash]
7035
+ # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
7036
+ #
7037
+ # @overload archive_audience(name: nil)
7038
+ # Pass arguments to `archive_audience` via keyword arguments. Note that at
7039
+ # least one keyword argument is required. To specify no parameters, or to keep all
7040
+ # the default parameter values, pass an empty Hash as a request object (see above).
7041
+ #
7042
+ # @param name [::String]
7043
+ # Required. Example format: properties/1234/audiences/5678
7044
+ #
7045
+ # @yield [response, operation] Access the result along with the RPC operation
7046
+ # @yieldparam response [::Google::Protobuf::Empty]
7047
+ # @yieldparam operation [::GRPC::ActiveCall::Operation]
7048
+ #
7049
+ # @return [::Google::Protobuf::Empty]
7050
+ #
7051
+ # @raise [::Google::Cloud::Error] if the RPC is aborted.
7052
+ #
7053
+ # @example Basic example
7054
+ # require "google/analytics/admin/v1alpha"
7055
+ #
7056
+ # # Create a client object. The client can be reused for multiple calls.
7057
+ # client = Google::Analytics::Admin::V1alpha::AnalyticsAdminService::Client.new
7058
+ #
7059
+ # # Create a request. To set request fields, pass in keyword arguments.
7060
+ # request = Google::Analytics::Admin::V1alpha::ArchiveAudienceRequest.new
7061
+ #
7062
+ # # Call the archive_audience method.
7063
+ # result = client.archive_audience request
7064
+ #
7065
+ # # The returned object is of type Google::Protobuf::Empty.
7066
+ # p result
7067
+ #
7068
+ def archive_audience request, options = nil
7069
+ raise ::ArgumentError, "request must be provided" if request.nil?
7070
+
7071
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Analytics::Admin::V1alpha::ArchiveAudienceRequest
7072
+
7073
+ # Converts hash and nil to an options object
7074
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
7075
+
7076
+ # Customize the options with defaults
7077
+ metadata = @config.rpcs.archive_audience.metadata.to_h
7078
+
7079
+ # Set x-goog-api-client and x-goog-user-project headers
7080
+ metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
7081
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
7082
+ gapic_version: ::Google::Analytics::Admin::V1alpha::VERSION
7083
+ metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
7084
+
7085
+ header_params = {}
7086
+ if request.name
7087
+ header_params["name"] = request.name
7088
+ end
7089
+
7090
+ request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
7091
+ metadata[:"x-goog-request-params"] ||= request_params_header
7092
+
7093
+ options.apply_defaults timeout: @config.rpcs.archive_audience.timeout,
7094
+ metadata: metadata,
7095
+ retry_policy: @config.rpcs.archive_audience.retry_policy
7096
+
7097
+ options.apply_defaults timeout: @config.timeout,
7098
+ metadata: @config.metadata,
7099
+ retry_policy: @config.retry_policy
7100
+
7101
+ @analytics_admin_service_stub.call_rpc :archive_audience, request, options: options do |response, operation|
7102
+ yield response, operation if block_given?
7103
+ return response
7104
+ end
7105
+ rescue ::GRPC::BadStatus => e
7106
+ raise ::Google::Cloud::Error.from_error(e)
7107
+ end
7108
+
7109
+ ##
7110
+ # Lookup for a AttributionSettings singleton.
7111
+ #
7112
+ # @overload get_attribution_settings(request, options = nil)
7113
+ # Pass arguments to `get_attribution_settings` via a request object, either of type
7114
+ # {::Google::Analytics::Admin::V1alpha::GetAttributionSettingsRequest} or an equivalent Hash.
7115
+ #
7116
+ # @param request [::Google::Analytics::Admin::V1alpha::GetAttributionSettingsRequest, ::Hash]
7117
+ # A request object representing the call parameters. Required. To specify no
7118
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
7119
+ # @param options [::Gapic::CallOptions, ::Hash]
7120
+ # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
7121
+ #
7122
+ # @overload get_attribution_settings(name: nil)
7123
+ # Pass arguments to `get_attribution_settings` via keyword arguments. Note that at
7124
+ # least one keyword argument is required. To specify no parameters, or to keep all
7125
+ # the default parameter values, pass an empty Hash as a request object (see above).
7126
+ #
7127
+ # @param name [::String]
7128
+ # Required. The name of the attribution settings to retrieve.
7129
+ # Format: properties/\\{property}/attributionSettings
7130
+ #
7131
+ # @yield [response, operation] Access the result along with the RPC operation
7132
+ # @yieldparam response [::Google::Analytics::Admin::V1alpha::AttributionSettings]
7133
+ # @yieldparam operation [::GRPC::ActiveCall::Operation]
7134
+ #
7135
+ # @return [::Google::Analytics::Admin::V1alpha::AttributionSettings]
7136
+ #
7137
+ # @raise [::Google::Cloud::Error] if the RPC is aborted.
7138
+ #
7139
+ # @example Basic example
7140
+ # require "google/analytics/admin/v1alpha"
7141
+ #
7142
+ # # Create a client object. The client can be reused for multiple calls.
7143
+ # client = Google::Analytics::Admin::V1alpha::AnalyticsAdminService::Client.new
7144
+ #
7145
+ # # Create a request. To set request fields, pass in keyword arguments.
7146
+ # request = Google::Analytics::Admin::V1alpha::GetAttributionSettingsRequest.new
7147
+ #
7148
+ # # Call the get_attribution_settings method.
7149
+ # result = client.get_attribution_settings request
7150
+ #
7151
+ # # The returned object is of type Google::Analytics::Admin::V1alpha::AttributionSettings.
7152
+ # p result
7153
+ #
7154
+ def get_attribution_settings request, options = nil
7155
+ raise ::ArgumentError, "request must be provided" if request.nil?
7156
+
7157
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Analytics::Admin::V1alpha::GetAttributionSettingsRequest
7158
+
7159
+ # Converts hash and nil to an options object
7160
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
7161
+
7162
+ # Customize the options with defaults
7163
+ metadata = @config.rpcs.get_attribution_settings.metadata.to_h
7164
+
7165
+ # Set x-goog-api-client and x-goog-user-project headers
7166
+ metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
7167
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
7168
+ gapic_version: ::Google::Analytics::Admin::V1alpha::VERSION
7169
+ metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
7170
+
7171
+ header_params = {}
7172
+ if request.name
7173
+ header_params["name"] = request.name
7174
+ end
7175
+
7176
+ request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
7177
+ metadata[:"x-goog-request-params"] ||= request_params_header
7178
+
7179
+ options.apply_defaults timeout: @config.rpcs.get_attribution_settings.timeout,
7180
+ metadata: metadata,
7181
+ retry_policy: @config.rpcs.get_attribution_settings.retry_policy
7182
+
7183
+ options.apply_defaults timeout: @config.timeout,
7184
+ metadata: @config.metadata,
7185
+ retry_policy: @config.retry_policy
7186
+
7187
+ @analytics_admin_service_stub.call_rpc :get_attribution_settings, request, options: options do |response, operation|
7188
+ yield response, operation if block_given?
7189
+ return response
7190
+ end
7191
+ rescue ::GRPC::BadStatus => e
7192
+ raise ::Google::Cloud::Error.from_error(e)
7193
+ end
7194
+
7195
+ ##
7196
+ # Updates attribution settings on a property.
7197
+ #
7198
+ # @overload update_attribution_settings(request, options = nil)
7199
+ # Pass arguments to `update_attribution_settings` via a request object, either of type
7200
+ # {::Google::Analytics::Admin::V1alpha::UpdateAttributionSettingsRequest} or an equivalent Hash.
7201
+ #
7202
+ # @param request [::Google::Analytics::Admin::V1alpha::UpdateAttributionSettingsRequest, ::Hash]
7203
+ # A request object representing the call parameters. Required. To specify no
7204
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
7205
+ # @param options [::Gapic::CallOptions, ::Hash]
7206
+ # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
7207
+ #
7208
+ # @overload update_attribution_settings(attribution_settings: nil, update_mask: nil)
7209
+ # Pass arguments to `update_attribution_settings` via keyword arguments. Note that at
7210
+ # least one keyword argument is required. To specify no parameters, or to keep all
7211
+ # the default parameter values, pass an empty Hash as a request object (see above).
7212
+ #
7213
+ # @param attribution_settings [::Google::Analytics::Admin::V1alpha::AttributionSettings, ::Hash]
7214
+ # Required. The attribution settings to update.
7215
+ # The `name` field is used to identify the settings to be updated.
7216
+ # @param update_mask [::Google::Protobuf::FieldMask, ::Hash]
7217
+ # Required. The list of fields to be updated. Field names must be in snake case
7218
+ # (e.g., "field_to_update"). Omitted fields will not be updated. To replace
7219
+ # the entire entity, use one path with the string "*" to match all fields.
7220
+ #
7221
+ # @yield [response, operation] Access the result along with the RPC operation
7222
+ # @yieldparam response [::Google::Analytics::Admin::V1alpha::AttributionSettings]
7223
+ # @yieldparam operation [::GRPC::ActiveCall::Operation]
7224
+ #
7225
+ # @return [::Google::Analytics::Admin::V1alpha::AttributionSettings]
7226
+ #
7227
+ # @raise [::Google::Cloud::Error] if the RPC is aborted.
7228
+ #
7229
+ # @example Basic example
7230
+ # require "google/analytics/admin/v1alpha"
7231
+ #
7232
+ # # Create a client object. The client can be reused for multiple calls.
7233
+ # client = Google::Analytics::Admin::V1alpha::AnalyticsAdminService::Client.new
7234
+ #
7235
+ # # Create a request. To set request fields, pass in keyword arguments.
7236
+ # request = Google::Analytics::Admin::V1alpha::UpdateAttributionSettingsRequest.new
7237
+ #
7238
+ # # Call the update_attribution_settings method.
7239
+ # result = client.update_attribution_settings request
7240
+ #
7241
+ # # The returned object is of type Google::Analytics::Admin::V1alpha::AttributionSettings.
7242
+ # p result
7243
+ #
7244
+ def update_attribution_settings request, options = nil
7245
+ raise ::ArgumentError, "request must be provided" if request.nil?
7246
+
7247
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Analytics::Admin::V1alpha::UpdateAttributionSettingsRequest
7248
+
7249
+ # Converts hash and nil to an options object
7250
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
7251
+
7252
+ # Customize the options with defaults
7253
+ metadata = @config.rpcs.update_attribution_settings.metadata.to_h
7254
+
7255
+ # Set x-goog-api-client and x-goog-user-project headers
7256
+ metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
7257
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
7258
+ gapic_version: ::Google::Analytics::Admin::V1alpha::VERSION
7259
+ metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
7260
+
7261
+ header_params = {}
7262
+ if request.attribution_settings&.name
7263
+ header_params["attribution_settings.name"] = request.attribution_settings.name
7264
+ end
7265
+
7266
+ request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
7267
+ metadata[:"x-goog-request-params"] ||= request_params_header
7268
+
7269
+ options.apply_defaults timeout: @config.rpcs.update_attribution_settings.timeout,
7270
+ metadata: metadata,
7271
+ retry_policy: @config.rpcs.update_attribution_settings.retry_policy
7272
+
7273
+ options.apply_defaults timeout: @config.timeout,
7274
+ metadata: @config.metadata,
7275
+ retry_policy: @config.retry_policy
7276
+
7277
+ @analytics_admin_service_stub.call_rpc :update_attribution_settings, request, options: options do |response, operation|
7278
+ yield response, operation if block_given?
7279
+ return response
7280
+ end
7281
+ rescue ::GRPC::BadStatus => e
7282
+ raise ::Google::Cloud::Error.from_error(e)
7283
+ end
7284
+
7285
+ ##
7286
+ # Returns a customized report of data access records. The report provides
7287
+ # records of each time a user reads Google Analytics reporting data. Access
7288
+ # records are retained for up to 2 years.
7289
+ #
7290
+ # Data Access Reports can be requested for a property. The property must be
7291
+ # in Google Analytics 360. This method is only available to Administrators.
7292
+ #
7293
+ # These data access records include GA4 UI Reporting, GA4 UI Explorations,
7294
+ # GA4 Data API, and other products like Firebase & Admob that can retrieve
7295
+ # data from Google Analytics through a linkage. These records don't include
7296
+ # property configuration changes like adding a stream or changing a
7297
+ # property's time zone. For configuration change history, see
7298
+ # [searchChangeHistoryEvents](https://developers.google.com/analytics/devguides/config/admin/v1/rest/v1alpha/accounts/searchChangeHistoryEvents).
7299
+ #
7300
+ # @overload run_access_report(request, options = nil)
7301
+ # Pass arguments to `run_access_report` via a request object, either of type
7302
+ # {::Google::Analytics::Admin::V1alpha::RunAccessReportRequest} or an equivalent Hash.
7303
+ #
7304
+ # @param request [::Google::Analytics::Admin::V1alpha::RunAccessReportRequest, ::Hash]
7305
+ # A request object representing the call parameters. Required. To specify no
7306
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
7307
+ # @param options [::Gapic::CallOptions, ::Hash]
7308
+ # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
7309
+ #
7310
+ # @overload run_access_report(entity: nil, dimensions: nil, metrics: nil, date_ranges: nil, dimension_filter: nil, metric_filter: nil, offset: nil, limit: nil, time_zone: nil, order_bys: nil, return_entity_quota: nil)
7311
+ # Pass arguments to `run_access_report` via keyword arguments. Note that at
7312
+ # least one keyword argument is required. To specify no parameters, or to keep all
7313
+ # the default parameter values, pass an empty Hash as a request object (see above).
7314
+ #
7315
+ # @param entity [::String]
7316
+ # The Data Access Report is requested for this property.
7317
+ # For example if "123" is your GA4 property ID, then entity should be
7318
+ # "properties/123".
7319
+ # @param dimensions [::Array<::Google::Analytics::Admin::V1alpha::AccessDimension, ::Hash>]
7320
+ # The dimensions requested and displayed in the response. Requests are
7321
+ # allowed up to 9 dimensions.
7322
+ # @param metrics [::Array<::Google::Analytics::Admin::V1alpha::AccessMetric, ::Hash>]
7323
+ # The metrics requested and displayed in the response. Requests are allowed
7324
+ # up to 10 metrics.
7325
+ # @param date_ranges [::Array<::Google::Analytics::Admin::V1alpha::AccessDateRange, ::Hash>]
7326
+ # Date ranges of access records to read. If multiple date ranges are
7327
+ # requested, each response row will contain a zero based date range index. If
7328
+ # two date ranges overlap, the access records for the overlapping days is
7329
+ # included in the response rows for both date ranges. Requests are allowed up
7330
+ # to 2 date ranges.
7331
+ # @param dimension_filter [::Google::Analytics::Admin::V1alpha::AccessFilterExpression, ::Hash]
7332
+ # Dimension filters allow you to restrict report response to specific
7333
+ # dimension values which match the filter. For example, filtering on access
7334
+ # records of a single user. To learn more, see [Fundamentals of Dimension
7335
+ # Filters](https://developers.google.com/analytics/devguides/reporting/data/v1/basics#dimension_filters)
7336
+ # for examples. Metrics cannot be used in this filter.
7337
+ # @param metric_filter [::Google::Analytics::Admin::V1alpha::AccessFilterExpression, ::Hash]
7338
+ # Metric filters allow you to restrict report response to specific metric
7339
+ # values which match the filter. Metric filters are applied after aggregating
7340
+ # the report's rows, similar to SQL having-clause. Dimensions cannot be used
7341
+ # in this filter.
7342
+ # @param offset [::Integer]
7343
+ # The row count of the start row. The first row is counted as row 0. If
7344
+ # offset is unspecified, it is treated as 0. If offset is zero, then this
7345
+ # method will return the first page of results with `limit` entries.
7346
+ #
7347
+ # To learn more about this pagination parameter, see
7348
+ # [Pagination](https://developers.google.com/analytics/devguides/reporting/data/v1/basics#pagination).
7349
+ # @param limit [::Integer]
7350
+ # The number of rows to return. If unspecified, 10,000 rows are returned. The
7351
+ # API returns a maximum of 100,000 rows per request, no matter how many you
7352
+ # ask for. `limit` must be positive.
7353
+ #
7354
+ # The API may return fewer rows than the requested `limit`, if there aren't
7355
+ # as many remaining rows as the `limit`. For instance, there are fewer than
7356
+ # 300 possible values for the dimension `country`, so when reporting on only
7357
+ # `country`, you can't get more than 300 rows, even if you set `limit` to a
7358
+ # higher value.
7359
+ #
7360
+ # To learn more about this pagination parameter, see
7361
+ # [Pagination](https://developers.google.com/analytics/devguides/reporting/data/v1/basics#pagination).
7362
+ # @param time_zone [::String]
7363
+ # This request's time zone if specified. If unspecified, the property's time
7364
+ # zone is used. The request's time zone is used to interpret the start & end
7365
+ # dates of the report.
7366
+ #
7367
+ # Formatted as strings from the IANA Time Zone database
7368
+ # (https://www.iana.org/time-zones); for example "America/New_York" or
7369
+ # "Asia/Tokyo".
7370
+ # @param order_bys [::Array<::Google::Analytics::Admin::V1alpha::AccessOrderBy, ::Hash>]
7371
+ # Specifies how rows are ordered in the response.
7372
+ # @param return_entity_quota [::Boolean]
7373
+ # Toggles whether to return the current state of this Analytics Property's
7374
+ # quota. Quota is returned in [AccessQuota](#AccessQuota).
7375
+ #
7376
+ # @yield [response, operation] Access the result along with the RPC operation
7377
+ # @yieldparam response [::Google::Analytics::Admin::V1alpha::RunAccessReportResponse]
7378
+ # @yieldparam operation [::GRPC::ActiveCall::Operation]
7379
+ #
7380
+ # @return [::Google::Analytics::Admin::V1alpha::RunAccessReportResponse]
7381
+ #
7382
+ # @raise [::Google::Cloud::Error] if the RPC is aborted.
7383
+ #
7384
+ # @example Basic example
7385
+ # require "google/analytics/admin/v1alpha"
7386
+ #
7387
+ # # Create a client object. The client can be reused for multiple calls.
7388
+ # client = Google::Analytics::Admin::V1alpha::AnalyticsAdminService::Client.new
7389
+ #
7390
+ # # Create a request. To set request fields, pass in keyword arguments.
7391
+ # request = Google::Analytics::Admin::V1alpha::RunAccessReportRequest.new
7392
+ #
7393
+ # # Call the run_access_report method.
7394
+ # result = client.run_access_report request
7395
+ #
7396
+ # # The returned object is of type Google::Analytics::Admin::V1alpha::RunAccessReportResponse.
7397
+ # p result
7398
+ #
7399
+ def run_access_report request, options = nil
7400
+ raise ::ArgumentError, "request must be provided" if request.nil?
7401
+
7402
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Analytics::Admin::V1alpha::RunAccessReportRequest
7403
+
7404
+ # Converts hash and nil to an options object
7405
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
7406
+
7407
+ # Customize the options with defaults
7408
+ metadata = @config.rpcs.run_access_report.metadata.to_h
7409
+
7410
+ # Set x-goog-api-client and x-goog-user-project headers
7411
+ metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
7412
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
7413
+ gapic_version: ::Google::Analytics::Admin::V1alpha::VERSION
7414
+ metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
7415
+
7416
+ header_params = {}
7417
+ if request.entity
7418
+ header_params["entity"] = request.entity
7419
+ end
7420
+
7421
+ request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
7422
+ metadata[:"x-goog-request-params"] ||= request_params_header
7423
+
7424
+ options.apply_defaults timeout: @config.rpcs.run_access_report.timeout,
7425
+ metadata: metadata,
7426
+ retry_policy: @config.rpcs.run_access_report.retry_policy
7427
+
7428
+ options.apply_defaults timeout: @config.timeout,
7429
+ metadata: @config.metadata,
7430
+ retry_policy: @config.retry_policy
7431
+
7432
+ @analytics_admin_service_stub.call_rpc :run_access_report, request, options: options do |response, operation|
7433
+ yield response, operation if block_given?
7434
+ return response
7435
+ end
7436
+ rescue ::GRPC::BadStatus => e
7437
+ raise ::Google::Cloud::Error.from_error(e)
7438
+ end
7439
+
6657
7440
  ##
6658
7441
  # Configuration class for the AnalyticsAdminService API.
6659
7442
  #
@@ -7144,6 +7927,46 @@ module Google
7144
7927
  # @return [::Gapic::Config::Method]
7145
7928
  #
7146
7929
  attr_reader :get_data_stream
7930
+ ##
7931
+ # RPC-specific configuration for `get_audience`
7932
+ # @return [::Gapic::Config::Method]
7933
+ #
7934
+ attr_reader :get_audience
7935
+ ##
7936
+ # RPC-specific configuration for `list_audiences`
7937
+ # @return [::Gapic::Config::Method]
7938
+ #
7939
+ attr_reader :list_audiences
7940
+ ##
7941
+ # RPC-specific configuration for `create_audience`
7942
+ # @return [::Gapic::Config::Method]
7943
+ #
7944
+ attr_reader :create_audience
7945
+ ##
7946
+ # RPC-specific configuration for `update_audience`
7947
+ # @return [::Gapic::Config::Method]
7948
+ #
7949
+ attr_reader :update_audience
7950
+ ##
7951
+ # RPC-specific configuration for `archive_audience`
7952
+ # @return [::Gapic::Config::Method]
7953
+ #
7954
+ attr_reader :archive_audience
7955
+ ##
7956
+ # RPC-specific configuration for `get_attribution_settings`
7957
+ # @return [::Gapic::Config::Method]
7958
+ #
7959
+ attr_reader :get_attribution_settings
7960
+ ##
7961
+ # RPC-specific configuration for `update_attribution_settings`
7962
+ # @return [::Gapic::Config::Method]
7963
+ #
7964
+ attr_reader :update_attribution_settings
7965
+ ##
7966
+ # RPC-specific configuration for `run_access_report`
7967
+ # @return [::Gapic::Config::Method]
7968
+ #
7969
+ attr_reader :run_access_report
7147
7970
 
7148
7971
  # @private
7149
7972
  def initialize parent_rpcs = nil
@@ -7289,6 +8112,22 @@ module Google
7289
8112
  @list_data_streams = ::Gapic::Config::Method.new list_data_streams_config
7290
8113
  get_data_stream_config = parent_rpcs.get_data_stream if parent_rpcs.respond_to? :get_data_stream
7291
8114
  @get_data_stream = ::Gapic::Config::Method.new get_data_stream_config
8115
+ get_audience_config = parent_rpcs.get_audience if parent_rpcs.respond_to? :get_audience
8116
+ @get_audience = ::Gapic::Config::Method.new get_audience_config
8117
+ list_audiences_config = parent_rpcs.list_audiences if parent_rpcs.respond_to? :list_audiences
8118
+ @list_audiences = ::Gapic::Config::Method.new list_audiences_config
8119
+ create_audience_config = parent_rpcs.create_audience if parent_rpcs.respond_to? :create_audience
8120
+ @create_audience = ::Gapic::Config::Method.new create_audience_config
8121
+ update_audience_config = parent_rpcs.update_audience if parent_rpcs.respond_to? :update_audience
8122
+ @update_audience = ::Gapic::Config::Method.new update_audience_config
8123
+ archive_audience_config = parent_rpcs.archive_audience if parent_rpcs.respond_to? :archive_audience
8124
+ @archive_audience = ::Gapic::Config::Method.new archive_audience_config
8125
+ get_attribution_settings_config = parent_rpcs.get_attribution_settings if parent_rpcs.respond_to? :get_attribution_settings
8126
+ @get_attribution_settings = ::Gapic::Config::Method.new get_attribution_settings_config
8127
+ update_attribution_settings_config = parent_rpcs.update_attribution_settings if parent_rpcs.respond_to? :update_attribution_settings
8128
+ @update_attribution_settings = ::Gapic::Config::Method.new update_attribution_settings_config
8129
+ run_access_report_config = parent_rpcs.run_access_report if parent_rpcs.respond_to? :run_access_report
8130
+ @run_access_report = ::Gapic::Config::Method.new run_access_report_config
7292
8131
 
7293
8132
  yield self if block_given?
7294
8133
  end