google-analytics-data-v1beta 0.8.1 → 0.10.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/google/analytics/data/v1beta/analytics_data/client.rb +509 -1
- data/lib/google/analytics/data/v1beta/analytics_data/operations.rb +779 -0
- data/lib/google/analytics/data/v1beta/analytics_data/paths.rb +31 -0
- data/lib/google/analytics/data/v1beta/analytics_data/rest/client.rb +583 -0
- data/lib/google/analytics/data/v1beta/analytics_data/rest/operations.rb +870 -0
- data/lib/google/analytics/data/v1beta/analytics_data/rest/service_stub.rb +238 -0
- data/lib/google/analytics/data/v1beta/analytics_data/rest.rb +1 -0
- data/lib/google/analytics/data/v1beta/analytics_data.rb +1 -0
- data/lib/google/analytics/data/v1beta/analytics_data_api_pb.rb +16 -1
- data/lib/google/analytics/data/v1beta/analytics_data_api_services_pb.rb +75 -0
- data/lib/google/analytics/data/v1beta/data_pb.rb +2 -1
- data/lib/google/analytics/data/v1beta/version.rb +1 -1
- data/proto_docs/google/analytics/data/v1beta/analytics_data_api.rb +228 -1
- data/proto_docs/google/analytics/data/v1beta/data.rb +55 -5
- data/proto_docs/google/api/client.rb +13 -0
- data/proto_docs/google/api/field_behavior.rb +14 -0
- data/proto_docs/google/longrunning/operations.rb +164 -0
- data/proto_docs/google/protobuf/any.rb +144 -0
- data/proto_docs/google/protobuf/empty.rb +34 -0
- data/proto_docs/google/protobuf/timestamp.rb +127 -0
- data/proto_docs/google/rpc/status.rb +48 -0
- metadata +12 -5
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: f030cb12e8ec149521b5460c39430480fb1e667b364092825a32e9a31a9eaa4f
|
4
|
+
data.tar.gz: b3bba733eaa26246edfbdf71b8e0c92ffbcf1a04f273049390b32dbed5b65dd6
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: d66377c3a86eccce2ed1f4bb138d40a631fc77c8811345561b938525a1065a2494668203cf72e053e547907d4d702c85dd7fc2619ead40a48824ed30cfffc34d
|
7
|
+
data.tar.gz: bd3ab76ad2ea6c1f452194f1a1bdcf1a1d39141b42a99c21db527c441bacd801efeaa757071b5d8d25381a59beb208064d5a734743c05c1f24e0c07323982f56
|
@@ -152,15 +152,29 @@ module Google
|
|
152
152
|
@quota_project_id = @config.quota_project
|
153
153
|
@quota_project_id ||= credentials.quota_project_id if credentials.respond_to? :quota_project_id
|
154
154
|
|
155
|
+
@operations_client = Operations.new do |config|
|
156
|
+
config.credentials = credentials
|
157
|
+
config.quota_project = @quota_project_id
|
158
|
+
config.endpoint = @config.endpoint
|
159
|
+
end
|
160
|
+
|
155
161
|
@analytics_data_stub = ::Gapic::ServiceStub.new(
|
156
162
|
::Google::Analytics::Data::V1beta::BetaAnalyticsData::Stub,
|
157
163
|
credentials: credentials,
|
158
164
|
endpoint: @config.endpoint,
|
159
165
|
channel_args: @config.channel_args,
|
160
|
-
interceptors: @config.interceptors
|
166
|
+
interceptors: @config.interceptors,
|
167
|
+
channel_pool_config: @config.channel_pool
|
161
168
|
)
|
162
169
|
end
|
163
170
|
|
171
|
+
##
|
172
|
+
# Get the associated client for long-running operations.
|
173
|
+
#
|
174
|
+
# @return [::Google::Analytics::Data::V1beta::AnalyticsData::Operations]
|
175
|
+
#
|
176
|
+
attr_reader :operations_client
|
177
|
+
|
164
178
|
# Service calls
|
165
179
|
|
166
180
|
##
|
@@ -1016,6 +1030,464 @@ module Google
|
|
1016
1030
|
raise ::Google::Cloud::Error.from_error(e)
|
1017
1031
|
end
|
1018
1032
|
|
1033
|
+
##
|
1034
|
+
# Creates an audience export for later retrieval. This method quickly returns
|
1035
|
+
# the audience export's resource name and initiates a long running
|
1036
|
+
# asynchronous request to form an audience export. To export the users in an
|
1037
|
+
# audience export, first create the audience export through this method and
|
1038
|
+
# then send the audience resource name to the `QueryAudienceExport` method.
|
1039
|
+
#
|
1040
|
+
# See [Creating an Audience
|
1041
|
+
# Export](https://developers.google.com/analytics/devguides/reporting/data/v1/audience-list-basics)
|
1042
|
+
# for an introduction to Audience Exports with examples.
|
1043
|
+
#
|
1044
|
+
# An audience export is a snapshot of the users currently in the audience at
|
1045
|
+
# the time of audience export creation. Creating audience exports for one
|
1046
|
+
# audience on different days will return different results as users enter and
|
1047
|
+
# exit the audience.
|
1048
|
+
#
|
1049
|
+
# Audiences in Google Analytics 4 allow you to segment your users in the ways
|
1050
|
+
# that are important to your business. To learn more, see
|
1051
|
+
# https://support.google.com/analytics/answer/9267572. Audience exports
|
1052
|
+
# contain the users in each audience.
|
1053
|
+
#
|
1054
|
+
# Audience Export APIs have some methods at alpha and other methods at beta
|
1055
|
+
# stability. The intention is to advance methods to beta stability after some
|
1056
|
+
# feedback and adoption. To give your feedback on this API, complete the
|
1057
|
+
# [Google Analytics Audience Export API
|
1058
|
+
# Feedback](https://forms.gle/EeA5u5LW6PEggtCEA) form.
|
1059
|
+
#
|
1060
|
+
# @overload create_audience_export(request, options = nil)
|
1061
|
+
# Pass arguments to `create_audience_export` via a request object, either of type
|
1062
|
+
# {::Google::Analytics::Data::V1beta::CreateAudienceExportRequest} or an equivalent Hash.
|
1063
|
+
#
|
1064
|
+
# @param request [::Google::Analytics::Data::V1beta::CreateAudienceExportRequest, ::Hash]
|
1065
|
+
# A request object representing the call parameters. Required. To specify no
|
1066
|
+
# parameters, or to keep all the default parameter values, pass an empty Hash.
|
1067
|
+
# @param options [::Gapic::CallOptions, ::Hash]
|
1068
|
+
# Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
|
1069
|
+
#
|
1070
|
+
# @overload create_audience_export(parent: nil, audience_export: nil)
|
1071
|
+
# Pass arguments to `create_audience_export` via keyword arguments. Note that at
|
1072
|
+
# least one keyword argument is required. To specify no parameters, or to keep all
|
1073
|
+
# the default parameter values, pass an empty Hash as a request object (see above).
|
1074
|
+
#
|
1075
|
+
# @param parent [::String]
|
1076
|
+
# Required. The parent resource where this audience export will be created.
|
1077
|
+
# Format: `properties/{property}`
|
1078
|
+
# @param audience_export [::Google::Analytics::Data::V1beta::AudienceExport, ::Hash]
|
1079
|
+
# Required. The audience export to create.
|
1080
|
+
#
|
1081
|
+
# @yield [response, operation] Access the result along with the RPC operation
|
1082
|
+
# @yieldparam response [::Gapic::Operation]
|
1083
|
+
# @yieldparam operation [::GRPC::ActiveCall::Operation]
|
1084
|
+
#
|
1085
|
+
# @return [::Gapic::Operation]
|
1086
|
+
#
|
1087
|
+
# @raise [::Google::Cloud::Error] if the RPC is aborted.
|
1088
|
+
#
|
1089
|
+
# @example Basic example
|
1090
|
+
# require "google/analytics/data/v1beta"
|
1091
|
+
#
|
1092
|
+
# # Create a client object. The client can be reused for multiple calls.
|
1093
|
+
# client = Google::Analytics::Data::V1beta::AnalyticsData::Client.new
|
1094
|
+
#
|
1095
|
+
# # Create a request. To set request fields, pass in keyword arguments.
|
1096
|
+
# request = Google::Analytics::Data::V1beta::CreateAudienceExportRequest.new
|
1097
|
+
#
|
1098
|
+
# # Call the create_audience_export method.
|
1099
|
+
# result = client.create_audience_export request
|
1100
|
+
#
|
1101
|
+
# # The returned object is of type Gapic::Operation. You can use it to
|
1102
|
+
# # check the status of an operation, cancel it, or wait for results.
|
1103
|
+
# # Here is how to wait for a response.
|
1104
|
+
# result.wait_until_done! timeout: 60
|
1105
|
+
# if result.response?
|
1106
|
+
# p result.response
|
1107
|
+
# else
|
1108
|
+
# puts "No response received."
|
1109
|
+
# end
|
1110
|
+
#
|
1111
|
+
def create_audience_export request, options = nil
|
1112
|
+
raise ::ArgumentError, "request must be provided" if request.nil?
|
1113
|
+
|
1114
|
+
request = ::Gapic::Protobuf.coerce request, to: ::Google::Analytics::Data::V1beta::CreateAudienceExportRequest
|
1115
|
+
|
1116
|
+
# Converts hash and nil to an options object
|
1117
|
+
options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
|
1118
|
+
|
1119
|
+
# Customize the options with defaults
|
1120
|
+
metadata = @config.rpcs.create_audience_export.metadata.to_h
|
1121
|
+
|
1122
|
+
# Set x-goog-api-client and x-goog-user-project headers
|
1123
|
+
metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
|
1124
|
+
lib_name: @config.lib_name, lib_version: @config.lib_version,
|
1125
|
+
gapic_version: ::Google::Analytics::Data::V1beta::VERSION
|
1126
|
+
metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
|
1127
|
+
|
1128
|
+
header_params = {}
|
1129
|
+
if request.parent
|
1130
|
+
header_params["parent"] = request.parent
|
1131
|
+
end
|
1132
|
+
|
1133
|
+
request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
|
1134
|
+
metadata[:"x-goog-request-params"] ||= request_params_header
|
1135
|
+
|
1136
|
+
options.apply_defaults timeout: @config.rpcs.create_audience_export.timeout,
|
1137
|
+
metadata: metadata,
|
1138
|
+
retry_policy: @config.rpcs.create_audience_export.retry_policy
|
1139
|
+
|
1140
|
+
options.apply_defaults timeout: @config.timeout,
|
1141
|
+
metadata: @config.metadata,
|
1142
|
+
retry_policy: @config.retry_policy
|
1143
|
+
|
1144
|
+
@analytics_data_stub.call_rpc :create_audience_export, request, options: options do |response, operation|
|
1145
|
+
response = ::Gapic::Operation.new response, @operations_client, options: options
|
1146
|
+
yield response, operation if block_given?
|
1147
|
+
return response
|
1148
|
+
end
|
1149
|
+
rescue ::GRPC::BadStatus => e
|
1150
|
+
raise ::Google::Cloud::Error.from_error(e)
|
1151
|
+
end
|
1152
|
+
|
1153
|
+
##
|
1154
|
+
# Retrieves an audience export of users. After creating an audience, the
|
1155
|
+
# users are not immediately available for exporting. First, a request to
|
1156
|
+
# `CreateAudienceExport` is necessary to create an audience export of users,
|
1157
|
+
# and then second, this method is used to retrieve the users in the audience
|
1158
|
+
# export.
|
1159
|
+
#
|
1160
|
+
# See [Creating an Audience
|
1161
|
+
# Export](https://developers.google.com/analytics/devguides/reporting/data/v1/audience-list-basics)
|
1162
|
+
# for an introduction to Audience Exports with examples.
|
1163
|
+
#
|
1164
|
+
# Audiences in Google Analytics 4 allow you to segment your users in the ways
|
1165
|
+
# that are important to your business. To learn more, see
|
1166
|
+
# https://support.google.com/analytics/answer/9267572.
|
1167
|
+
#
|
1168
|
+
# Audience Export APIs have some methods at alpha and other methods at beta
|
1169
|
+
# stability. The intention is to advance methods to beta stability after some
|
1170
|
+
# feedback and adoption. To give your feedback on this API, complete the
|
1171
|
+
# [Google Analytics Audience Export API
|
1172
|
+
# Feedback](https://forms.gle/EeA5u5LW6PEggtCEA) form.
|
1173
|
+
#
|
1174
|
+
# @overload query_audience_export(request, options = nil)
|
1175
|
+
# Pass arguments to `query_audience_export` via a request object, either of type
|
1176
|
+
# {::Google::Analytics::Data::V1beta::QueryAudienceExportRequest} or an equivalent Hash.
|
1177
|
+
#
|
1178
|
+
# @param request [::Google::Analytics::Data::V1beta::QueryAudienceExportRequest, ::Hash]
|
1179
|
+
# A request object representing the call parameters. Required. To specify no
|
1180
|
+
# parameters, or to keep all the default parameter values, pass an empty Hash.
|
1181
|
+
# @param options [::Gapic::CallOptions, ::Hash]
|
1182
|
+
# Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
|
1183
|
+
#
|
1184
|
+
# @overload query_audience_export(name: nil, offset: nil, limit: nil)
|
1185
|
+
# Pass arguments to `query_audience_export` via keyword arguments. Note that at
|
1186
|
+
# least one keyword argument is required. To specify no parameters, or to keep all
|
1187
|
+
# the default parameter values, pass an empty Hash as a request object (see above).
|
1188
|
+
#
|
1189
|
+
# @param name [::String]
|
1190
|
+
# Required. The name of the audience export to retrieve users from.
|
1191
|
+
# Format: `properties/{property}/audienceExports/{audience_export}`
|
1192
|
+
# @param offset [::Integer]
|
1193
|
+
# Optional. The row count of the start row. The first row is counted as row
|
1194
|
+
# 0.
|
1195
|
+
#
|
1196
|
+
# When paging, the first request does not specify offset; or equivalently,
|
1197
|
+
# sets offset to 0; the first request returns the first `limit` of rows. The
|
1198
|
+
# second request sets offset to the `limit` of the first request; the second
|
1199
|
+
# request returns the second `limit` of rows.
|
1200
|
+
#
|
1201
|
+
# To learn more about this pagination parameter, see
|
1202
|
+
# [Pagination](https://developers.google.com/analytics/devguides/reporting/data/v1/basics#pagination).
|
1203
|
+
# @param limit [::Integer]
|
1204
|
+
# Optional. The number of rows to return. If unspecified, 10,000 rows are
|
1205
|
+
# returned. The API returns a maximum of 250,000 rows per request, no matter
|
1206
|
+
# how many you ask for. `limit` must be positive.
|
1207
|
+
#
|
1208
|
+
# The API can also return fewer rows than the requested `limit`, if there
|
1209
|
+
# aren't as many dimension values as the `limit`.
|
1210
|
+
#
|
1211
|
+
# To learn more about this pagination parameter, see
|
1212
|
+
# [Pagination](https://developers.google.com/analytics/devguides/reporting/data/v1/basics#pagination).
|
1213
|
+
#
|
1214
|
+
# @yield [response, operation] Access the result along with the RPC operation
|
1215
|
+
# @yieldparam response [::Google::Analytics::Data::V1beta::QueryAudienceExportResponse]
|
1216
|
+
# @yieldparam operation [::GRPC::ActiveCall::Operation]
|
1217
|
+
#
|
1218
|
+
# @return [::Google::Analytics::Data::V1beta::QueryAudienceExportResponse]
|
1219
|
+
#
|
1220
|
+
# @raise [::Google::Cloud::Error] if the RPC is aborted.
|
1221
|
+
#
|
1222
|
+
# @example Basic example
|
1223
|
+
# require "google/analytics/data/v1beta"
|
1224
|
+
#
|
1225
|
+
# # Create a client object. The client can be reused for multiple calls.
|
1226
|
+
# client = Google::Analytics::Data::V1beta::AnalyticsData::Client.new
|
1227
|
+
#
|
1228
|
+
# # Create a request. To set request fields, pass in keyword arguments.
|
1229
|
+
# request = Google::Analytics::Data::V1beta::QueryAudienceExportRequest.new
|
1230
|
+
#
|
1231
|
+
# # Call the query_audience_export method.
|
1232
|
+
# result = client.query_audience_export request
|
1233
|
+
#
|
1234
|
+
# # The returned object is of type Google::Analytics::Data::V1beta::QueryAudienceExportResponse.
|
1235
|
+
# p result
|
1236
|
+
#
|
1237
|
+
def query_audience_export request, options = nil
|
1238
|
+
raise ::ArgumentError, "request must be provided" if request.nil?
|
1239
|
+
|
1240
|
+
request = ::Gapic::Protobuf.coerce request, to: ::Google::Analytics::Data::V1beta::QueryAudienceExportRequest
|
1241
|
+
|
1242
|
+
# Converts hash and nil to an options object
|
1243
|
+
options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
|
1244
|
+
|
1245
|
+
# Customize the options with defaults
|
1246
|
+
metadata = @config.rpcs.query_audience_export.metadata.to_h
|
1247
|
+
|
1248
|
+
# Set x-goog-api-client and x-goog-user-project headers
|
1249
|
+
metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
|
1250
|
+
lib_name: @config.lib_name, lib_version: @config.lib_version,
|
1251
|
+
gapic_version: ::Google::Analytics::Data::V1beta::VERSION
|
1252
|
+
metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
|
1253
|
+
|
1254
|
+
header_params = {}
|
1255
|
+
if request.name
|
1256
|
+
header_params["name"] = request.name
|
1257
|
+
end
|
1258
|
+
|
1259
|
+
request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
|
1260
|
+
metadata[:"x-goog-request-params"] ||= request_params_header
|
1261
|
+
|
1262
|
+
options.apply_defaults timeout: @config.rpcs.query_audience_export.timeout,
|
1263
|
+
metadata: metadata,
|
1264
|
+
retry_policy: @config.rpcs.query_audience_export.retry_policy
|
1265
|
+
|
1266
|
+
options.apply_defaults timeout: @config.timeout,
|
1267
|
+
metadata: @config.metadata,
|
1268
|
+
retry_policy: @config.retry_policy
|
1269
|
+
|
1270
|
+
@analytics_data_stub.call_rpc :query_audience_export, request, options: options do |response, operation|
|
1271
|
+
yield response, operation if block_given?
|
1272
|
+
return response
|
1273
|
+
end
|
1274
|
+
rescue ::GRPC::BadStatus => e
|
1275
|
+
raise ::Google::Cloud::Error.from_error(e)
|
1276
|
+
end
|
1277
|
+
|
1278
|
+
##
|
1279
|
+
# Gets configuration metadata about a specific audience export. This method
|
1280
|
+
# can be used to understand an audience export after it has been created.
|
1281
|
+
#
|
1282
|
+
# See [Creating an Audience
|
1283
|
+
# Export](https://developers.google.com/analytics/devguides/reporting/data/v1/audience-list-basics)
|
1284
|
+
# for an introduction to Audience Exports with examples.
|
1285
|
+
#
|
1286
|
+
# Audience Export APIs have some methods at alpha and other methods at beta
|
1287
|
+
# stability. The intention is to advance methods to beta stability after some
|
1288
|
+
# feedback and adoption. To give your feedback on this API, complete the
|
1289
|
+
# [Google Analytics Audience Export API
|
1290
|
+
# Feedback](https://forms.gle/EeA5u5LW6PEggtCEA) form.
|
1291
|
+
#
|
1292
|
+
# @overload get_audience_export(request, options = nil)
|
1293
|
+
# Pass arguments to `get_audience_export` via a request object, either of type
|
1294
|
+
# {::Google::Analytics::Data::V1beta::GetAudienceExportRequest} or an equivalent Hash.
|
1295
|
+
#
|
1296
|
+
# @param request [::Google::Analytics::Data::V1beta::GetAudienceExportRequest, ::Hash]
|
1297
|
+
# A request object representing the call parameters. Required. To specify no
|
1298
|
+
# parameters, or to keep all the default parameter values, pass an empty Hash.
|
1299
|
+
# @param options [::Gapic::CallOptions, ::Hash]
|
1300
|
+
# Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
|
1301
|
+
#
|
1302
|
+
# @overload get_audience_export(name: nil)
|
1303
|
+
# Pass arguments to `get_audience_export` via keyword arguments. Note that at
|
1304
|
+
# least one keyword argument is required. To specify no parameters, or to keep all
|
1305
|
+
# the default parameter values, pass an empty Hash as a request object (see above).
|
1306
|
+
#
|
1307
|
+
# @param name [::String]
|
1308
|
+
# Required. The audience export resource name.
|
1309
|
+
# Format: `properties/{property}/audienceExports/{audience_export}`
|
1310
|
+
#
|
1311
|
+
# @yield [response, operation] Access the result along with the RPC operation
|
1312
|
+
# @yieldparam response [::Google::Analytics::Data::V1beta::AudienceExport]
|
1313
|
+
# @yieldparam operation [::GRPC::ActiveCall::Operation]
|
1314
|
+
#
|
1315
|
+
# @return [::Google::Analytics::Data::V1beta::AudienceExport]
|
1316
|
+
#
|
1317
|
+
# @raise [::Google::Cloud::Error] if the RPC is aborted.
|
1318
|
+
#
|
1319
|
+
# @example Basic example
|
1320
|
+
# require "google/analytics/data/v1beta"
|
1321
|
+
#
|
1322
|
+
# # Create a client object. The client can be reused for multiple calls.
|
1323
|
+
# client = Google::Analytics::Data::V1beta::AnalyticsData::Client.new
|
1324
|
+
#
|
1325
|
+
# # Create a request. To set request fields, pass in keyword arguments.
|
1326
|
+
# request = Google::Analytics::Data::V1beta::GetAudienceExportRequest.new
|
1327
|
+
#
|
1328
|
+
# # Call the get_audience_export method.
|
1329
|
+
# result = client.get_audience_export request
|
1330
|
+
#
|
1331
|
+
# # The returned object is of type Google::Analytics::Data::V1beta::AudienceExport.
|
1332
|
+
# p result
|
1333
|
+
#
|
1334
|
+
def get_audience_export request, options = nil
|
1335
|
+
raise ::ArgumentError, "request must be provided" if request.nil?
|
1336
|
+
|
1337
|
+
request = ::Gapic::Protobuf.coerce request, to: ::Google::Analytics::Data::V1beta::GetAudienceExportRequest
|
1338
|
+
|
1339
|
+
# Converts hash and nil to an options object
|
1340
|
+
options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
|
1341
|
+
|
1342
|
+
# Customize the options with defaults
|
1343
|
+
metadata = @config.rpcs.get_audience_export.metadata.to_h
|
1344
|
+
|
1345
|
+
# Set x-goog-api-client and x-goog-user-project headers
|
1346
|
+
metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
|
1347
|
+
lib_name: @config.lib_name, lib_version: @config.lib_version,
|
1348
|
+
gapic_version: ::Google::Analytics::Data::V1beta::VERSION
|
1349
|
+
metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
|
1350
|
+
|
1351
|
+
header_params = {}
|
1352
|
+
if request.name
|
1353
|
+
header_params["name"] = request.name
|
1354
|
+
end
|
1355
|
+
|
1356
|
+
request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
|
1357
|
+
metadata[:"x-goog-request-params"] ||= request_params_header
|
1358
|
+
|
1359
|
+
options.apply_defaults timeout: @config.rpcs.get_audience_export.timeout,
|
1360
|
+
metadata: metadata,
|
1361
|
+
retry_policy: @config.rpcs.get_audience_export.retry_policy
|
1362
|
+
|
1363
|
+
options.apply_defaults timeout: @config.timeout,
|
1364
|
+
metadata: @config.metadata,
|
1365
|
+
retry_policy: @config.retry_policy
|
1366
|
+
|
1367
|
+
@analytics_data_stub.call_rpc :get_audience_export, request, options: options do |response, operation|
|
1368
|
+
yield response, operation if block_given?
|
1369
|
+
return response
|
1370
|
+
end
|
1371
|
+
rescue ::GRPC::BadStatus => e
|
1372
|
+
raise ::Google::Cloud::Error.from_error(e)
|
1373
|
+
end
|
1374
|
+
|
1375
|
+
##
|
1376
|
+
# Lists all audience exports for a property. This method can be used for you
|
1377
|
+
# to find and reuse existing audience exports rather than creating
|
1378
|
+
# unnecessary new audience exports. The same audience can have multiple
|
1379
|
+
# audience exports that represent the export of users that were in an
|
1380
|
+
# audience on different days.
|
1381
|
+
#
|
1382
|
+
# See [Creating an Audience
|
1383
|
+
# Export](https://developers.google.com/analytics/devguides/reporting/data/v1/audience-list-basics)
|
1384
|
+
# for an introduction to Audience Exports with examples.
|
1385
|
+
#
|
1386
|
+
# Audience Export APIs have some methods at alpha and other methods at beta
|
1387
|
+
# stability. The intention is to advance methods to beta stability after some
|
1388
|
+
# feedback and adoption. To give your feedback on this API, complete the
|
1389
|
+
# [Google Analytics Audience Export API
|
1390
|
+
# Feedback](https://forms.gle/EeA5u5LW6PEggtCEA) form.
|
1391
|
+
#
|
1392
|
+
# @overload list_audience_exports(request, options = nil)
|
1393
|
+
# Pass arguments to `list_audience_exports` via a request object, either of type
|
1394
|
+
# {::Google::Analytics::Data::V1beta::ListAudienceExportsRequest} or an equivalent Hash.
|
1395
|
+
#
|
1396
|
+
# @param request [::Google::Analytics::Data::V1beta::ListAudienceExportsRequest, ::Hash]
|
1397
|
+
# A request object representing the call parameters. Required. To specify no
|
1398
|
+
# parameters, or to keep all the default parameter values, pass an empty Hash.
|
1399
|
+
# @param options [::Gapic::CallOptions, ::Hash]
|
1400
|
+
# Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
|
1401
|
+
#
|
1402
|
+
# @overload list_audience_exports(parent: nil, page_size: nil, page_token: nil)
|
1403
|
+
# Pass arguments to `list_audience_exports` via keyword arguments. Note that at
|
1404
|
+
# least one keyword argument is required. To specify no parameters, or to keep all
|
1405
|
+
# the default parameter values, pass an empty Hash as a request object (see above).
|
1406
|
+
#
|
1407
|
+
# @param parent [::String]
|
1408
|
+
# Required. All audience exports for this property will be listed in the
|
1409
|
+
# response. Format: `properties/{property}`
|
1410
|
+
# @param page_size [::Integer]
|
1411
|
+
# Optional. The maximum number of audience exports to return. The service may
|
1412
|
+
# return fewer than this value. If unspecified, at most 200 audience exports
|
1413
|
+
# will be returned. The maximum value is 1000 (higher values will be coerced
|
1414
|
+
# to the maximum).
|
1415
|
+
# @param page_token [::String]
|
1416
|
+
# Optional. A page token, received from a previous `ListAudienceExports`
|
1417
|
+
# call. Provide this to retrieve the subsequent page.
|
1418
|
+
#
|
1419
|
+
# When paginating, all other parameters provided to `ListAudienceExports`
|
1420
|
+
# must match the call that provided the page token.
|
1421
|
+
#
|
1422
|
+
# @yield [response, operation] Access the result along with the RPC operation
|
1423
|
+
# @yieldparam response [::Gapic::PagedEnumerable<::Google::Analytics::Data::V1beta::AudienceExport>]
|
1424
|
+
# @yieldparam operation [::GRPC::ActiveCall::Operation]
|
1425
|
+
#
|
1426
|
+
# @return [::Gapic::PagedEnumerable<::Google::Analytics::Data::V1beta::AudienceExport>]
|
1427
|
+
#
|
1428
|
+
# @raise [::Google::Cloud::Error] if the RPC is aborted.
|
1429
|
+
#
|
1430
|
+
# @example Basic example
|
1431
|
+
# require "google/analytics/data/v1beta"
|
1432
|
+
#
|
1433
|
+
# # Create a client object. The client can be reused for multiple calls.
|
1434
|
+
# client = Google::Analytics::Data::V1beta::AnalyticsData::Client.new
|
1435
|
+
#
|
1436
|
+
# # Create a request. To set request fields, pass in keyword arguments.
|
1437
|
+
# request = Google::Analytics::Data::V1beta::ListAudienceExportsRequest.new
|
1438
|
+
#
|
1439
|
+
# # Call the list_audience_exports method.
|
1440
|
+
# result = client.list_audience_exports request
|
1441
|
+
#
|
1442
|
+
# # The returned object is of type Gapic::PagedEnumerable. You can iterate
|
1443
|
+
# # over elements, and API calls will be issued to fetch pages as needed.
|
1444
|
+
# result.each do |item|
|
1445
|
+
# # Each element is of type ::Google::Analytics::Data::V1beta::AudienceExport.
|
1446
|
+
# p item
|
1447
|
+
# end
|
1448
|
+
#
|
1449
|
+
def list_audience_exports request, options = nil
|
1450
|
+
raise ::ArgumentError, "request must be provided" if request.nil?
|
1451
|
+
|
1452
|
+
request = ::Gapic::Protobuf.coerce request, to: ::Google::Analytics::Data::V1beta::ListAudienceExportsRequest
|
1453
|
+
|
1454
|
+
# Converts hash and nil to an options object
|
1455
|
+
options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
|
1456
|
+
|
1457
|
+
# Customize the options with defaults
|
1458
|
+
metadata = @config.rpcs.list_audience_exports.metadata.to_h
|
1459
|
+
|
1460
|
+
# Set x-goog-api-client and x-goog-user-project headers
|
1461
|
+
metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
|
1462
|
+
lib_name: @config.lib_name, lib_version: @config.lib_version,
|
1463
|
+
gapic_version: ::Google::Analytics::Data::V1beta::VERSION
|
1464
|
+
metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
|
1465
|
+
|
1466
|
+
header_params = {}
|
1467
|
+
if request.parent
|
1468
|
+
header_params["parent"] = request.parent
|
1469
|
+
end
|
1470
|
+
|
1471
|
+
request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
|
1472
|
+
metadata[:"x-goog-request-params"] ||= request_params_header
|
1473
|
+
|
1474
|
+
options.apply_defaults timeout: @config.rpcs.list_audience_exports.timeout,
|
1475
|
+
metadata: metadata,
|
1476
|
+
retry_policy: @config.rpcs.list_audience_exports.retry_policy
|
1477
|
+
|
1478
|
+
options.apply_defaults timeout: @config.timeout,
|
1479
|
+
metadata: @config.metadata,
|
1480
|
+
retry_policy: @config.retry_policy
|
1481
|
+
|
1482
|
+
@analytics_data_stub.call_rpc :list_audience_exports, request, options: options do |response, operation|
|
1483
|
+
response = ::Gapic::PagedEnumerable.new @analytics_data_stub, :list_audience_exports, request, response, operation, options
|
1484
|
+
yield response, operation if block_given?
|
1485
|
+
return response
|
1486
|
+
end
|
1487
|
+
rescue ::GRPC::BadStatus => e
|
1488
|
+
raise ::Google::Cloud::Error.from_error(e)
|
1489
|
+
end
|
1490
|
+
|
1019
1491
|
##
|
1020
1492
|
# Configuration class for the AnalyticsData API.
|
1021
1493
|
#
|
@@ -1135,6 +1607,14 @@ module Google
|
|
1135
1607
|
end
|
1136
1608
|
end
|
1137
1609
|
|
1610
|
+
##
|
1611
|
+
# Configuration for the channel pool
|
1612
|
+
# @return [::Gapic::ServiceStub::ChannelPool::Configuration]
|
1613
|
+
#
|
1614
|
+
def channel_pool
|
1615
|
+
@channel_pool ||= ::Gapic::ServiceStub::ChannelPool::Configuration.new
|
1616
|
+
end
|
1617
|
+
|
1138
1618
|
##
|
1139
1619
|
# Configuration RPC class for the AnalyticsData API.
|
1140
1620
|
#
|
@@ -1188,6 +1668,26 @@ module Google
|
|
1188
1668
|
# @return [::Gapic::Config::Method]
|
1189
1669
|
#
|
1190
1670
|
attr_reader :check_compatibility
|
1671
|
+
##
|
1672
|
+
# RPC-specific configuration for `create_audience_export`
|
1673
|
+
# @return [::Gapic::Config::Method]
|
1674
|
+
#
|
1675
|
+
attr_reader :create_audience_export
|
1676
|
+
##
|
1677
|
+
# RPC-specific configuration for `query_audience_export`
|
1678
|
+
# @return [::Gapic::Config::Method]
|
1679
|
+
#
|
1680
|
+
attr_reader :query_audience_export
|
1681
|
+
##
|
1682
|
+
# RPC-specific configuration for `get_audience_export`
|
1683
|
+
# @return [::Gapic::Config::Method]
|
1684
|
+
#
|
1685
|
+
attr_reader :get_audience_export
|
1686
|
+
##
|
1687
|
+
# RPC-specific configuration for `list_audience_exports`
|
1688
|
+
# @return [::Gapic::Config::Method]
|
1689
|
+
#
|
1690
|
+
attr_reader :list_audience_exports
|
1191
1691
|
|
1192
1692
|
# @private
|
1193
1693
|
def initialize parent_rpcs = nil
|
@@ -1205,6 +1705,14 @@ module Google
|
|
1205
1705
|
@run_realtime_report = ::Gapic::Config::Method.new run_realtime_report_config
|
1206
1706
|
check_compatibility_config = parent_rpcs.check_compatibility if parent_rpcs.respond_to? :check_compatibility
|
1207
1707
|
@check_compatibility = ::Gapic::Config::Method.new check_compatibility_config
|
1708
|
+
create_audience_export_config = parent_rpcs.create_audience_export if parent_rpcs.respond_to? :create_audience_export
|
1709
|
+
@create_audience_export = ::Gapic::Config::Method.new create_audience_export_config
|
1710
|
+
query_audience_export_config = parent_rpcs.query_audience_export if parent_rpcs.respond_to? :query_audience_export
|
1711
|
+
@query_audience_export = ::Gapic::Config::Method.new query_audience_export_config
|
1712
|
+
get_audience_export_config = parent_rpcs.get_audience_export if parent_rpcs.respond_to? :get_audience_export
|
1713
|
+
@get_audience_export = ::Gapic::Config::Method.new get_audience_export_config
|
1714
|
+
list_audience_exports_config = parent_rpcs.list_audience_exports if parent_rpcs.respond_to? :list_audience_exports
|
1715
|
+
@list_audience_exports = ::Gapic::Config::Method.new list_audience_exports_config
|
1208
1716
|
|
1209
1717
|
yield self if block_given?
|
1210
1718
|
end
|