|
21 | 21 | manifest={ |
22 | 22 | "MetricAggregation", |
23 | 23 | "MetricType", |
| 24 | + "RestrictedMetricType", |
24 | 25 | "Compatibility", |
25 | 26 | "DateRange", |
26 | 27 | "MinuteRange", |
@@ -81,6 +82,15 @@ class MetricType(proto.Enum): |
81 | 82 | TYPE_KILOMETERS = 13 |
82 | 83 |
|
83 | 84 |
|
| 85 | +class RestrictedMetricType(proto.Enum): |
| 86 | + r"""Categories of data that you may be restricted from viewing on |
| 87 | + certain GA4 properties. |
| 88 | + """ |
| 89 | + RESTRICTED_METRIC_TYPE_UNSPECIFIED = 0 |
| 90 | + COST_DATA = 1 |
| 91 | + REVENUE_DATA = 2 |
| 92 | + |
| 93 | + |
84 | 94 | class Compatibility(proto.Enum): |
85 | 95 | r"""The compatibility types for a single dimension or metric.""" |
86 | 96 | COMPATIBILITY_UNSPECIFIED = 0 |
@@ -821,9 +831,82 @@ class ResponseMetaData(proto.Message): |
821 | 831 | If true, indicates some buckets of dimension |
822 | 832 | combinations are rolled into "(other)" row. This |
823 | 833 | can happen for high cardinality reports. |
| 834 | + schema_restriction_response (google.analytics.data_v1beta.types.ResponseMetaData.SchemaRestrictionResponse): |
| 835 | + Describes the schema restrictions actively enforced in |
| 836 | + creating this report. To learn more, see `Access and |
| 837 | + data-restriction |
| 838 | + management <https://support.google.com/analytics/answer/10851388>`__. |
| 839 | + This field is a member of `oneof`_ ``_schema_restriction_response``. |
| 840 | + currency_code (str): |
| 841 | + The currency code used in this report. Intended to be used |
| 842 | + in formatting currency metrics like ``purchaseRevenue`` for |
| 843 | + visualization. If currency_code was specified in the |
| 844 | + request, this response parameter will echo the request |
| 845 | + parameter; otherwise, this response parameter is the |
| 846 | + property's current currency_code. |
| 847 | +
|
| 848 | + Currency codes are string encodings of currency types from |
| 849 | + the ISO 4217 standard |
| 850 | + (https://en.wikipedia.org/wiki/ISO_4217); for example "USD", |
| 851 | + "EUR", "JPY". To learn more, see |
| 852 | + https://support.google.com/analytics/answer/9796179. |
| 853 | + This field is a member of `oneof`_ ``_currency_code``. |
| 854 | + time_zone (str): |
| 855 | + The property's current timezone. Intended to be used to |
| 856 | + interpret time-based dimensions like ``hour`` and |
| 857 | + ``minute``. Formatted as strings from the IANA Time Zone |
| 858 | + database (https://www.iana.org/time-zones); for example |
| 859 | + "America/New_York" or "Asia/Tokyo". |
| 860 | + This field is a member of `oneof`_ ``_time_zone``. |
| 861 | + empty_reason (str): |
| 862 | + If empty reason is specified, the report is |
| 863 | + empty for this reason. |
| 864 | + This field is a member of `oneof`_ ``_empty_reason``. |
824 | 865 | """ |
825 | 866 |
|
| 867 | + class SchemaRestrictionResponse(proto.Message): |
| 868 | + r"""The schema restrictions actively enforced in creating this report. |
| 869 | + To learn more, see `Access and data-restriction |
| 870 | + management <https://support.google.com/analytics/answer/10851388>`__. |
| 871 | +
|
| 872 | + Attributes: |
| 873 | + active_metric_restrictions (Sequence[google.analytics.data_v1beta.types.ResponseMetaData.SchemaRestrictionResponse.ActiveMetricRestriction]): |
| 874 | + All restrictions actively enforced in creating the report. |
| 875 | + For example, ``purchaseRevenue`` always has the restriction |
| 876 | + type ``REVENUE_DATA``. However, this active response |
| 877 | + restriction is only populated if the user's custom role |
| 878 | + disallows access to ``REVENUE_DATA``. |
| 879 | + """ |
| 880 | + |
| 881 | + class ActiveMetricRestriction(proto.Message): |
| 882 | + r"""A metric actively restricted in creating the report. |
| 883 | +
|
| 884 | + Attributes: |
| 885 | + metric_name (str): |
| 886 | + The name of the restricted metric. |
| 887 | + This field is a member of `oneof`_ ``_metric_name``. |
| 888 | + restricted_metric_types (Sequence[google.analytics.data_v1beta.types.RestrictedMetricType]): |
| 889 | + The reason for this metric's restriction. |
| 890 | + """ |
| 891 | + |
| 892 | + metric_name = proto.Field(proto.STRING, number=1, optional=True,) |
| 893 | + restricted_metric_types = proto.RepeatedField( |
| 894 | + proto.ENUM, number=2, enum="RestrictedMetricType", |
| 895 | + ) |
| 896 | + |
| 897 | + active_metric_restrictions = proto.RepeatedField( |
| 898 | + proto.MESSAGE, |
| 899 | + number=1, |
| 900 | + message="ResponseMetaData.SchemaRestrictionResponse.ActiveMetricRestriction", |
| 901 | + ) |
| 902 | + |
826 | 903 | data_loss_from_other_row = proto.Field(proto.BOOL, number=3,) |
| 904 | + schema_restriction_response = proto.Field( |
| 905 | + proto.MESSAGE, number=4, optional=True, message=SchemaRestrictionResponse, |
| 906 | + ) |
| 907 | + currency_code = proto.Field(proto.STRING, number=5, optional=True,) |
| 908 | + time_zone = proto.Field(proto.STRING, number=6, optional=True,) |
| 909 | + empty_reason = proto.Field(proto.STRING, number=7, optional=True,) |
827 | 910 |
|
828 | 911 |
|
829 | 912 | class DimensionHeader(proto.Message): |
@@ -1124,19 +1207,36 @@ class MetricMetadata(proto.Message): |
1124 | 1207 | custom_definition (bool): |
1125 | 1208 | True if the metric is a custom metric for |
1126 | 1209 | this property. |
| 1210 | + blocked_reasons (Sequence[google.analytics.data_v1beta.types.MetricMetadata.BlockedReason]): |
| 1211 | + If reasons are specified, your access is blocked to this |
| 1212 | + metric for this property. API requests from you to this |
| 1213 | + property for this metric will succeed; however, the report |
| 1214 | + will contain only zeros for this metric. API requests with |
| 1215 | + metric filters on blocked metrics will fail. If reasons are |
| 1216 | + empty, you have access to this metric. |
| 1217 | +
|
| 1218 | + To learn more, see `Access and data-restriction |
| 1219 | + management <https://support.google.com/analytics/answer/10851388>`__. |
1127 | 1220 | category (str): |
1128 | 1221 | The display name of the category that this |
1129 | 1222 | metrics belongs to. Similar dimensions and |
1130 | 1223 | metrics are categorized together. |
1131 | 1224 | """ |
1132 | 1225 |
|
| 1226 | + class BlockedReason(proto.Enum): |
| 1227 | + r"""Justifications for why this metric is blocked.""" |
| 1228 | + BLOCKED_REASON_UNSPECIFIED = 0 |
| 1229 | + NO_REVENUE_METRICS = 1 |
| 1230 | + NO_COST_METRICS = 2 |
| 1231 | + |
1133 | 1232 | api_name = proto.Field(proto.STRING, number=1,) |
1134 | 1233 | ui_name = proto.Field(proto.STRING, number=2,) |
1135 | 1234 | description = proto.Field(proto.STRING, number=3,) |
1136 | 1235 | deprecated_api_names = proto.RepeatedField(proto.STRING, number=4,) |
1137 | 1236 | type_ = proto.Field(proto.ENUM, number=5, enum="MetricType",) |
1138 | 1237 | expression = proto.Field(proto.STRING, number=6,) |
1139 | 1238 | custom_definition = proto.Field(proto.BOOL, number=7,) |
| 1239 | + blocked_reasons = proto.RepeatedField(proto.ENUM, number=8, enum=BlockedReason,) |
1140 | 1240 | category = proto.Field(proto.STRING, number=10,) |
1141 | 1241 |
|
1142 | 1242 |
|
|
0 commit comments