google-analytics-data-v1beta 0.9.0 → 0.11.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/AUTHENTICATION.md +72 -101
- data/lib/google/analytics/data/v1beta/analytics_data/client.rb +531 -8
- data/lib/google/analytics/data/v1beta/analytics_data/operations.rb +801 -0
- data/lib/google/analytics/data/v1beta/analytics_data/paths.rb +31 -0
- data/lib/google/analytics/data/v1beta/analytics_data/rest/client.rb +505 -7
- data/lib/google/analytics/data/v1beta/analytics_data/rest/operations.rb +895 -0
- data/lib/google/analytics/data/v1beta/analytics_data/rest/service_stub.rb +252 -2
- 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 +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
@@ -30,6 +30,9 @@ module Google
|
|
30
30
|
# Google Analytics reporting data service.
|
31
31
|
#
|
32
32
|
class Client
|
33
|
+
# @private
|
34
|
+
DEFAULT_ENDPOINT_TEMPLATE = "analyticsdata.$UNIVERSE_DOMAIN$"
|
35
|
+
|
33
36
|
include Paths
|
34
37
|
|
35
38
|
# @private
|
@@ -109,6 +112,15 @@ module Google
|
|
109
112
|
@config
|
110
113
|
end
|
111
114
|
|
115
|
+
##
|
116
|
+
# The effective universe domain
|
117
|
+
#
|
118
|
+
# @return [String]
|
119
|
+
#
|
120
|
+
def universe_domain
|
121
|
+
@analytics_data_stub.universe_domain
|
122
|
+
end
|
123
|
+
|
112
124
|
##
|
113
125
|
# Create a new AnalyticsData client object.
|
114
126
|
#
|
@@ -142,8 +154,9 @@ module Google
|
|
142
154
|
credentials = @config.credentials
|
143
155
|
# Use self-signed JWT if the endpoint is unchanged from default,
|
144
156
|
# but only if the default endpoint does not have a region prefix.
|
145
|
-
enable_self_signed_jwt = @config.endpoint
|
146
|
-
|
157
|
+
enable_self_signed_jwt = @config.endpoint.nil? ||
|
158
|
+
(@config.endpoint == Configuration::DEFAULT_ENDPOINT &&
|
159
|
+
!@config.endpoint.split(".").first.include?("-"))
|
147
160
|
credentials ||= Credentials.default scope: @config.scope,
|
148
161
|
enable_self_signed_jwt: enable_self_signed_jwt
|
149
162
|
if credentials.is_a?(::String) || credentials.is_a?(::Hash)
|
@@ -152,16 +165,32 @@ module Google
|
|
152
165
|
@quota_project_id = @config.quota_project
|
153
166
|
@quota_project_id ||= credentials.quota_project_id if credentials.respond_to? :quota_project_id
|
154
167
|
|
168
|
+
@operations_client = Operations.new do |config|
|
169
|
+
config.credentials = credentials
|
170
|
+
config.quota_project = @quota_project_id
|
171
|
+
config.endpoint = @config.endpoint
|
172
|
+
config.universe_domain = @config.universe_domain
|
173
|
+
end
|
174
|
+
|
155
175
|
@analytics_data_stub = ::Gapic::ServiceStub.new(
|
156
176
|
::Google::Analytics::Data::V1beta::BetaAnalyticsData::Stub,
|
157
|
-
credentials:
|
158
|
-
endpoint:
|
177
|
+
credentials: credentials,
|
178
|
+
endpoint: @config.endpoint,
|
179
|
+
endpoint_template: DEFAULT_ENDPOINT_TEMPLATE,
|
180
|
+
universe_domain: @config.universe_domain,
|
159
181
|
channel_args: @config.channel_args,
|
160
182
|
interceptors: @config.interceptors,
|
161
183
|
channel_pool_config: @config.channel_pool
|
162
184
|
)
|
163
185
|
end
|
164
186
|
|
187
|
+
##
|
188
|
+
# Get the associated client for long-running operations.
|
189
|
+
#
|
190
|
+
# @return [::Google::Analytics::Data::V1beta::AnalyticsData::Operations]
|
191
|
+
#
|
192
|
+
attr_reader :operations_client
|
193
|
+
|
165
194
|
# Service calls
|
166
195
|
|
167
196
|
##
|
@@ -1017,6 +1046,464 @@ module Google
|
|
1017
1046
|
raise ::Google::Cloud::Error.from_error(e)
|
1018
1047
|
end
|
1019
1048
|
|
1049
|
+
##
|
1050
|
+
# Creates an audience export for later retrieval. This method quickly returns
|
1051
|
+
# the audience export's resource name and initiates a long running
|
1052
|
+
# asynchronous request to form an audience export. To export the users in an
|
1053
|
+
# audience export, first create the audience export through this method and
|
1054
|
+
# then send the audience resource name to the `QueryAudienceExport` method.
|
1055
|
+
#
|
1056
|
+
# See [Creating an Audience
|
1057
|
+
# Export](https://developers.google.com/analytics/devguides/reporting/data/v1/audience-list-basics)
|
1058
|
+
# for an introduction to Audience Exports with examples.
|
1059
|
+
#
|
1060
|
+
# An audience export is a snapshot of the users currently in the audience at
|
1061
|
+
# the time of audience export creation. Creating audience exports for one
|
1062
|
+
# audience on different days will return different results as users enter and
|
1063
|
+
# exit the audience.
|
1064
|
+
#
|
1065
|
+
# Audiences in Google Analytics 4 allow you to segment your users in the ways
|
1066
|
+
# that are important to your business. To learn more, see
|
1067
|
+
# https://support.google.com/analytics/answer/9267572. Audience exports
|
1068
|
+
# contain the users in each audience.
|
1069
|
+
#
|
1070
|
+
# Audience Export APIs have some methods at alpha and other methods at beta
|
1071
|
+
# stability. The intention is to advance methods to beta stability after some
|
1072
|
+
# feedback and adoption. To give your feedback on this API, complete the
|
1073
|
+
# [Google Analytics Audience Export API
|
1074
|
+
# Feedback](https://forms.gle/EeA5u5LW6PEggtCEA) form.
|
1075
|
+
#
|
1076
|
+
# @overload create_audience_export(request, options = nil)
|
1077
|
+
# Pass arguments to `create_audience_export` via a request object, either of type
|
1078
|
+
# {::Google::Analytics::Data::V1beta::CreateAudienceExportRequest} or an equivalent Hash.
|
1079
|
+
#
|
1080
|
+
# @param request [::Google::Analytics::Data::V1beta::CreateAudienceExportRequest, ::Hash]
|
1081
|
+
# A request object representing the call parameters. Required. To specify no
|
1082
|
+
# parameters, or to keep all the default parameter values, pass an empty Hash.
|
1083
|
+
# @param options [::Gapic::CallOptions, ::Hash]
|
1084
|
+
# Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
|
1085
|
+
#
|
1086
|
+
# @overload create_audience_export(parent: nil, audience_export: nil)
|
1087
|
+
# Pass arguments to `create_audience_export` via keyword arguments. Note that at
|
1088
|
+
# least one keyword argument is required. To specify no parameters, or to keep all
|
1089
|
+
# the default parameter values, pass an empty Hash as a request object (see above).
|
1090
|
+
#
|
1091
|
+
# @param parent [::String]
|
1092
|
+
# Required. The parent resource where this audience export will be created.
|
1093
|
+
# Format: `properties/{property}`
|
1094
|
+
# @param audience_export [::Google::Analytics::Data::V1beta::AudienceExport, ::Hash]
|
1095
|
+
# Required. The audience export to create.
|
1096
|
+
#
|
1097
|
+
# @yield [response, operation] Access the result along with the RPC operation
|
1098
|
+
# @yieldparam response [::Gapic::Operation]
|
1099
|
+
# @yieldparam operation [::GRPC::ActiveCall::Operation]
|
1100
|
+
#
|
1101
|
+
# @return [::Gapic::Operation]
|
1102
|
+
#
|
1103
|
+
# @raise [::Google::Cloud::Error] if the RPC is aborted.
|
1104
|
+
#
|
1105
|
+
# @example Basic example
|
1106
|
+
# require "google/analytics/data/v1beta"
|
1107
|
+
#
|
1108
|
+
# # Create a client object. The client can be reused for multiple calls.
|
1109
|
+
# client = Google::Analytics::Data::V1beta::AnalyticsData::Client.new
|
1110
|
+
#
|
1111
|
+
# # Create a request. To set request fields, pass in keyword arguments.
|
1112
|
+
# request = Google::Analytics::Data::V1beta::CreateAudienceExportRequest.new
|
1113
|
+
#
|
1114
|
+
# # Call the create_audience_export method.
|
1115
|
+
# result = client.create_audience_export request
|
1116
|
+
#
|
1117
|
+
# # The returned object is of type Gapic::Operation. You can use it to
|
1118
|
+
# # check the status of an operation, cancel it, or wait for results.
|
1119
|
+
# # Here is how to wait for a response.
|
1120
|
+
# result.wait_until_done! timeout: 60
|
1121
|
+
# if result.response?
|
1122
|
+
# p result.response
|
1123
|
+
# else
|
1124
|
+
# puts "No response received."
|
1125
|
+
# end
|
1126
|
+
#
|
1127
|
+
def create_audience_export request, options = nil
|
1128
|
+
raise ::ArgumentError, "request must be provided" if request.nil?
|
1129
|
+
|
1130
|
+
request = ::Gapic::Protobuf.coerce request, to: ::Google::Analytics::Data::V1beta::CreateAudienceExportRequest
|
1131
|
+
|
1132
|
+
# Converts hash and nil to an options object
|
1133
|
+
options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
|
1134
|
+
|
1135
|
+
# Customize the options with defaults
|
1136
|
+
metadata = @config.rpcs.create_audience_export.metadata.to_h
|
1137
|
+
|
1138
|
+
# Set x-goog-api-client and x-goog-user-project headers
|
1139
|
+
metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
|
1140
|
+
lib_name: @config.lib_name, lib_version: @config.lib_version,
|
1141
|
+
gapic_version: ::Google::Analytics::Data::V1beta::VERSION
|
1142
|
+
metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
|
1143
|
+
|
1144
|
+
header_params = {}
|
1145
|
+
if request.parent
|
1146
|
+
header_params["parent"] = request.parent
|
1147
|
+
end
|
1148
|
+
|
1149
|
+
request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
|
1150
|
+
metadata[:"x-goog-request-params"] ||= request_params_header
|
1151
|
+
|
1152
|
+
options.apply_defaults timeout: @config.rpcs.create_audience_export.timeout,
|
1153
|
+
metadata: metadata,
|
1154
|
+
retry_policy: @config.rpcs.create_audience_export.retry_policy
|
1155
|
+
|
1156
|
+
options.apply_defaults timeout: @config.timeout,
|
1157
|
+
metadata: @config.metadata,
|
1158
|
+
retry_policy: @config.retry_policy
|
1159
|
+
|
1160
|
+
@analytics_data_stub.call_rpc :create_audience_export, request, options: options do |response, operation|
|
1161
|
+
response = ::Gapic::Operation.new response, @operations_client, options: options
|
1162
|
+
yield response, operation if block_given?
|
1163
|
+
return response
|
1164
|
+
end
|
1165
|
+
rescue ::GRPC::BadStatus => e
|
1166
|
+
raise ::Google::Cloud::Error.from_error(e)
|
1167
|
+
end
|
1168
|
+
|
1169
|
+
##
|
1170
|
+
# Retrieves an audience export of users. After creating an audience, the
|
1171
|
+
# users are not immediately available for exporting. First, a request to
|
1172
|
+
# `CreateAudienceExport` is necessary to create an audience export of users,
|
1173
|
+
# and then second, this method is used to retrieve the users in the audience
|
1174
|
+
# export.
|
1175
|
+
#
|
1176
|
+
# See [Creating an Audience
|
1177
|
+
# Export](https://developers.google.com/analytics/devguides/reporting/data/v1/audience-list-basics)
|
1178
|
+
# for an introduction to Audience Exports with examples.
|
1179
|
+
#
|
1180
|
+
# Audiences in Google Analytics 4 allow you to segment your users in the ways
|
1181
|
+
# that are important to your business. To learn more, see
|
1182
|
+
# https://support.google.com/analytics/answer/9267572.
|
1183
|
+
#
|
1184
|
+
# Audience Export APIs have some methods at alpha and other methods at beta
|
1185
|
+
# stability. The intention is to advance methods to beta stability after some
|
1186
|
+
# feedback and adoption. To give your feedback on this API, complete the
|
1187
|
+
# [Google Analytics Audience Export API
|
1188
|
+
# Feedback](https://forms.gle/EeA5u5LW6PEggtCEA) form.
|
1189
|
+
#
|
1190
|
+
# @overload query_audience_export(request, options = nil)
|
1191
|
+
# Pass arguments to `query_audience_export` via a request object, either of type
|
1192
|
+
# {::Google::Analytics::Data::V1beta::QueryAudienceExportRequest} or an equivalent Hash.
|
1193
|
+
#
|
1194
|
+
# @param request [::Google::Analytics::Data::V1beta::QueryAudienceExportRequest, ::Hash]
|
1195
|
+
# A request object representing the call parameters. Required. To specify no
|
1196
|
+
# parameters, or to keep all the default parameter values, pass an empty Hash.
|
1197
|
+
# @param options [::Gapic::CallOptions, ::Hash]
|
1198
|
+
# Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
|
1199
|
+
#
|
1200
|
+
# @overload query_audience_export(name: nil, offset: nil, limit: nil)
|
1201
|
+
# Pass arguments to `query_audience_export` via keyword arguments. Note that at
|
1202
|
+
# least one keyword argument is required. To specify no parameters, or to keep all
|
1203
|
+
# the default parameter values, pass an empty Hash as a request object (see above).
|
1204
|
+
#
|
1205
|
+
# @param name [::String]
|
1206
|
+
# Required. The name of the audience export to retrieve users from.
|
1207
|
+
# Format: `properties/{property}/audienceExports/{audience_export}`
|
1208
|
+
# @param offset [::Integer]
|
1209
|
+
# Optional. The row count of the start row. The first row is counted as row
|
1210
|
+
# 0.
|
1211
|
+
#
|
1212
|
+
# When paging, the first request does not specify offset; or equivalently,
|
1213
|
+
# sets offset to 0; the first request returns the first `limit` of rows. The
|
1214
|
+
# second request sets offset to the `limit` of the first request; the second
|
1215
|
+
# request returns the second `limit` of rows.
|
1216
|
+
#
|
1217
|
+
# To learn more about this pagination parameter, see
|
1218
|
+
# [Pagination](https://developers.google.com/analytics/devguides/reporting/data/v1/basics#pagination).
|
1219
|
+
# @param limit [::Integer]
|
1220
|
+
# Optional. The number of rows to return. If unspecified, 10,000 rows are
|
1221
|
+
# returned. The API returns a maximum of 250,000 rows per request, no matter
|
1222
|
+
# how many you ask for. `limit` must be positive.
|
1223
|
+
#
|
1224
|
+
# The API can also return fewer rows than the requested `limit`, if there
|
1225
|
+
# aren't as many dimension values as the `limit`.
|
1226
|
+
#
|
1227
|
+
# To learn more about this pagination parameter, see
|
1228
|
+
# [Pagination](https://developers.google.com/analytics/devguides/reporting/data/v1/basics#pagination).
|
1229
|
+
#
|
1230
|
+
# @yield [response, operation] Access the result along with the RPC operation
|
1231
|
+
# @yieldparam response [::Google::Analytics::Data::V1beta::QueryAudienceExportResponse]
|
1232
|
+
# @yieldparam operation [::GRPC::ActiveCall::Operation]
|
1233
|
+
#
|
1234
|
+
# @return [::Google::Analytics::Data::V1beta::QueryAudienceExportResponse]
|
1235
|
+
#
|
1236
|
+
# @raise [::Google::Cloud::Error] if the RPC is aborted.
|
1237
|
+
#
|
1238
|
+
# @example Basic example
|
1239
|
+
# require "google/analytics/data/v1beta"
|
1240
|
+
#
|
1241
|
+
# # Create a client object. The client can be reused for multiple calls.
|
1242
|
+
# client = Google::Analytics::Data::V1beta::AnalyticsData::Client.new
|
1243
|
+
#
|
1244
|
+
# # Create a request. To set request fields, pass in keyword arguments.
|
1245
|
+
# request = Google::Analytics::Data::V1beta::QueryAudienceExportRequest.new
|
1246
|
+
#
|
1247
|
+
# # Call the query_audience_export method.
|
1248
|
+
# result = client.query_audience_export request
|
1249
|
+
#
|
1250
|
+
# # The returned object is of type Google::Analytics::Data::V1beta::QueryAudienceExportResponse.
|
1251
|
+
# p result
|
1252
|
+
#
|
1253
|
+
def query_audience_export request, options = nil
|
1254
|
+
raise ::ArgumentError, "request must be provided" if request.nil?
|
1255
|
+
|
1256
|
+
request = ::Gapic::Protobuf.coerce request, to: ::Google::Analytics::Data::V1beta::QueryAudienceExportRequest
|
1257
|
+
|
1258
|
+
# Converts hash and nil to an options object
|
1259
|
+
options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
|
1260
|
+
|
1261
|
+
# Customize the options with defaults
|
1262
|
+
metadata = @config.rpcs.query_audience_export.metadata.to_h
|
1263
|
+
|
1264
|
+
# Set x-goog-api-client and x-goog-user-project headers
|
1265
|
+
metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
|
1266
|
+
lib_name: @config.lib_name, lib_version: @config.lib_version,
|
1267
|
+
gapic_version: ::Google::Analytics::Data::V1beta::VERSION
|
1268
|
+
metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
|
1269
|
+
|
1270
|
+
header_params = {}
|
1271
|
+
if request.name
|
1272
|
+
header_params["name"] = request.name
|
1273
|
+
end
|
1274
|
+
|
1275
|
+
request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
|
1276
|
+
metadata[:"x-goog-request-params"] ||= request_params_header
|
1277
|
+
|
1278
|
+
options.apply_defaults timeout: @config.rpcs.query_audience_export.timeout,
|
1279
|
+
metadata: metadata,
|
1280
|
+
retry_policy: @config.rpcs.query_audience_export.retry_policy
|
1281
|
+
|
1282
|
+
options.apply_defaults timeout: @config.timeout,
|
1283
|
+
metadata: @config.metadata,
|
1284
|
+
retry_policy: @config.retry_policy
|
1285
|
+
|
1286
|
+
@analytics_data_stub.call_rpc :query_audience_export, request, options: options do |response, operation|
|
1287
|
+
yield response, operation if block_given?
|
1288
|
+
return response
|
1289
|
+
end
|
1290
|
+
rescue ::GRPC::BadStatus => e
|
1291
|
+
raise ::Google::Cloud::Error.from_error(e)
|
1292
|
+
end
|
1293
|
+
|
1294
|
+
##
|
1295
|
+
# Gets configuration metadata about a specific audience export. This method
|
1296
|
+
# can be used to understand an audience export after it has been created.
|
1297
|
+
#
|
1298
|
+
# See [Creating an Audience
|
1299
|
+
# Export](https://developers.google.com/analytics/devguides/reporting/data/v1/audience-list-basics)
|
1300
|
+
# for an introduction to Audience Exports with examples.
|
1301
|
+
#
|
1302
|
+
# Audience Export APIs have some methods at alpha and other methods at beta
|
1303
|
+
# stability. The intention is to advance methods to beta stability after some
|
1304
|
+
# feedback and adoption. To give your feedback on this API, complete the
|
1305
|
+
# [Google Analytics Audience Export API
|
1306
|
+
# Feedback](https://forms.gle/EeA5u5LW6PEggtCEA) form.
|
1307
|
+
#
|
1308
|
+
# @overload get_audience_export(request, options = nil)
|
1309
|
+
# Pass arguments to `get_audience_export` via a request object, either of type
|
1310
|
+
# {::Google::Analytics::Data::V1beta::GetAudienceExportRequest} or an equivalent Hash.
|
1311
|
+
#
|
1312
|
+
# @param request [::Google::Analytics::Data::V1beta::GetAudienceExportRequest, ::Hash]
|
1313
|
+
# A request object representing the call parameters. Required. To specify no
|
1314
|
+
# parameters, or to keep all the default parameter values, pass an empty Hash.
|
1315
|
+
# @param options [::Gapic::CallOptions, ::Hash]
|
1316
|
+
# Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
|
1317
|
+
#
|
1318
|
+
# @overload get_audience_export(name: nil)
|
1319
|
+
# Pass arguments to `get_audience_export` via keyword arguments. Note that at
|
1320
|
+
# least one keyword argument is required. To specify no parameters, or to keep all
|
1321
|
+
# the default parameter values, pass an empty Hash as a request object (see above).
|
1322
|
+
#
|
1323
|
+
# @param name [::String]
|
1324
|
+
# Required. The audience export resource name.
|
1325
|
+
# Format: `properties/{property}/audienceExports/{audience_export}`
|
1326
|
+
#
|
1327
|
+
# @yield [response, operation] Access the result along with the RPC operation
|
1328
|
+
# @yieldparam response [::Google::Analytics::Data::V1beta::AudienceExport]
|
1329
|
+
# @yieldparam operation [::GRPC::ActiveCall::Operation]
|
1330
|
+
#
|
1331
|
+
# @return [::Google::Analytics::Data::V1beta::AudienceExport]
|
1332
|
+
#
|
1333
|
+
# @raise [::Google::Cloud::Error] if the RPC is aborted.
|
1334
|
+
#
|
1335
|
+
# @example Basic example
|
1336
|
+
# require "google/analytics/data/v1beta"
|
1337
|
+
#
|
1338
|
+
# # Create a client object. The client can be reused for multiple calls.
|
1339
|
+
# client = Google::Analytics::Data::V1beta::AnalyticsData::Client.new
|
1340
|
+
#
|
1341
|
+
# # Create a request. To set request fields, pass in keyword arguments.
|
1342
|
+
# request = Google::Analytics::Data::V1beta::GetAudienceExportRequest.new
|
1343
|
+
#
|
1344
|
+
# # Call the get_audience_export method.
|
1345
|
+
# result = client.get_audience_export request
|
1346
|
+
#
|
1347
|
+
# # The returned object is of type Google::Analytics::Data::V1beta::AudienceExport.
|
1348
|
+
# p result
|
1349
|
+
#
|
1350
|
+
def get_audience_export request, options = nil
|
1351
|
+
raise ::ArgumentError, "request must be provided" if request.nil?
|
1352
|
+
|
1353
|
+
request = ::Gapic::Protobuf.coerce request, to: ::Google::Analytics::Data::V1beta::GetAudienceExportRequest
|
1354
|
+
|
1355
|
+
# Converts hash and nil to an options object
|
1356
|
+
options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
|
1357
|
+
|
1358
|
+
# Customize the options with defaults
|
1359
|
+
metadata = @config.rpcs.get_audience_export.metadata.to_h
|
1360
|
+
|
1361
|
+
# Set x-goog-api-client and x-goog-user-project headers
|
1362
|
+
metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
|
1363
|
+
lib_name: @config.lib_name, lib_version: @config.lib_version,
|
1364
|
+
gapic_version: ::Google::Analytics::Data::V1beta::VERSION
|
1365
|
+
metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
|
1366
|
+
|
1367
|
+
header_params = {}
|
1368
|
+
if request.name
|
1369
|
+
header_params["name"] = request.name
|
1370
|
+
end
|
1371
|
+
|
1372
|
+
request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
|
1373
|
+
metadata[:"x-goog-request-params"] ||= request_params_header
|
1374
|
+
|
1375
|
+
options.apply_defaults timeout: @config.rpcs.get_audience_export.timeout,
|
1376
|
+
metadata: metadata,
|
1377
|
+
retry_policy: @config.rpcs.get_audience_export.retry_policy
|
1378
|
+
|
1379
|
+
options.apply_defaults timeout: @config.timeout,
|
1380
|
+
metadata: @config.metadata,
|
1381
|
+
retry_policy: @config.retry_policy
|
1382
|
+
|
1383
|
+
@analytics_data_stub.call_rpc :get_audience_export, request, options: options do |response, operation|
|
1384
|
+
yield response, operation if block_given?
|
1385
|
+
return response
|
1386
|
+
end
|
1387
|
+
rescue ::GRPC::BadStatus => e
|
1388
|
+
raise ::Google::Cloud::Error.from_error(e)
|
1389
|
+
end
|
1390
|
+
|
1391
|
+
##
|
1392
|
+
# Lists all audience exports for a property. This method can be used for you
|
1393
|
+
# to find and reuse existing audience exports rather than creating
|
1394
|
+
# unnecessary new audience exports. The same audience can have multiple
|
1395
|
+
# audience exports that represent the export of users that were in an
|
1396
|
+
# audience on different days.
|
1397
|
+
#
|
1398
|
+
# See [Creating an Audience
|
1399
|
+
# Export](https://developers.google.com/analytics/devguides/reporting/data/v1/audience-list-basics)
|
1400
|
+
# for an introduction to Audience Exports with examples.
|
1401
|
+
#
|
1402
|
+
# Audience Export APIs have some methods at alpha and other methods at beta
|
1403
|
+
# stability. The intention is to advance methods to beta stability after some
|
1404
|
+
# feedback and adoption. To give your feedback on this API, complete the
|
1405
|
+
# [Google Analytics Audience Export API
|
1406
|
+
# Feedback](https://forms.gle/EeA5u5LW6PEggtCEA) form.
|
1407
|
+
#
|
1408
|
+
# @overload list_audience_exports(request, options = nil)
|
1409
|
+
# Pass arguments to `list_audience_exports` via a request object, either of type
|
1410
|
+
# {::Google::Analytics::Data::V1beta::ListAudienceExportsRequest} or an equivalent Hash.
|
1411
|
+
#
|
1412
|
+
# @param request [::Google::Analytics::Data::V1beta::ListAudienceExportsRequest, ::Hash]
|
1413
|
+
# A request object representing the call parameters. Required. To specify no
|
1414
|
+
# parameters, or to keep all the default parameter values, pass an empty Hash.
|
1415
|
+
# @param options [::Gapic::CallOptions, ::Hash]
|
1416
|
+
# Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
|
1417
|
+
#
|
1418
|
+
# @overload list_audience_exports(parent: nil, page_size: nil, page_token: nil)
|
1419
|
+
# Pass arguments to `list_audience_exports` via keyword arguments. Note that at
|
1420
|
+
# least one keyword argument is required. To specify no parameters, or to keep all
|
1421
|
+
# the default parameter values, pass an empty Hash as a request object (see above).
|
1422
|
+
#
|
1423
|
+
# @param parent [::String]
|
1424
|
+
# Required. All audience exports for this property will be listed in the
|
1425
|
+
# response. Format: `properties/{property}`
|
1426
|
+
# @param page_size [::Integer]
|
1427
|
+
# Optional. The maximum number of audience exports to return. The service may
|
1428
|
+
# return fewer than this value. If unspecified, at most 200 audience exports
|
1429
|
+
# will be returned. The maximum value is 1000 (higher values will be coerced
|
1430
|
+
# to the maximum).
|
1431
|
+
# @param page_token [::String]
|
1432
|
+
# Optional. A page token, received from a previous `ListAudienceExports`
|
1433
|
+
# call. Provide this to retrieve the subsequent page.
|
1434
|
+
#
|
1435
|
+
# When paginating, all other parameters provided to `ListAudienceExports`
|
1436
|
+
# must match the call that provided the page token.
|
1437
|
+
#
|
1438
|
+
# @yield [response, operation] Access the result along with the RPC operation
|
1439
|
+
# @yieldparam response [::Gapic::PagedEnumerable<::Google::Analytics::Data::V1beta::AudienceExport>]
|
1440
|
+
# @yieldparam operation [::GRPC::ActiveCall::Operation]
|
1441
|
+
#
|
1442
|
+
# @return [::Gapic::PagedEnumerable<::Google::Analytics::Data::V1beta::AudienceExport>]
|
1443
|
+
#
|
1444
|
+
# @raise [::Google::Cloud::Error] if the RPC is aborted.
|
1445
|
+
#
|
1446
|
+
# @example Basic example
|
1447
|
+
# require "google/analytics/data/v1beta"
|
1448
|
+
#
|
1449
|
+
# # Create a client object. The client can be reused for multiple calls.
|
1450
|
+
# client = Google::Analytics::Data::V1beta::AnalyticsData::Client.new
|
1451
|
+
#
|
1452
|
+
# # Create a request. To set request fields, pass in keyword arguments.
|
1453
|
+
# request = Google::Analytics::Data::V1beta::ListAudienceExportsRequest.new
|
1454
|
+
#
|
1455
|
+
# # Call the list_audience_exports method.
|
1456
|
+
# result = client.list_audience_exports request
|
1457
|
+
#
|
1458
|
+
# # The returned object is of type Gapic::PagedEnumerable. You can iterate
|
1459
|
+
# # over elements, and API calls will be issued to fetch pages as needed.
|
1460
|
+
# result.each do |item|
|
1461
|
+
# # Each element is of type ::Google::Analytics::Data::V1beta::AudienceExport.
|
1462
|
+
# p item
|
1463
|
+
# end
|
1464
|
+
#
|
1465
|
+
def list_audience_exports request, options = nil
|
1466
|
+
raise ::ArgumentError, "request must be provided" if request.nil?
|
1467
|
+
|
1468
|
+
request = ::Gapic::Protobuf.coerce request, to: ::Google::Analytics::Data::V1beta::ListAudienceExportsRequest
|
1469
|
+
|
1470
|
+
# Converts hash and nil to an options object
|
1471
|
+
options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
|
1472
|
+
|
1473
|
+
# Customize the options with defaults
|
1474
|
+
metadata = @config.rpcs.list_audience_exports.metadata.to_h
|
1475
|
+
|
1476
|
+
# Set x-goog-api-client and x-goog-user-project headers
|
1477
|
+
metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
|
1478
|
+
lib_name: @config.lib_name, lib_version: @config.lib_version,
|
1479
|
+
gapic_version: ::Google::Analytics::Data::V1beta::VERSION
|
1480
|
+
metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
|
1481
|
+
|
1482
|
+
header_params = {}
|
1483
|
+
if request.parent
|
1484
|
+
header_params["parent"] = request.parent
|
1485
|
+
end
|
1486
|
+
|
1487
|
+
request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
|
1488
|
+
metadata[:"x-goog-request-params"] ||= request_params_header
|
1489
|
+
|
1490
|
+
options.apply_defaults timeout: @config.rpcs.list_audience_exports.timeout,
|
1491
|
+
metadata: metadata,
|
1492
|
+
retry_policy: @config.rpcs.list_audience_exports.retry_policy
|
1493
|
+
|
1494
|
+
options.apply_defaults timeout: @config.timeout,
|
1495
|
+
metadata: @config.metadata,
|
1496
|
+
retry_policy: @config.retry_policy
|
1497
|
+
|
1498
|
+
@analytics_data_stub.call_rpc :list_audience_exports, request, options: options do |response, operation|
|
1499
|
+
response = ::Gapic::PagedEnumerable.new @analytics_data_stub, :list_audience_exports, request, response, operation, options
|
1500
|
+
yield response, operation if block_given?
|
1501
|
+
return response
|
1502
|
+
end
|
1503
|
+
rescue ::GRPC::BadStatus => e
|
1504
|
+
raise ::Google::Cloud::Error.from_error(e)
|
1505
|
+
end
|
1506
|
+
|
1020
1507
|
##
|
1021
1508
|
# Configuration class for the AnalyticsData API.
|
1022
1509
|
#
|
@@ -1047,9 +1534,9 @@ module Google
|
|
1047
1534
|
# end
|
1048
1535
|
#
|
1049
1536
|
# @!attribute [rw] endpoint
|
1050
|
-
#
|
1051
|
-
#
|
1052
|
-
# @return [::String]
|
1537
|
+
# A custom service endpoint, as a hostname or hostname:port. The default is
|
1538
|
+
# nil, indicating to use the default endpoint in the current universe domain.
|
1539
|
+
# @return [::String,nil]
|
1053
1540
|
# @!attribute [rw] credentials
|
1054
1541
|
# Credentials to send with calls. You may provide any of the following types:
|
1055
1542
|
# * (`String`) The path to a service account key file in JSON format
|
@@ -1095,13 +1582,20 @@ module Google
|
|
1095
1582
|
# @!attribute [rw] quota_project
|
1096
1583
|
# A separate project against which to charge quota.
|
1097
1584
|
# @return [::String]
|
1585
|
+
# @!attribute [rw] universe_domain
|
1586
|
+
# The universe domain within which to make requests. This determines the
|
1587
|
+
# default endpoint URL. The default value of nil uses the environment
|
1588
|
+
# universe (usually the default "googleapis.com" universe).
|
1589
|
+
# @return [::String,nil]
|
1098
1590
|
#
|
1099
1591
|
class Configuration
|
1100
1592
|
extend ::Gapic::Config
|
1101
1593
|
|
1594
|
+
# @private
|
1595
|
+
# The endpoint specific to the default "googleapis.com" universe. Deprecated.
|
1102
1596
|
DEFAULT_ENDPOINT = "analyticsdata.googleapis.com"
|
1103
1597
|
|
1104
|
-
config_attr :endpoint,
|
1598
|
+
config_attr :endpoint, nil, ::String, nil
|
1105
1599
|
config_attr :credentials, nil do |value|
|
1106
1600
|
allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Signet::OAuth2::Client, nil]
|
1107
1601
|
allowed += [::GRPC::Core::Channel, ::GRPC::Core::ChannelCredentials] if defined? ::GRPC
|
@@ -1116,6 +1610,7 @@ module Google
|
|
1116
1610
|
config_attr :metadata, nil, ::Hash, nil
|
1117
1611
|
config_attr :retry_policy, nil, ::Hash, ::Proc, nil
|
1118
1612
|
config_attr :quota_project, nil, ::String, nil
|
1613
|
+
config_attr :universe_domain, nil, ::String, nil
|
1119
1614
|
|
1120
1615
|
# @private
|
1121
1616
|
def initialize parent_config = nil
|
@@ -1197,6 +1692,26 @@ module Google
|
|
1197
1692
|
# @return [::Gapic::Config::Method]
|
1198
1693
|
#
|
1199
1694
|
attr_reader :check_compatibility
|
1695
|
+
##
|
1696
|
+
# RPC-specific configuration for `create_audience_export`
|
1697
|
+
# @return [::Gapic::Config::Method]
|
1698
|
+
#
|
1699
|
+
attr_reader :create_audience_export
|
1700
|
+
##
|
1701
|
+
# RPC-specific configuration for `query_audience_export`
|
1702
|
+
# @return [::Gapic::Config::Method]
|
1703
|
+
#
|
1704
|
+
attr_reader :query_audience_export
|
1705
|
+
##
|
1706
|
+
# RPC-specific configuration for `get_audience_export`
|
1707
|
+
# @return [::Gapic::Config::Method]
|
1708
|
+
#
|
1709
|
+
attr_reader :get_audience_export
|
1710
|
+
##
|
1711
|
+
# RPC-specific configuration for `list_audience_exports`
|
1712
|
+
# @return [::Gapic::Config::Method]
|
1713
|
+
#
|
1714
|
+
attr_reader :list_audience_exports
|
1200
1715
|
|
1201
1716
|
# @private
|
1202
1717
|
def initialize parent_rpcs = nil
|
@@ -1214,6 +1729,14 @@ module Google
|
|
1214
1729
|
@run_realtime_report = ::Gapic::Config::Method.new run_realtime_report_config
|
1215
1730
|
check_compatibility_config = parent_rpcs.check_compatibility if parent_rpcs.respond_to? :check_compatibility
|
1216
1731
|
@check_compatibility = ::Gapic::Config::Method.new check_compatibility_config
|
1732
|
+
create_audience_export_config = parent_rpcs.create_audience_export if parent_rpcs.respond_to? :create_audience_export
|
1733
|
+
@create_audience_export = ::Gapic::Config::Method.new create_audience_export_config
|
1734
|
+
query_audience_export_config = parent_rpcs.query_audience_export if parent_rpcs.respond_to? :query_audience_export
|
1735
|
+
@query_audience_export = ::Gapic::Config::Method.new query_audience_export_config
|
1736
|
+
get_audience_export_config = parent_rpcs.get_audience_export if parent_rpcs.respond_to? :get_audience_export
|
1737
|
+
@get_audience_export = ::Gapic::Config::Method.new get_audience_export_config
|
1738
|
+
list_audience_exports_config = parent_rpcs.list_audience_exports if parent_rpcs.respond_to? :list_audience_exports
|
1739
|
+
@list_audience_exports = ::Gapic::Config::Method.new list_audience_exports_config
|
1217
1740
|
|
1218
1741
|
yield self if block_given?
|
1219
1742
|
end
|