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.
@@ -24,6 +24,23 @@ module Google
24
24
  module AnalyticsData
25
25
  # Path helper methods for the AnalyticsData API.
26
26
  module Paths
27
+ ##
28
+ # Create a fully-qualified AudienceExport resource string.
29
+ #
30
+ # The resource will be in the following format:
31
+ #
32
+ # `properties/{property}/audienceExports/{audience_export}`
33
+ #
34
+ # @param property [String]
35
+ # @param audience_export [String]
36
+ #
37
+ # @return [::String]
38
+ def audience_export_path property:, audience_export:
39
+ raise ::ArgumentError, "property cannot contain /" if property.to_s.include? "/"
40
+
41
+ "properties/#{property}/audienceExports/#{audience_export}"
42
+ end
43
+
27
44
  ##
28
45
  # Create a fully-qualified Metadata resource string.
29
46
  #
@@ -38,6 +55,20 @@ module Google
38
55
  "properties/#{property}/metadata"
39
56
  end
40
57
 
58
+ ##
59
+ # Create a fully-qualified Property resource string.
60
+ #
61
+ # The resource will be in the following format:
62
+ #
63
+ # `properties/{property}`
64
+ #
65
+ # @param property [String]
66
+ #
67
+ # @return [::String]
68
+ def property_path property:
69
+ "properties/#{property}"
70
+ end
71
+
41
72
  extend self
42
73
  end
43
74
  end
@@ -32,6 +32,9 @@ module Google
32
32
  # Google Analytics reporting data service.
33
33
  #
34
34
  class Client
35
+ # @private
36
+ DEFAULT_ENDPOINT_TEMPLATE = "analyticsdata.$UNIVERSE_DOMAIN$"
37
+
35
38
  include Paths
36
39
 
37
40
  # @private
@@ -111,6 +114,15 @@ module Google
111
114
  @config
112
115
  end
113
116
 
117
+ ##
118
+ # The effective universe domain
119
+ #
120
+ # @return [String]
121
+ #
122
+ def universe_domain
123
+ @analytics_data_stub.universe_domain
124
+ end
125
+
114
126
  ##
115
127
  # Create a new AnalyticsData REST client object.
116
128
  #
@@ -138,8 +150,9 @@ module Google
138
150
  credentials = @config.credentials
139
151
  # Use self-signed JWT if the endpoint is unchanged from default,
140
152
  # but only if the default endpoint does not have a region prefix.
141
- enable_self_signed_jwt = @config.endpoint == Configuration::DEFAULT_ENDPOINT &&
142
- !@config.endpoint.split(".").first.include?("-")
153
+ enable_self_signed_jwt = @config.endpoint.nil? ||
154
+ (@config.endpoint == Configuration::DEFAULT_ENDPOINT &&
155
+ !@config.endpoint.split(".").first.include?("-"))
143
156
  credentials ||= Credentials.default scope: @config.scope,
144
157
  enable_self_signed_jwt: enable_self_signed_jwt
145
158
  if credentials.is_a?(::String) || credentials.is_a?(::Hash)
@@ -149,9 +162,28 @@ module Google
149
162
  @quota_project_id = @config.quota_project
150
163
  @quota_project_id ||= credentials.quota_project_id if credentials.respond_to? :quota_project_id
151
164
 
152
- @analytics_data_stub = ::Google::Analytics::Data::V1beta::AnalyticsData::Rest::ServiceStub.new endpoint: @config.endpoint, credentials: credentials
165
+ @operations_client = ::Google::Analytics::Data::V1beta::AnalyticsData::Rest::Operations.new do |config|
166
+ config.credentials = credentials
167
+ config.quota_project = @quota_project_id
168
+ config.endpoint = @config.endpoint
169
+ config.universe_domain = @config.universe_domain
170
+ end
171
+
172
+ @analytics_data_stub = ::Google::Analytics::Data::V1beta::AnalyticsData::Rest::ServiceStub.new(
173
+ endpoint: @config.endpoint,
174
+ endpoint_template: DEFAULT_ENDPOINT_TEMPLATE,
175
+ universe_domain: @config.universe_domain,
176
+ credentials: credentials
177
+ )
153
178
  end
154
179
 
180
+ ##
181
+ # Get the associated client for long-running operations.
182
+ #
183
+ # @return [::Google::Analytics::Data::V1beta::AnalyticsData::Rest::Operations]
184
+ #
185
+ attr_reader :operations_client
186
+
155
187
  # Service calls
156
188
 
157
189
  ##
@@ -958,6 +990,436 @@ module Google
958
990
  raise ::Google::Cloud::Error.from_error(e)
959
991
  end
960
992
 
993
+ ##
994
+ # Creates an audience export for later retrieval. This method quickly returns
995
+ # the audience export's resource name and initiates a long running
996
+ # asynchronous request to form an audience export. To export the users in an
997
+ # audience export, first create the audience export through this method and
998
+ # then send the audience resource name to the `QueryAudienceExport` method.
999
+ #
1000
+ # See [Creating an Audience
1001
+ # Export](https://developers.google.com/analytics/devguides/reporting/data/v1/audience-list-basics)
1002
+ # for an introduction to Audience Exports with examples.
1003
+ #
1004
+ # An audience export is a snapshot of the users currently in the audience at
1005
+ # the time of audience export creation. Creating audience exports for one
1006
+ # audience on different days will return different results as users enter and
1007
+ # exit the audience.
1008
+ #
1009
+ # Audiences in Google Analytics 4 allow you to segment your users in the ways
1010
+ # that are important to your business. To learn more, see
1011
+ # https://support.google.com/analytics/answer/9267572. Audience exports
1012
+ # contain the users in each audience.
1013
+ #
1014
+ # Audience Export APIs have some methods at alpha and other methods at beta
1015
+ # stability. The intention is to advance methods to beta stability after some
1016
+ # feedback and adoption. To give your feedback on this API, complete the
1017
+ # [Google Analytics Audience Export API
1018
+ # Feedback](https://forms.gle/EeA5u5LW6PEggtCEA) form.
1019
+ #
1020
+ # @overload create_audience_export(request, options = nil)
1021
+ # Pass arguments to `create_audience_export` via a request object, either of type
1022
+ # {::Google::Analytics::Data::V1beta::CreateAudienceExportRequest} or an equivalent Hash.
1023
+ #
1024
+ # @param request [::Google::Analytics::Data::V1beta::CreateAudienceExportRequest, ::Hash]
1025
+ # A request object representing the call parameters. Required. To specify no
1026
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
1027
+ # @param options [::Gapic::CallOptions, ::Hash]
1028
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
1029
+ #
1030
+ # @overload create_audience_export(parent: nil, audience_export: nil)
1031
+ # Pass arguments to `create_audience_export` via keyword arguments. Note that at
1032
+ # least one keyword argument is required. To specify no parameters, or to keep all
1033
+ # the default parameter values, pass an empty Hash as a request object (see above).
1034
+ #
1035
+ # @param parent [::String]
1036
+ # Required. The parent resource where this audience export will be created.
1037
+ # Format: `properties/{property}`
1038
+ # @param audience_export [::Google::Analytics::Data::V1beta::AudienceExport, ::Hash]
1039
+ # Required. The audience export to create.
1040
+ # @yield [result, operation] Access the result along with the TransportOperation object
1041
+ # @yieldparam result [::Gapic::Operation]
1042
+ # @yieldparam operation [::Gapic::Rest::TransportOperation]
1043
+ #
1044
+ # @return [::Gapic::Operation]
1045
+ #
1046
+ # @raise [::Google::Cloud::Error] if the REST call is aborted.
1047
+ #
1048
+ # @example Basic example
1049
+ # require "google/analytics/data/v1beta"
1050
+ #
1051
+ # # Create a client object. The client can be reused for multiple calls.
1052
+ # client = Google::Analytics::Data::V1beta::AnalyticsData::Rest::Client.new
1053
+ #
1054
+ # # Create a request. To set request fields, pass in keyword arguments.
1055
+ # request = Google::Analytics::Data::V1beta::CreateAudienceExportRequest.new
1056
+ #
1057
+ # # Call the create_audience_export method.
1058
+ # result = client.create_audience_export request
1059
+ #
1060
+ # # The returned object is of type Gapic::Operation. You can use it to
1061
+ # # check the status of an operation, cancel it, or wait for results.
1062
+ # # Here is how to wait for a response.
1063
+ # result.wait_until_done! timeout: 60
1064
+ # if result.response?
1065
+ # p result.response
1066
+ # else
1067
+ # puts "No response received."
1068
+ # end
1069
+ #
1070
+ def create_audience_export request, options = nil
1071
+ raise ::ArgumentError, "request must be provided" if request.nil?
1072
+
1073
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Analytics::Data::V1beta::CreateAudienceExportRequest
1074
+
1075
+ # Converts hash and nil to an options object
1076
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
1077
+
1078
+ # Customize the options with defaults
1079
+ call_metadata = @config.rpcs.create_audience_export.metadata.to_h
1080
+
1081
+ # Set x-goog-api-client and x-goog-user-project headers
1082
+ call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
1083
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
1084
+ gapic_version: ::Google::Analytics::Data::V1beta::VERSION,
1085
+ transports_version_send: [:rest]
1086
+
1087
+ call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
1088
+
1089
+ options.apply_defaults timeout: @config.rpcs.create_audience_export.timeout,
1090
+ metadata: call_metadata,
1091
+ retry_policy: @config.rpcs.create_audience_export.retry_policy
1092
+
1093
+ options.apply_defaults timeout: @config.timeout,
1094
+ metadata: @config.metadata,
1095
+ retry_policy: @config.retry_policy
1096
+
1097
+ @analytics_data_stub.create_audience_export request, options do |result, operation|
1098
+ result = ::Gapic::Operation.new result, @operations_client, options: options
1099
+ yield result, operation if block_given?
1100
+ return result
1101
+ end
1102
+ rescue ::Gapic::Rest::Error => e
1103
+ raise ::Google::Cloud::Error.from_error(e)
1104
+ end
1105
+
1106
+ ##
1107
+ # Retrieves an audience export of users. After creating an audience, the
1108
+ # users are not immediately available for exporting. First, a request to
1109
+ # `CreateAudienceExport` is necessary to create an audience export of users,
1110
+ # and then second, this method is used to retrieve the users in the audience
1111
+ # export.
1112
+ #
1113
+ # See [Creating an Audience
1114
+ # Export](https://developers.google.com/analytics/devguides/reporting/data/v1/audience-list-basics)
1115
+ # for an introduction to Audience Exports with examples.
1116
+ #
1117
+ # Audiences in Google Analytics 4 allow you to segment your users in the ways
1118
+ # that are important to your business. To learn more, see
1119
+ # https://support.google.com/analytics/answer/9267572.
1120
+ #
1121
+ # Audience Export APIs have some methods at alpha and other methods at beta
1122
+ # stability. The intention is to advance methods to beta stability after some
1123
+ # feedback and adoption. To give your feedback on this API, complete the
1124
+ # [Google Analytics Audience Export API
1125
+ # Feedback](https://forms.gle/EeA5u5LW6PEggtCEA) form.
1126
+ #
1127
+ # @overload query_audience_export(request, options = nil)
1128
+ # Pass arguments to `query_audience_export` via a request object, either of type
1129
+ # {::Google::Analytics::Data::V1beta::QueryAudienceExportRequest} or an equivalent Hash.
1130
+ #
1131
+ # @param request [::Google::Analytics::Data::V1beta::QueryAudienceExportRequest, ::Hash]
1132
+ # A request object representing the call parameters. Required. To specify no
1133
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
1134
+ # @param options [::Gapic::CallOptions, ::Hash]
1135
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
1136
+ #
1137
+ # @overload query_audience_export(name: nil, offset: nil, limit: nil)
1138
+ # Pass arguments to `query_audience_export` via keyword arguments. Note that at
1139
+ # least one keyword argument is required. To specify no parameters, or to keep all
1140
+ # the default parameter values, pass an empty Hash as a request object (see above).
1141
+ #
1142
+ # @param name [::String]
1143
+ # Required. The name of the audience export to retrieve users from.
1144
+ # Format: `properties/{property}/audienceExports/{audience_export}`
1145
+ # @param offset [::Integer]
1146
+ # Optional. The row count of the start row. The first row is counted as row
1147
+ # 0.
1148
+ #
1149
+ # When paging, the first request does not specify offset; or equivalently,
1150
+ # sets offset to 0; the first request returns the first `limit` of rows. The
1151
+ # second request sets offset to the `limit` of the first request; the second
1152
+ # request returns the second `limit` of rows.
1153
+ #
1154
+ # To learn more about this pagination parameter, see
1155
+ # [Pagination](https://developers.google.com/analytics/devguides/reporting/data/v1/basics#pagination).
1156
+ # @param limit [::Integer]
1157
+ # Optional. The number of rows to return. If unspecified, 10,000 rows are
1158
+ # returned. The API returns a maximum of 250,000 rows per request, no matter
1159
+ # how many you ask for. `limit` must be positive.
1160
+ #
1161
+ # The API can also return fewer rows than the requested `limit`, if there
1162
+ # aren't as many dimension values as the `limit`.
1163
+ #
1164
+ # To learn more about this pagination parameter, see
1165
+ # [Pagination](https://developers.google.com/analytics/devguides/reporting/data/v1/basics#pagination).
1166
+ # @yield [result, operation] Access the result along with the TransportOperation object
1167
+ # @yieldparam result [::Google::Analytics::Data::V1beta::QueryAudienceExportResponse]
1168
+ # @yieldparam operation [::Gapic::Rest::TransportOperation]
1169
+ #
1170
+ # @return [::Google::Analytics::Data::V1beta::QueryAudienceExportResponse]
1171
+ #
1172
+ # @raise [::Google::Cloud::Error] if the REST call is aborted.
1173
+ #
1174
+ # @example Basic example
1175
+ # require "google/analytics/data/v1beta"
1176
+ #
1177
+ # # Create a client object. The client can be reused for multiple calls.
1178
+ # client = Google::Analytics::Data::V1beta::AnalyticsData::Rest::Client.new
1179
+ #
1180
+ # # Create a request. To set request fields, pass in keyword arguments.
1181
+ # request = Google::Analytics::Data::V1beta::QueryAudienceExportRequest.new
1182
+ #
1183
+ # # Call the query_audience_export method.
1184
+ # result = client.query_audience_export request
1185
+ #
1186
+ # # The returned object is of type Google::Analytics::Data::V1beta::QueryAudienceExportResponse.
1187
+ # p result
1188
+ #
1189
+ def query_audience_export request, options = nil
1190
+ raise ::ArgumentError, "request must be provided" if request.nil?
1191
+
1192
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Analytics::Data::V1beta::QueryAudienceExportRequest
1193
+
1194
+ # Converts hash and nil to an options object
1195
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
1196
+
1197
+ # Customize the options with defaults
1198
+ call_metadata = @config.rpcs.query_audience_export.metadata.to_h
1199
+
1200
+ # Set x-goog-api-client and x-goog-user-project headers
1201
+ call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
1202
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
1203
+ gapic_version: ::Google::Analytics::Data::V1beta::VERSION,
1204
+ transports_version_send: [:rest]
1205
+
1206
+ call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
1207
+
1208
+ options.apply_defaults timeout: @config.rpcs.query_audience_export.timeout,
1209
+ metadata: call_metadata,
1210
+ retry_policy: @config.rpcs.query_audience_export.retry_policy
1211
+
1212
+ options.apply_defaults timeout: @config.timeout,
1213
+ metadata: @config.metadata,
1214
+ retry_policy: @config.retry_policy
1215
+
1216
+ @analytics_data_stub.query_audience_export request, options do |result, operation|
1217
+ yield result, operation if block_given?
1218
+ return result
1219
+ end
1220
+ rescue ::Gapic::Rest::Error => e
1221
+ raise ::Google::Cloud::Error.from_error(e)
1222
+ end
1223
+
1224
+ ##
1225
+ # Gets configuration metadata about a specific audience export. This method
1226
+ # can be used to understand an audience export after it has been created.
1227
+ #
1228
+ # See [Creating an Audience
1229
+ # Export](https://developers.google.com/analytics/devguides/reporting/data/v1/audience-list-basics)
1230
+ # for an introduction to Audience Exports with examples.
1231
+ #
1232
+ # Audience Export APIs have some methods at alpha and other methods at beta
1233
+ # stability. The intention is to advance methods to beta stability after some
1234
+ # feedback and adoption. To give your feedback on this API, complete the
1235
+ # [Google Analytics Audience Export API
1236
+ # Feedback](https://forms.gle/EeA5u5LW6PEggtCEA) form.
1237
+ #
1238
+ # @overload get_audience_export(request, options = nil)
1239
+ # Pass arguments to `get_audience_export` via a request object, either of type
1240
+ # {::Google::Analytics::Data::V1beta::GetAudienceExportRequest} or an equivalent Hash.
1241
+ #
1242
+ # @param request [::Google::Analytics::Data::V1beta::GetAudienceExportRequest, ::Hash]
1243
+ # A request object representing the call parameters. Required. To specify no
1244
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
1245
+ # @param options [::Gapic::CallOptions, ::Hash]
1246
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
1247
+ #
1248
+ # @overload get_audience_export(name: nil)
1249
+ # Pass arguments to `get_audience_export` via keyword arguments. Note that at
1250
+ # least one keyword argument is required. To specify no parameters, or to keep all
1251
+ # the default parameter values, pass an empty Hash as a request object (see above).
1252
+ #
1253
+ # @param name [::String]
1254
+ # Required. The audience export resource name.
1255
+ # Format: `properties/{property}/audienceExports/{audience_export}`
1256
+ # @yield [result, operation] Access the result along with the TransportOperation object
1257
+ # @yieldparam result [::Google::Analytics::Data::V1beta::AudienceExport]
1258
+ # @yieldparam operation [::Gapic::Rest::TransportOperation]
1259
+ #
1260
+ # @return [::Google::Analytics::Data::V1beta::AudienceExport]
1261
+ #
1262
+ # @raise [::Google::Cloud::Error] if the REST call is aborted.
1263
+ #
1264
+ # @example Basic example
1265
+ # require "google/analytics/data/v1beta"
1266
+ #
1267
+ # # Create a client object. The client can be reused for multiple calls.
1268
+ # client = Google::Analytics::Data::V1beta::AnalyticsData::Rest::Client.new
1269
+ #
1270
+ # # Create a request. To set request fields, pass in keyword arguments.
1271
+ # request = Google::Analytics::Data::V1beta::GetAudienceExportRequest.new
1272
+ #
1273
+ # # Call the get_audience_export method.
1274
+ # result = client.get_audience_export request
1275
+ #
1276
+ # # The returned object is of type Google::Analytics::Data::V1beta::AudienceExport.
1277
+ # p result
1278
+ #
1279
+ def get_audience_export request, options = nil
1280
+ raise ::ArgumentError, "request must be provided" if request.nil?
1281
+
1282
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Analytics::Data::V1beta::GetAudienceExportRequest
1283
+
1284
+ # Converts hash and nil to an options object
1285
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
1286
+
1287
+ # Customize the options with defaults
1288
+ call_metadata = @config.rpcs.get_audience_export.metadata.to_h
1289
+
1290
+ # Set x-goog-api-client and x-goog-user-project headers
1291
+ call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
1292
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
1293
+ gapic_version: ::Google::Analytics::Data::V1beta::VERSION,
1294
+ transports_version_send: [:rest]
1295
+
1296
+ call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
1297
+
1298
+ options.apply_defaults timeout: @config.rpcs.get_audience_export.timeout,
1299
+ metadata: call_metadata,
1300
+ retry_policy: @config.rpcs.get_audience_export.retry_policy
1301
+
1302
+ options.apply_defaults timeout: @config.timeout,
1303
+ metadata: @config.metadata,
1304
+ retry_policy: @config.retry_policy
1305
+
1306
+ @analytics_data_stub.get_audience_export request, options do |result, operation|
1307
+ yield result, operation if block_given?
1308
+ return result
1309
+ end
1310
+ rescue ::Gapic::Rest::Error => e
1311
+ raise ::Google::Cloud::Error.from_error(e)
1312
+ end
1313
+
1314
+ ##
1315
+ # Lists all audience exports for a property. This method can be used for you
1316
+ # to find and reuse existing audience exports rather than creating
1317
+ # unnecessary new audience exports. The same audience can have multiple
1318
+ # audience exports that represent the export of users that were in an
1319
+ # audience on different days.
1320
+ #
1321
+ # See [Creating an Audience
1322
+ # Export](https://developers.google.com/analytics/devguides/reporting/data/v1/audience-list-basics)
1323
+ # for an introduction to Audience Exports with examples.
1324
+ #
1325
+ # Audience Export APIs have some methods at alpha and other methods at beta
1326
+ # stability. The intention is to advance methods to beta stability after some
1327
+ # feedback and adoption. To give your feedback on this API, complete the
1328
+ # [Google Analytics Audience Export API
1329
+ # Feedback](https://forms.gle/EeA5u5LW6PEggtCEA) form.
1330
+ #
1331
+ # @overload list_audience_exports(request, options = nil)
1332
+ # Pass arguments to `list_audience_exports` via a request object, either of type
1333
+ # {::Google::Analytics::Data::V1beta::ListAudienceExportsRequest} or an equivalent Hash.
1334
+ #
1335
+ # @param request [::Google::Analytics::Data::V1beta::ListAudienceExportsRequest, ::Hash]
1336
+ # A request object representing the call parameters. Required. To specify no
1337
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
1338
+ # @param options [::Gapic::CallOptions, ::Hash]
1339
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
1340
+ #
1341
+ # @overload list_audience_exports(parent: nil, page_size: nil, page_token: nil)
1342
+ # Pass arguments to `list_audience_exports` via keyword arguments. Note that at
1343
+ # least one keyword argument is required. To specify no parameters, or to keep all
1344
+ # the default parameter values, pass an empty Hash as a request object (see above).
1345
+ #
1346
+ # @param parent [::String]
1347
+ # Required. All audience exports for this property will be listed in the
1348
+ # response. Format: `properties/{property}`
1349
+ # @param page_size [::Integer]
1350
+ # Optional. The maximum number of audience exports to return. The service may
1351
+ # return fewer than this value. If unspecified, at most 200 audience exports
1352
+ # will be returned. The maximum value is 1000 (higher values will be coerced
1353
+ # to the maximum).
1354
+ # @param page_token [::String]
1355
+ # Optional. A page token, received from a previous `ListAudienceExports`
1356
+ # call. Provide this to retrieve the subsequent page.
1357
+ #
1358
+ # When paginating, all other parameters provided to `ListAudienceExports`
1359
+ # must match the call that provided the page token.
1360
+ # @yield [result, operation] Access the result along with the TransportOperation object
1361
+ # @yieldparam result [::Gapic::Rest::PagedEnumerable<::Google::Analytics::Data::V1beta::AudienceExport>]
1362
+ # @yieldparam operation [::Gapic::Rest::TransportOperation]
1363
+ #
1364
+ # @return [::Gapic::Rest::PagedEnumerable<::Google::Analytics::Data::V1beta::AudienceExport>]
1365
+ #
1366
+ # @raise [::Google::Cloud::Error] if the REST call is aborted.
1367
+ #
1368
+ # @example Basic example
1369
+ # require "google/analytics/data/v1beta"
1370
+ #
1371
+ # # Create a client object. The client can be reused for multiple calls.
1372
+ # client = Google::Analytics::Data::V1beta::AnalyticsData::Rest::Client.new
1373
+ #
1374
+ # # Create a request. To set request fields, pass in keyword arguments.
1375
+ # request = Google::Analytics::Data::V1beta::ListAudienceExportsRequest.new
1376
+ #
1377
+ # # Call the list_audience_exports method.
1378
+ # result = client.list_audience_exports request
1379
+ #
1380
+ # # The returned object is of type Gapic::PagedEnumerable. You can iterate
1381
+ # # over elements, and API calls will be issued to fetch pages as needed.
1382
+ # result.each do |item|
1383
+ # # Each element is of type ::Google::Analytics::Data::V1beta::AudienceExport.
1384
+ # p item
1385
+ # end
1386
+ #
1387
+ def list_audience_exports request, options = nil
1388
+ raise ::ArgumentError, "request must be provided" if request.nil?
1389
+
1390
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Analytics::Data::V1beta::ListAudienceExportsRequest
1391
+
1392
+ # Converts hash and nil to an options object
1393
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
1394
+
1395
+ # Customize the options with defaults
1396
+ call_metadata = @config.rpcs.list_audience_exports.metadata.to_h
1397
+
1398
+ # Set x-goog-api-client and x-goog-user-project headers
1399
+ call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
1400
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
1401
+ gapic_version: ::Google::Analytics::Data::V1beta::VERSION,
1402
+ transports_version_send: [:rest]
1403
+
1404
+ call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
1405
+
1406
+ options.apply_defaults timeout: @config.rpcs.list_audience_exports.timeout,
1407
+ metadata: call_metadata,
1408
+ retry_policy: @config.rpcs.list_audience_exports.retry_policy
1409
+
1410
+ options.apply_defaults timeout: @config.timeout,
1411
+ metadata: @config.metadata,
1412
+ retry_policy: @config.retry_policy
1413
+
1414
+ @analytics_data_stub.list_audience_exports request, options do |result, operation|
1415
+ result = ::Gapic::Rest::PagedEnumerable.new @analytics_data_stub, :list_audience_exports, "audience_exports", request, result, options
1416
+ yield result, operation if block_given?
1417
+ return result
1418
+ end
1419
+ rescue ::Gapic::Rest::Error => e
1420
+ raise ::Google::Cloud::Error.from_error(e)
1421
+ end
1422
+
961
1423
  ##
962
1424
  # Configuration class for the AnalyticsData REST API.
963
1425
  #
@@ -988,9 +1450,9 @@ module Google
988
1450
  # end
989
1451
  #
990
1452
  # @!attribute [rw] endpoint
991
- # The hostname or hostname:port of the service endpoint.
992
- # Defaults to `"analyticsdata.googleapis.com"`.
993
- # @return [::String]
1453
+ # A custom service endpoint, as a hostname or hostname:port. The default is
1454
+ # nil, indicating to use the default endpoint in the current universe domain.
1455
+ # @return [::String,nil]
994
1456
  # @!attribute [rw] credentials
995
1457
  # Credentials to send with calls. You may provide any of the following types:
996
1458
  # * (`String`) The path to a service account key file in JSON format
@@ -1027,13 +1489,20 @@ module Google
1027
1489
  # @!attribute [rw] quota_project
1028
1490
  # A separate project against which to charge quota.
1029
1491
  # @return [::String]
1492
+ # @!attribute [rw] universe_domain
1493
+ # The universe domain within which to make requests. This determines the
1494
+ # default endpoint URL. The default value of nil uses the environment
1495
+ # universe (usually the default "googleapis.com" universe).
1496
+ # @return [::String,nil]
1030
1497
  #
1031
1498
  class Configuration
1032
1499
  extend ::Gapic::Config
1033
1500
 
1501
+ # @private
1502
+ # The endpoint specific to the default "googleapis.com" universe. Deprecated.
1034
1503
  DEFAULT_ENDPOINT = "analyticsdata.googleapis.com"
1035
1504
 
1036
- config_attr :endpoint, DEFAULT_ENDPOINT, ::String
1505
+ config_attr :endpoint, nil, ::String, nil
1037
1506
  config_attr :credentials, nil do |value|
1038
1507
  allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Signet::OAuth2::Client, nil]
1039
1508
  allowed.any? { |klass| klass === value }
@@ -1045,6 +1514,7 @@ module Google
1045
1514
  config_attr :metadata, nil, ::Hash, nil
1046
1515
  config_attr :retry_policy, nil, ::Hash, ::Proc, nil
1047
1516
  config_attr :quota_project, nil, ::String, nil
1517
+ config_attr :universe_domain, nil, ::String, nil
1048
1518
 
1049
1519
  # @private
1050
1520
  def initialize parent_config = nil
@@ -1118,6 +1588,26 @@ module Google
1118
1588
  # @return [::Gapic::Config::Method]
1119
1589
  #
1120
1590
  attr_reader :check_compatibility
1591
+ ##
1592
+ # RPC-specific configuration for `create_audience_export`
1593
+ # @return [::Gapic::Config::Method]
1594
+ #
1595
+ attr_reader :create_audience_export
1596
+ ##
1597
+ # RPC-specific configuration for `query_audience_export`
1598
+ # @return [::Gapic::Config::Method]
1599
+ #
1600
+ attr_reader :query_audience_export
1601
+ ##
1602
+ # RPC-specific configuration for `get_audience_export`
1603
+ # @return [::Gapic::Config::Method]
1604
+ #
1605
+ attr_reader :get_audience_export
1606
+ ##
1607
+ # RPC-specific configuration for `list_audience_exports`
1608
+ # @return [::Gapic::Config::Method]
1609
+ #
1610
+ attr_reader :list_audience_exports
1121
1611
 
1122
1612
  # @private
1123
1613
  def initialize parent_rpcs = nil
@@ -1135,6 +1625,14 @@ module Google
1135
1625
  @run_realtime_report = ::Gapic::Config::Method.new run_realtime_report_config
1136
1626
  check_compatibility_config = parent_rpcs.check_compatibility if parent_rpcs.respond_to? :check_compatibility
1137
1627
  @check_compatibility = ::Gapic::Config::Method.new check_compatibility_config
1628
+ create_audience_export_config = parent_rpcs.create_audience_export if parent_rpcs.respond_to? :create_audience_export
1629
+ @create_audience_export = ::Gapic::Config::Method.new create_audience_export_config
1630
+ query_audience_export_config = parent_rpcs.query_audience_export if parent_rpcs.respond_to? :query_audience_export
1631
+ @query_audience_export = ::Gapic::Config::Method.new query_audience_export_config
1632
+ get_audience_export_config = parent_rpcs.get_audience_export if parent_rpcs.respond_to? :get_audience_export
1633
+ @get_audience_export = ::Gapic::Config::Method.new get_audience_export_config
1634
+ list_audience_exports_config = parent_rpcs.list_audience_exports if parent_rpcs.respond_to? :list_audience_exports
1635
+ @list_audience_exports = ::Gapic::Config::Method.new list_audience_exports_config
1138
1636
 
1139
1637
  yield self if block_given?
1140
1638
  end