@classmethod
def _from_dict(cls, _dict):
    """Initialize a MetricsMonitoring object from a json dictionary."""
    args = {}
    validKeys = ['usage_metrics_enabled', 'metrics_monitoring_crn']
    badKeys = set(_dict.keys()) - set(validKeys)
    if badKeys:
        raise ValueError(
            'Unrecognized keys detected in dictionary for class MetricsMonitoring: '
             + ', '.join(badKeys))
    if 'usage_metrics_enabled' in _dict:
        args['usage_metrics_enabled'] = _dict.get('usage_metrics_enabled')
    if 'metrics_monitoring_crn' in _dict:
        args['metrics_monitoring_crn'] = _dict.get('metrics_monitoring_crn')
    return cls(**args)
