<commit_before>import Foundation

typealias providerState = String

public typealias Query = [String: PactEncodable]
public typealias Headers = [String: PactEncodable]
public typealias Body = PactEncodable

struct Interaction {
    struct Request {
        let method: HTTPMethod
        let path: PactEncodable
        var query: Query?
        var headers: Headers?
        var body: Body?

        var pactJSON: Any {
            var JSON = [
                "method": method.rawValue.uppercased(),
                "path": path.pactJSON,
            ]
            if let body = body {
                JSON["body"] = body.pactJSON
            }
            if let headers = headers {
                JSON["headers"] = headers.pactJSON
            }
            if let query = query {
                JSON["query"] = query.pactJSON
            }
            return JSON
        }
    }

    struct Response {
        let status: Int
        let headers: Headers?
        let body: Body?

        var pactJSON: Any {
            var JSON: JSONObject = ["status": status]
            if let headers = headers {
                JSON["headers"] = headers.pactJSON
            }
            if let body = body {
                JSON["body"] = body.pactJSON
            }
            return JSON
        }
    }

    var description: String
    var providerState: ProviderState?
    var request: Request<commit_msg>Add PactEncodable<commit_after>import Foundation

typealias providerState = String

public typealias Query = [String: PactEncodable]
public typealias Headers = [String: PactEncodable]
public typealias Body = PactEncodable

struct Interaction: PactEncodable {
    struct Request: PactEncodable {
        let method: HTTPMethod
        let path: PactEncodable
        var query: Query?
        var headers: Headers?
        var body: Body?

        var pactJSON: Any {
            var JSON = [
                "method": method.rawValue.uppercased(),
                "path": path.pactJSON,
            ]
            if let body = body {
                JSON["body"] = body.pactJSON
            }
            if let headers = headers {
                JSON["headers"] = headers.pactJSON
            }
            if let query = query {
                JSON["query"] = query.pactJSON
            }
            return JSON
        }
    }

    struct Response: PactEncodable {
        let status: Int
        let headers: Headers?
        let body: Body?

        var pactJSON: Any {
            var JSON: JSONObject = ["status": status]
            if let headers = headers {
                JSON["headers"] = headers.pactJSON
            }
            if let body = body {
                JSON["body"] = body.pactJSON
            }
            return JSON
        }
    }

    var description: String
    var providerState: ProviderState?
    var request: Request
{'fraction_non_alphanumeric': 0.07703032415475776, 'fraction_numerical': 0.0, 'mean_word_length': 1.480553154710458, 'pattern_counts': {'":': 6, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1986930', 'n_tokens_mistral': 764, 'n_tokens_neox': 733, 'n_words': 221}