google-analytics-admin-v1alpha 0.27.1 → 0.28.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.
@@ -3061,10 +3061,12 @@ module Google
3061
3061
  #
3062
3062
  # @param account [::String]
3063
3063
  # Required. The account resource for which to return change history
3064
- # resources.
3064
+ # resources. Format: accounts/\\{account} Example: "accounts/100"
3065
3065
  # @param property [::String]
3066
3066
  # Optional. Resource name for a child property. If set, only return changes
3067
3067
  # made to this property or its child resources.
3068
+ # Format: properties/\\{propertyId}
3069
+ # Example: "properties/100"
3068
3070
  # @param resource_type [::Array<::Google::Analytics::Admin::V1alpha::ChangeHistoryResourceType>]
3069
3071
  # Optional. If set, only return changes if they are for a resource that
3070
3072
  # matches at least one of these types.
@@ -11156,6 +11158,466 @@ module Google
11156
11158
  raise ::Google::Cloud::Error.from_error(e)
11157
11159
  end
11158
11160
 
11161
+ ##
11162
+ # Lookup for a single CalculatedMetric.
11163
+ #
11164
+ # @overload get_calculated_metric(request, options = nil)
11165
+ # Pass arguments to `get_calculated_metric` via a request object, either of type
11166
+ # {::Google::Analytics::Admin::V1alpha::GetCalculatedMetricRequest} or an equivalent Hash.
11167
+ #
11168
+ # @param request [::Google::Analytics::Admin::V1alpha::GetCalculatedMetricRequest, ::Hash]
11169
+ # A request object representing the call parameters. Required. To specify no
11170
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
11171
+ # @param options [::Gapic::CallOptions, ::Hash]
11172
+ # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
11173
+ #
11174
+ # @overload get_calculated_metric(name: nil)
11175
+ # Pass arguments to `get_calculated_metric` via keyword arguments. Note that at
11176
+ # least one keyword argument is required. To specify no parameters, or to keep all
11177
+ # the default parameter values, pass an empty Hash as a request object (see above).
11178
+ #
11179
+ # @param name [::String]
11180
+ # Required. The name of the CalculatedMetric to get.
11181
+ # Format: properties/\\{property_id}/calculatedMetrics/\\{calculated_metric_id}
11182
+ # Example: properties/1234/calculatedMetrics/Metric01
11183
+ #
11184
+ # @yield [response, operation] Access the result along with the RPC operation
11185
+ # @yieldparam response [::Google::Analytics::Admin::V1alpha::CalculatedMetric]
11186
+ # @yieldparam operation [::GRPC::ActiveCall::Operation]
11187
+ #
11188
+ # @return [::Google::Analytics::Admin::V1alpha::CalculatedMetric]
11189
+ #
11190
+ # @raise [::Google::Cloud::Error] if the RPC is aborted.
11191
+ #
11192
+ # @example Basic example
11193
+ # require "google/analytics/admin/v1alpha"
11194
+ #
11195
+ # # Create a client object. The client can be reused for multiple calls.
11196
+ # client = Google::Analytics::Admin::V1alpha::AnalyticsAdminService::Client.new
11197
+ #
11198
+ # # Create a request. To set request fields, pass in keyword arguments.
11199
+ # request = Google::Analytics::Admin::V1alpha::GetCalculatedMetricRequest.new
11200
+ #
11201
+ # # Call the get_calculated_metric method.
11202
+ # result = client.get_calculated_metric request
11203
+ #
11204
+ # # The returned object is of type Google::Analytics::Admin::V1alpha::CalculatedMetric.
11205
+ # p result
11206
+ #
11207
+ def get_calculated_metric request, options = nil
11208
+ raise ::ArgumentError, "request must be provided" if request.nil?
11209
+
11210
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Analytics::Admin::V1alpha::GetCalculatedMetricRequest
11211
+
11212
+ # Converts hash and nil to an options object
11213
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
11214
+
11215
+ # Customize the options with defaults
11216
+ metadata = @config.rpcs.get_calculated_metric.metadata.to_h
11217
+
11218
+ # Set x-goog-api-client and x-goog-user-project headers
11219
+ metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
11220
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
11221
+ gapic_version: ::Google::Analytics::Admin::V1alpha::VERSION
11222
+ metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
11223
+
11224
+ header_params = {}
11225
+ if request.name
11226
+ header_params["name"] = request.name
11227
+ end
11228
+
11229
+ request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
11230
+ metadata[:"x-goog-request-params"] ||= request_params_header
11231
+
11232
+ options.apply_defaults timeout: @config.rpcs.get_calculated_metric.timeout,
11233
+ metadata: metadata,
11234
+ retry_policy: @config.rpcs.get_calculated_metric.retry_policy
11235
+
11236
+ options.apply_defaults timeout: @config.timeout,
11237
+ metadata: @config.metadata,
11238
+ retry_policy: @config.retry_policy
11239
+
11240
+ @analytics_admin_service_stub.call_rpc :get_calculated_metric, request, options: options do |response, operation|
11241
+ yield response, operation if block_given?
11242
+ return response
11243
+ end
11244
+ rescue ::GRPC::BadStatus => e
11245
+ raise ::Google::Cloud::Error.from_error(e)
11246
+ end
11247
+
11248
+ ##
11249
+ # Creates a CalculatedMetric.
11250
+ #
11251
+ # @overload create_calculated_metric(request, options = nil)
11252
+ # Pass arguments to `create_calculated_metric` via a request object, either of type
11253
+ # {::Google::Analytics::Admin::V1alpha::CreateCalculatedMetricRequest} or an equivalent Hash.
11254
+ #
11255
+ # @param request [::Google::Analytics::Admin::V1alpha::CreateCalculatedMetricRequest, ::Hash]
11256
+ # A request object representing the call parameters. Required. To specify no
11257
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
11258
+ # @param options [::Gapic::CallOptions, ::Hash]
11259
+ # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
11260
+ #
11261
+ # @overload create_calculated_metric(parent: nil, calculated_metric_id: nil, calculated_metric: nil)
11262
+ # Pass arguments to `create_calculated_metric` via keyword arguments. Note that at
11263
+ # least one keyword argument is required. To specify no parameters, or to keep all
11264
+ # the default parameter values, pass an empty Hash as a request object (see above).
11265
+ #
11266
+ # @param parent [::String]
11267
+ # Required. Format: properties/\\{property_id}
11268
+ # Example: properties/1234
11269
+ # @param calculated_metric_id [::String]
11270
+ # Required. The ID to use for the calculated metric which will become the
11271
+ # final component of the calculated metric's resource name.
11272
+ #
11273
+ # This value should be 1-80 characters and valid characters are
11274
+ # /[a-zA-Z0-9_]/, no spaces allowed. calculated_metric_id must be unique
11275
+ # between all calculated metrics under a property. The calculated_metric_id
11276
+ # is used when referencing this calculated metric from external APIs, for
11277
+ # example, "calcMetric:\\{calculated_metric_id}".
11278
+ # @param calculated_metric [::Google::Analytics::Admin::V1alpha::CalculatedMetric, ::Hash]
11279
+ # Required. The CalculatedMetric to create.
11280
+ #
11281
+ # @yield [response, operation] Access the result along with the RPC operation
11282
+ # @yieldparam response [::Google::Analytics::Admin::V1alpha::CalculatedMetric]
11283
+ # @yieldparam operation [::GRPC::ActiveCall::Operation]
11284
+ #
11285
+ # @return [::Google::Analytics::Admin::V1alpha::CalculatedMetric]
11286
+ #
11287
+ # @raise [::Google::Cloud::Error] if the RPC is aborted.
11288
+ #
11289
+ # @example Basic example
11290
+ # require "google/analytics/admin/v1alpha"
11291
+ #
11292
+ # # Create a client object. The client can be reused for multiple calls.
11293
+ # client = Google::Analytics::Admin::V1alpha::AnalyticsAdminService::Client.new
11294
+ #
11295
+ # # Create a request. To set request fields, pass in keyword arguments.
11296
+ # request = Google::Analytics::Admin::V1alpha::CreateCalculatedMetricRequest.new
11297
+ #
11298
+ # # Call the create_calculated_metric method.
11299
+ # result = client.create_calculated_metric request
11300
+ #
11301
+ # # The returned object is of type Google::Analytics::Admin::V1alpha::CalculatedMetric.
11302
+ # p result
11303
+ #
11304
+ def create_calculated_metric request, options = nil
11305
+ raise ::ArgumentError, "request must be provided" if request.nil?
11306
+
11307
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Analytics::Admin::V1alpha::CreateCalculatedMetricRequest
11308
+
11309
+ # Converts hash and nil to an options object
11310
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
11311
+
11312
+ # Customize the options with defaults
11313
+ metadata = @config.rpcs.create_calculated_metric.metadata.to_h
11314
+
11315
+ # Set x-goog-api-client and x-goog-user-project headers
11316
+ metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
11317
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
11318
+ gapic_version: ::Google::Analytics::Admin::V1alpha::VERSION
11319
+ metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
11320
+
11321
+ header_params = {}
11322
+ if request.parent
11323
+ header_params["parent"] = request.parent
11324
+ end
11325
+
11326
+ request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
11327
+ metadata[:"x-goog-request-params"] ||= request_params_header
11328
+
11329
+ options.apply_defaults timeout: @config.rpcs.create_calculated_metric.timeout,
11330
+ metadata: metadata,
11331
+ retry_policy: @config.rpcs.create_calculated_metric.retry_policy
11332
+
11333
+ options.apply_defaults timeout: @config.timeout,
11334
+ metadata: @config.metadata,
11335
+ retry_policy: @config.retry_policy
11336
+
11337
+ @analytics_admin_service_stub.call_rpc :create_calculated_metric, request, options: options do |response, operation|
11338
+ yield response, operation if block_given?
11339
+ return response
11340
+ end
11341
+ rescue ::GRPC::BadStatus => e
11342
+ raise ::Google::Cloud::Error.from_error(e)
11343
+ end
11344
+
11345
+ ##
11346
+ # Lists CalculatedMetrics on a property.
11347
+ #
11348
+ # @overload list_calculated_metrics(request, options = nil)
11349
+ # Pass arguments to `list_calculated_metrics` via a request object, either of type
11350
+ # {::Google::Analytics::Admin::V1alpha::ListCalculatedMetricsRequest} or an equivalent Hash.
11351
+ #
11352
+ # @param request [::Google::Analytics::Admin::V1alpha::ListCalculatedMetricsRequest, ::Hash]
11353
+ # A request object representing the call parameters. Required. To specify no
11354
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
11355
+ # @param options [::Gapic::CallOptions, ::Hash]
11356
+ # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
11357
+ #
11358
+ # @overload list_calculated_metrics(parent: nil, page_size: nil, page_token: nil)
11359
+ # Pass arguments to `list_calculated_metrics` via keyword arguments. Note that at
11360
+ # least one keyword argument is required. To specify no parameters, or to keep all
11361
+ # the default parameter values, pass an empty Hash as a request object (see above).
11362
+ #
11363
+ # @param parent [::String]
11364
+ # Required. Example format: properties/1234
11365
+ # @param page_size [::Integer]
11366
+ # Optional. The maximum number of resources to return.
11367
+ # If unspecified, at most 50 resources will be returned.
11368
+ # The maximum value is 200 (higher values will be coerced to the maximum).
11369
+ # @param page_token [::String]
11370
+ # Optional. A page token, received from a previous `ListCalculatedMetrics`
11371
+ # call. Provide this to retrieve the subsequent page.
11372
+ #
11373
+ # When paginating, all other parameters provided to `ListCalculatedMetrics`
11374
+ # must match the call that provided the page token.
11375
+ #
11376
+ # @yield [response, operation] Access the result along with the RPC operation
11377
+ # @yieldparam response [::Gapic::PagedEnumerable<::Google::Analytics::Admin::V1alpha::CalculatedMetric>]
11378
+ # @yieldparam operation [::GRPC::ActiveCall::Operation]
11379
+ #
11380
+ # @return [::Gapic::PagedEnumerable<::Google::Analytics::Admin::V1alpha::CalculatedMetric>]
11381
+ #
11382
+ # @raise [::Google::Cloud::Error] if the RPC is aborted.
11383
+ #
11384
+ # @example Basic example
11385
+ # require "google/analytics/admin/v1alpha"
11386
+ #
11387
+ # # Create a client object. The client can be reused for multiple calls.
11388
+ # client = Google::Analytics::Admin::V1alpha::AnalyticsAdminService::Client.new
11389
+ #
11390
+ # # Create a request. To set request fields, pass in keyword arguments.
11391
+ # request = Google::Analytics::Admin::V1alpha::ListCalculatedMetricsRequest.new
11392
+ #
11393
+ # # Call the list_calculated_metrics method.
11394
+ # result = client.list_calculated_metrics request
11395
+ #
11396
+ # # The returned object is of type Gapic::PagedEnumerable. You can iterate
11397
+ # # over elements, and API calls will be issued to fetch pages as needed.
11398
+ # result.each do |item|
11399
+ # # Each element is of type ::Google::Analytics::Admin::V1alpha::CalculatedMetric.
11400
+ # p item
11401
+ # end
11402
+ #
11403
+ def list_calculated_metrics request, options = nil
11404
+ raise ::ArgumentError, "request must be provided" if request.nil?
11405
+
11406
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Analytics::Admin::V1alpha::ListCalculatedMetricsRequest
11407
+
11408
+ # Converts hash and nil to an options object
11409
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
11410
+
11411
+ # Customize the options with defaults
11412
+ metadata = @config.rpcs.list_calculated_metrics.metadata.to_h
11413
+
11414
+ # Set x-goog-api-client and x-goog-user-project headers
11415
+ metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
11416
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
11417
+ gapic_version: ::Google::Analytics::Admin::V1alpha::VERSION
11418
+ metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
11419
+
11420
+ header_params = {}
11421
+ if request.parent
11422
+ header_params["parent"] = request.parent
11423
+ end
11424
+
11425
+ request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
11426
+ metadata[:"x-goog-request-params"] ||= request_params_header
11427
+
11428
+ options.apply_defaults timeout: @config.rpcs.list_calculated_metrics.timeout,
11429
+ metadata: metadata,
11430
+ retry_policy: @config.rpcs.list_calculated_metrics.retry_policy
11431
+
11432
+ options.apply_defaults timeout: @config.timeout,
11433
+ metadata: @config.metadata,
11434
+ retry_policy: @config.retry_policy
11435
+
11436
+ @analytics_admin_service_stub.call_rpc :list_calculated_metrics, request, options: options do |response, operation|
11437
+ response = ::Gapic::PagedEnumerable.new @analytics_admin_service_stub, :list_calculated_metrics, request, response, operation, options
11438
+ yield response, operation if block_given?
11439
+ return response
11440
+ end
11441
+ rescue ::GRPC::BadStatus => e
11442
+ raise ::Google::Cloud::Error.from_error(e)
11443
+ end
11444
+
11445
+ ##
11446
+ # Updates a CalculatedMetric on a property.
11447
+ #
11448
+ # @overload update_calculated_metric(request, options = nil)
11449
+ # Pass arguments to `update_calculated_metric` via a request object, either of type
11450
+ # {::Google::Analytics::Admin::V1alpha::UpdateCalculatedMetricRequest} or an equivalent Hash.
11451
+ #
11452
+ # @param request [::Google::Analytics::Admin::V1alpha::UpdateCalculatedMetricRequest, ::Hash]
11453
+ # A request object representing the call parameters. Required. To specify no
11454
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
11455
+ # @param options [::Gapic::CallOptions, ::Hash]
11456
+ # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
11457
+ #
11458
+ # @overload update_calculated_metric(calculated_metric: nil, update_mask: nil)
11459
+ # Pass arguments to `update_calculated_metric` via keyword arguments. Note that at
11460
+ # least one keyword argument is required. To specify no parameters, or to keep all
11461
+ # the default parameter values, pass an empty Hash as a request object (see above).
11462
+ #
11463
+ # @param calculated_metric [::Google::Analytics::Admin::V1alpha::CalculatedMetric, ::Hash]
11464
+ # Required. The CalculatedMetric to update
11465
+ # @param update_mask [::Google::Protobuf::FieldMask, ::Hash]
11466
+ # Required. The list of fields to be updated. Omitted fields will not be
11467
+ # updated. To replace the entire entity, use one path with the string "*" to
11468
+ # match all fields.
11469
+ #
11470
+ # @yield [response, operation] Access the result along with the RPC operation
11471
+ # @yieldparam response [::Google::Analytics::Admin::V1alpha::CalculatedMetric]
11472
+ # @yieldparam operation [::GRPC::ActiveCall::Operation]
11473
+ #
11474
+ # @return [::Google::Analytics::Admin::V1alpha::CalculatedMetric]
11475
+ #
11476
+ # @raise [::Google::Cloud::Error] if the RPC is aborted.
11477
+ #
11478
+ # @example Basic example
11479
+ # require "google/analytics/admin/v1alpha"
11480
+ #
11481
+ # # Create a client object. The client can be reused for multiple calls.
11482
+ # client = Google::Analytics::Admin::V1alpha::AnalyticsAdminService::Client.new
11483
+ #
11484
+ # # Create a request. To set request fields, pass in keyword arguments.
11485
+ # request = Google::Analytics::Admin::V1alpha::UpdateCalculatedMetricRequest.new
11486
+ #
11487
+ # # Call the update_calculated_metric method.
11488
+ # result = client.update_calculated_metric request
11489
+ #
11490
+ # # The returned object is of type Google::Analytics::Admin::V1alpha::CalculatedMetric.
11491
+ # p result
11492
+ #
11493
+ def update_calculated_metric request, options = nil
11494
+ raise ::ArgumentError, "request must be provided" if request.nil?
11495
+
11496
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Analytics::Admin::V1alpha::UpdateCalculatedMetricRequest
11497
+
11498
+ # Converts hash and nil to an options object
11499
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
11500
+
11501
+ # Customize the options with defaults
11502
+ metadata = @config.rpcs.update_calculated_metric.metadata.to_h
11503
+
11504
+ # Set x-goog-api-client and x-goog-user-project headers
11505
+ metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
11506
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
11507
+ gapic_version: ::Google::Analytics::Admin::V1alpha::VERSION
11508
+ metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
11509
+
11510
+ header_params = {}
11511
+ if request.calculated_metric&.name
11512
+ header_params["calculated_metric.name"] = request.calculated_metric.name
11513
+ end
11514
+
11515
+ request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
11516
+ metadata[:"x-goog-request-params"] ||= request_params_header
11517
+
11518
+ options.apply_defaults timeout: @config.rpcs.update_calculated_metric.timeout,
11519
+ metadata: metadata,
11520
+ retry_policy: @config.rpcs.update_calculated_metric.retry_policy
11521
+
11522
+ options.apply_defaults timeout: @config.timeout,
11523
+ metadata: @config.metadata,
11524
+ retry_policy: @config.retry_policy
11525
+
11526
+ @analytics_admin_service_stub.call_rpc :update_calculated_metric, request, options: options do |response, operation|
11527
+ yield response, operation if block_given?
11528
+ return response
11529
+ end
11530
+ rescue ::GRPC::BadStatus => e
11531
+ raise ::Google::Cloud::Error.from_error(e)
11532
+ end
11533
+
11534
+ ##
11535
+ # Deletes a CalculatedMetric on a property.
11536
+ #
11537
+ # @overload delete_calculated_metric(request, options = nil)
11538
+ # Pass arguments to `delete_calculated_metric` via a request object, either of type
11539
+ # {::Google::Analytics::Admin::V1alpha::DeleteCalculatedMetricRequest} or an equivalent Hash.
11540
+ #
11541
+ # @param request [::Google::Analytics::Admin::V1alpha::DeleteCalculatedMetricRequest, ::Hash]
11542
+ # A request object representing the call parameters. Required. To specify no
11543
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
11544
+ # @param options [::Gapic::CallOptions, ::Hash]
11545
+ # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
11546
+ #
11547
+ # @overload delete_calculated_metric(name: nil)
11548
+ # Pass arguments to `delete_calculated_metric` via keyword arguments. Note that at
11549
+ # least one keyword argument is required. To specify no parameters, or to keep all
11550
+ # the default parameter values, pass an empty Hash as a request object (see above).
11551
+ #
11552
+ # @param name [::String]
11553
+ # Required. The name of the CalculatedMetric to delete.
11554
+ # Format: properties/\\{property_id}/calculatedMetrics/\\{calculated_metric_id}
11555
+ # Example: properties/1234/calculatedMetrics/Metric01
11556
+ #
11557
+ # @yield [response, operation] Access the result along with the RPC operation
11558
+ # @yieldparam response [::Google::Protobuf::Empty]
11559
+ # @yieldparam operation [::GRPC::ActiveCall::Operation]
11560
+ #
11561
+ # @return [::Google::Protobuf::Empty]
11562
+ #
11563
+ # @raise [::Google::Cloud::Error] if the RPC is aborted.
11564
+ #
11565
+ # @example Basic example
11566
+ # require "google/analytics/admin/v1alpha"
11567
+ #
11568
+ # # Create a client object. The client can be reused for multiple calls.
11569
+ # client = Google::Analytics::Admin::V1alpha::AnalyticsAdminService::Client.new
11570
+ #
11571
+ # # Create a request. To set request fields, pass in keyword arguments.
11572
+ # request = Google::Analytics::Admin::V1alpha::DeleteCalculatedMetricRequest.new
11573
+ #
11574
+ # # Call the delete_calculated_metric method.
11575
+ # result = client.delete_calculated_metric request
11576
+ #
11577
+ # # The returned object is of type Google::Protobuf::Empty.
11578
+ # p result
11579
+ #
11580
+ def delete_calculated_metric request, options = nil
11581
+ raise ::ArgumentError, "request must be provided" if request.nil?
11582
+
11583
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Analytics::Admin::V1alpha::DeleteCalculatedMetricRequest
11584
+
11585
+ # Converts hash and nil to an options object
11586
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
11587
+
11588
+ # Customize the options with defaults
11589
+ metadata = @config.rpcs.delete_calculated_metric.metadata.to_h
11590
+
11591
+ # Set x-goog-api-client and x-goog-user-project headers
11592
+ metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
11593
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
11594
+ gapic_version: ::Google::Analytics::Admin::V1alpha::VERSION
11595
+ metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
11596
+
11597
+ header_params = {}
11598
+ if request.name
11599
+ header_params["name"] = request.name
11600
+ end
11601
+
11602
+ request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
11603
+ metadata[:"x-goog-request-params"] ||= request_params_header
11604
+
11605
+ options.apply_defaults timeout: @config.rpcs.delete_calculated_metric.timeout,
11606
+ metadata: metadata,
11607
+ retry_policy: @config.rpcs.delete_calculated_metric.retry_policy
11608
+
11609
+ options.apply_defaults timeout: @config.timeout,
11610
+ metadata: @config.metadata,
11611
+ retry_policy: @config.retry_policy
11612
+
11613
+ @analytics_admin_service_stub.call_rpc :delete_calculated_metric, request, options: options do |response, operation|
11614
+ yield response, operation if block_given?
11615
+ return response
11616
+ end
11617
+ rescue ::GRPC::BadStatus => e
11618
+ raise ::Google::Cloud::Error.from_error(e)
11619
+ end
11620
+
11159
11621
  ##
11160
11622
  # Create a roll-up property and all roll-up property source links.
11161
11623
  #
@@ -12904,6 +13366,31 @@ module Google
12904
13366
  #
12905
13367
  attr_reader :get_data_redaction_settings
12906
13368
  ##
13369
+ # RPC-specific configuration for `get_calculated_metric`
13370
+ # @return [::Gapic::Config::Method]
13371
+ #
13372
+ attr_reader :get_calculated_metric
13373
+ ##
13374
+ # RPC-specific configuration for `create_calculated_metric`
13375
+ # @return [::Gapic::Config::Method]
13376
+ #
13377
+ attr_reader :create_calculated_metric
13378
+ ##
13379
+ # RPC-specific configuration for `list_calculated_metrics`
13380
+ # @return [::Gapic::Config::Method]
13381
+ #
13382
+ attr_reader :list_calculated_metrics
13383
+ ##
13384
+ # RPC-specific configuration for `update_calculated_metric`
13385
+ # @return [::Gapic::Config::Method]
13386
+ #
13387
+ attr_reader :update_calculated_metric
13388
+ ##
13389
+ # RPC-specific configuration for `delete_calculated_metric`
13390
+ # @return [::Gapic::Config::Method]
13391
+ #
13392
+ attr_reader :delete_calculated_metric
13393
+ ##
12907
13394
  # RPC-specific configuration for `create_rollup_property`
12908
13395
  # @return [::Gapic::Config::Method]
12909
13396
  #
@@ -13201,6 +13688,16 @@ module Google
13201
13688
  @update_data_redaction_settings = ::Gapic::Config::Method.new update_data_redaction_settings_config
13202
13689
  get_data_redaction_settings_config = parent_rpcs.get_data_redaction_settings if parent_rpcs.respond_to? :get_data_redaction_settings
13203
13690
  @get_data_redaction_settings = ::Gapic::Config::Method.new get_data_redaction_settings_config
13691
+ get_calculated_metric_config = parent_rpcs.get_calculated_metric if parent_rpcs.respond_to? :get_calculated_metric
13692
+ @get_calculated_metric = ::Gapic::Config::Method.new get_calculated_metric_config
13693
+ create_calculated_metric_config = parent_rpcs.create_calculated_metric if parent_rpcs.respond_to? :create_calculated_metric
13694
+ @create_calculated_metric = ::Gapic::Config::Method.new create_calculated_metric_config
13695
+ list_calculated_metrics_config = parent_rpcs.list_calculated_metrics if parent_rpcs.respond_to? :list_calculated_metrics
13696
+ @list_calculated_metrics = ::Gapic::Config::Method.new list_calculated_metrics_config
13697
+ update_calculated_metric_config = parent_rpcs.update_calculated_metric if parent_rpcs.respond_to? :update_calculated_metric
13698
+ @update_calculated_metric = ::Gapic::Config::Method.new update_calculated_metric_config
13699
+ delete_calculated_metric_config = parent_rpcs.delete_calculated_metric if parent_rpcs.respond_to? :delete_calculated_metric
13700
+ @delete_calculated_metric = ::Gapic::Config::Method.new delete_calculated_metric_config
13204
13701
  create_rollup_property_config = parent_rpcs.create_rollup_property if parent_rpcs.respond_to? :create_rollup_property
13205
13702
  @create_rollup_property = ::Gapic::Config::Method.new create_rollup_property_config
13206
13703
  get_rollup_property_source_link_config = parent_rpcs.get_rollup_property_source_link if parent_rpcs.respond_to? :get_rollup_property_source_link
@@ -142,6 +142,23 @@ module Google
142
142
  "properties/#{property}/bigQueryLinks/#{bigquery_link}"
143
143
  end
144
144
 
145
+ ##
146
+ # Create a fully-qualified CalculatedMetric resource string.
147
+ #
148
+ # The resource will be in the following format:
149
+ #
150
+ # `properties/{property}/calculatedMetrics/{calculated_metric}`
151
+ #
152
+ # @param property [String]
153
+ # @param calculated_metric [String]
154
+ #
155
+ # @return [::String]
156
+ def calculated_metric_path property:, calculated_metric:
157
+ raise ::ArgumentError, "property cannot contain /" if property.to_s.include? "/"
158
+
159
+ "properties/#{property}/calculatedMetrics/#{calculated_metric}"
160
+ end
161
+
145
162
  ##
146
163
  # Create a fully-qualified ChannelGroup resource string.
147
164
  #