def _validate()

in aws_xray_sdk/core/sampling/local/sampling_rule.py [0:0]


    def _validate(self):
        if self.fixed_target < 0 or self.rate < 0:
            raise InvalidSamplingManifestError('All rules must have non-negative values for '
                                               'fixed_target and rate')

        if self._default:
            if self.host or self.method or self.path:
                raise InvalidSamplingManifestError('The default rule must not specify values for '
                                                   'url_path, %s, or http_method', self._host_key)
        else:
            if not self.host or not self.method or not self.path:
                raise InvalidSamplingManifestError('All non-default rules must have values for '
                                                   'url_path, %s, and http_method', self._host_key)