update_metric
¶
update_metric(
app_id: AppId,
metric_id: MetricId,
*,
config_overrides: Optional[AppMonetizationClientConfig] = None,
name: Optional[MetricDisplayName] = None,
description: Optional[MetricDescription] = None,
event_type: Optional[SourceEventType] = None,
unit_name: Optional[UnitName] = None,
definition: Optional[MetricDefinition] = None,
) -> UpdateMetricResponse
Updates an existing metric. Only a draft metric, one that has never been published, can be modified. After a metric is published, every field is frozen and any update is rejected with a ConflictException. To change a published metric, archive it and create a new metric.
Parameters:
-
app_id(AppId) –The ID of the app.
-
metric_id(MetricId) –The ID of the metric to update.
-
name(Optional[MetricDisplayName], default:None) –A human-readable display name for the metric.
-
description(Optional[MetricDescription], default:None) –A description of what the metric measures.
-
event_type(Optional[SourceEventType], default:None) –The event type this metric aggregates.
-
unit_name(Optional[UnitName], default:None) –The unit of measure for the metric (for example, "requests"), in lowercase snake_case.
-
definition(Optional[MetricDefinition], default:None) –The aggregation definition: filters, aggregation function, grouping, and period.
Raises:
-
AccessDeniedException–The caller does not have sufficient permission to perform this action.
-
ConflictException–The request conflicts with the current state of the resource, such as a duplicate identifier or a version mismatch. Retrieve the current state of the resource and retry the request.
-
InternalServerException–An unexpected error occurred while processing the request.
-
InvalidConfigurationException–The requested configuration is not valid.
-
ResourceNotFoundException–The referenced resource does not exist.
-
RevisionConflictException–The request's revision does not match the resource's current revision. Retry with the current revision.
-
ServiceQuotaExceededException–The request would cause a service quota to be exceeded.
-
ThrottlingException–The request was denied due to request throttling.
-
ValidationException–The request failed input validation.
-
UnknownServiceError–The service returned an error code this client does not model.
Source code in docs_src/capo_appmonetization/_services/app_monetization.py
3714 3715 3716 3717 3718 3719 3720 3721 3722 3723 3724 3725 3726 3727 3728 3729 3730 3731 3732 3733 3734 3735 3736 3737 3738 3739 3740 3741 3742 3743 3744 3745 3746 3747 3748 3749 3750 3751 3752 3753 3754 3755 3756 3757 3758 3759 3760 3761 3762 3763 3764 3765 3766 3767 3768 3769 3770 3771 3772 3773 3774 3775 3776 3777 3778 3779 3780 3781 3782 3783 3784 3785 3786 3787 3788 3789 3790 3791 3792 3793 3794 3795 3796 | |