constructor(input) {
    // See https://opentelemetry.io/docs/specs/otel/trace/api/#spankind for
    // information about how OTEL classifies server vs client.

    if (Object.hasOwn(input.matcher, 'required_span_kinds') === false) {
      throw Error('we only support "span" matching rules')
    }

    this.#name = input.name
    this.#type = input.type
    this.#attributes = input.attributes ?? []
    this.#txTransformation = input.transaction ?? {}
    this.#segmentTransformation = input.segment ?? {}
    this.#spanKinds = input?.matcher?.required_span_kinds?.map((v) => v.toLowerCase()) ?? []
    this.#requiredAttributes = input?.matcher?.required_attribute_keys ?? []
    this.#requiredConditions = input?.matcher?.attribute_conditions ?? {}
  }
@param {SerializedOtelMappingRule} input A serialized rule to parse.