@@ -705,6 +705,71 @@ def run_realtime_report(
705
705
# Done; return the response.
706
706
return response
707
707
708
+ def check_compatibility (
709
+ self ,
710
+ request : analytics_data_api .CheckCompatibilityRequest = None ,
711
+ * ,
712
+ retry : retries .Retry = gapic_v1 .method .DEFAULT ,
713
+ timeout : float = None ,
714
+ metadata : Sequence [Tuple [str , str ]] = (),
715
+ ) -> analytics_data_api .CheckCompatibilityResponse :
716
+ r"""This compatibility method lists dimensions and
717
+ metrics that can be added to a report request and
718
+ maintain compatibility. This method fails if the
719
+ request's dimensions and metrics are incompatible.
720
+ In Google Analytics, reports fail if they request
721
+ incompatible dimensions and/or metrics; in that case,
722
+ you will need to remove dimensions and/or metrics from
723
+ the incompatible report until the report is compatible.
724
+ The Realtime and Core reports have different
725
+ compatibility rules. This method checks compatibility
726
+ for Core reports.
727
+
728
+ Args:
729
+ request (google.analytics.data_v1beta.types.CheckCompatibilityRequest):
730
+ The request object. The request for compatibility
731
+ information for a report's dimensions and metrics. Check
732
+ compatibility provides a preview of the compatibility of
733
+ a report; fields shared with the `runReport` request
734
+ should be the same values as in your `runReport`
735
+ request.
736
+ retry (google.api_core.retry.Retry): Designation of what errors, if any,
737
+ should be retried.
738
+ timeout (float): The timeout for this request.
739
+ metadata (Sequence[Tuple[str, str]]): Strings which should be
740
+ sent along with the request as metadata.
741
+
742
+ Returns:
743
+ google.analytics.data_v1beta.types.CheckCompatibilityResponse:
744
+ The compatibility response with the
745
+ compatibility of each dimension &
746
+ metric.
747
+
748
+ """
749
+ # Create or coerce a protobuf request object.
750
+ # Minor optimization to avoid making a copy if the user passes
751
+ # in a analytics_data_api.CheckCompatibilityRequest.
752
+ # There's no risk of modifying the input as we've already verified
753
+ # there are no flattened fields.
754
+ if not isinstance (request , analytics_data_api .CheckCompatibilityRequest ):
755
+ request = analytics_data_api .CheckCompatibilityRequest (request )
756
+
757
+ # Wrap the RPC method; this adds retry and timeout information,
758
+ # and friendly error handling.
759
+ rpc = self ._transport ._wrapped_methods [self ._transport .check_compatibility ]
760
+
761
+ # Certain fields should be provided within the metadata header;
762
+ # add these here.
763
+ metadata = tuple (metadata ) + (
764
+ gapic_v1 .routing_header .to_grpc_metadata ((("property" , request .property ),)),
765
+ )
766
+
767
+ # Send the request.
768
+ response = rpc (request , retry = retry , timeout = timeout , metadata = metadata ,)
769
+
770
+ # Done; return the response.
771
+ return response
772
+
708
773
709
774
try :
710
775
DEFAULT_CLIENT_INFO = gapic_v1 .client_info .ClientInfo (
0 commit comments