<commit_before>//
//  Feedback.swift
//  PinpointKit
//
//  Created by <NAME> on 2/5/16.
//  Copyright © 2016 Lickability. All rights reserved.
//

import UIKit

/**
 *  A struct containing user feedback on an application.
 */
public struct Feedback {
    
    /// An enum with assocated values that represents the screenshot.
    enum ScreenshotType {
        /// The original, un-annotated screenshot.
        case Original(image: UIImage)
        
        /// An annotated screenshot.
        case Annotated(image: UIImage)
        
        /// Both the original and annotated screenshot.
        case Combined(originalImage: UIImage, annotatedImage: UIImage)
        
        /// Returns an image of the screenshot preferring the annotated image.
        var preferredImage: UIImage {
            switch self {
            case let Original(image):
                return image
            case let Annotated(image):
                return image
            case let Combined(_, annotatedImage):
                return annotatedImage
            }
        }
    }
    
    /**
     *  A substructure containing information about the application and its environment.
     */
    struct ApplicationInformation {
        /// The application’s marketing version.
        let version: String?
        
        /// The application’s build number.
        let build: String?
        
        /// The application’s display name.
        let name: String?
        
        /// The application’s bundle identifer.
        let bundleIdentifer: String?
        
        /// The operating system version of the OS in which the application is running.
        let operatingSystemVersion: NSOperatingSystemVersion?
    }
    
    /// A screenshot of the screen the feedback relates to.
    let screenshot: ScreenshotType
    
    /// A filename without an extension for the screenshot or annotated screenshot.
    let screenshotFilename: String
    
    /// A short, optional title of the feedback submission. Suitable for an email subject.
    let title: String?
    
    /// An optional plain-text body of the feedback submission. Suitable for an email body.
    let body: String?
    
    /// A dictionary of additional information provided by the application developer.
    let additionalInformation: [String: AnyObject]?
    
    /// A struct containing information about the application and its environment.
    let applicationInformation: ApplicationInformation?
    
    /// Initializes a `Feedback` with optional default values.
    
    /**
     Initializes a `Feedback` with optional default values.
     
     - parameter screenshot:             The type of screenshot in the feedback.
     - parameter screenshotFilename:     The file name of the screenshot.
     - parameter title:                  The title of the feedback.
     - parameter body:                   The default body text.
     - parameter additionalInformation:  Any additional information you want to capture.
     - parameter applicationInformation: Information about the application to be captured.
     */
    init(screenshot: ScreenshotType,
        screenshotFilename: String = "Screenshot.png",
        title: String? = "Bug Report",
        body: String? = nil,
        additionalInformation: [String: AnyObject]? = nil,
        applicationInformation: ApplicationInformation? = nil) {
            self.screenshot = screenshot
            self.screenshotFilename = screenshotFilename
            self.title = title
            self.body = body
            self.additionalInformation = additionalInformation
            self.applicationInformation = applicationInformation
    }
}<commit_msg>Adds log properties to the Feedback struct<commit_after>//
//  Feedback.swift
//  PinpointKit
//
//  Created by <NAME> on 2/5/16.
//  Copyright © 2016 Lickability. All rights reserved.
//

import UIKit

/**
 *  A struct containing user feedback on an application.
 */
public struct Feedback {
    
    /// An enum with assocated values that represents the screenshot.
    enum ScreenshotType {
        /// The original, un-annotated screenshot.
        case Original(image: UIImage)
        
        /// An annotated screenshot.
        case Annotated(image: UIImage)
        
        /// Both the original and annotated screenshot.
        case Combined(originalImage: UIImage, annotatedImage: UIImage)
        
        /// Returns an image of the screenshot preferring the annotated image.
        var preferredImage: UIImage {
            switch self {
            case let Original(image):
                return image
            case let Annotated(image):
                return image
            case let Combined(_, annotatedImage):
                return annotatedImage
            }
        }
    }
    
    /**
     *  A substructure containing information about the application and its environment.
     */
    struct ApplicationInformation {
        /// The application’s marketing version.
        let version: String?
        
        /// The application’s build number.
        let build: String?
        
        /// The application’s display name.
        let name: String?
        
        /// The application’s bundle identifer.
        let bundleIdentifer: String?
        
        /// The operating system version of the OS in which the application is running.
        let operatingSystemVersion: NSOperatingSystemVersion?
    }
    
    /// A screenshot of the screen the feedback relates to.
    let screenshot: ScreenshotType
    
    /// A filename without an extension for the screenshot or annotated screenshot.
    let screenshotFilename: String
    
    /// A short, optional title of the feedback submission. Suitable for an email subject.
    let title: String?
    
    /// An optional plain-text body of the feedback submission. Suitable for an email body.
    let body: String?
    
    /// An optional collection of log strings.
    let logs: [String]?
    
    /// A filename without an extension for the logs text file.
    let logsFilename: String
    
    /// A dictionary of additional information provided by the application developer.
    let additionalInformation: [String: AnyObject]?
    
    /// A struct containing information about the application and its environment.
    let applicationInformation: ApplicationInformation?
    
    /// Initializes a `Feedback` with optional default values.
    
    /**
     Initializes a `Feedback` with optional default values.
     
     - parameter screenshot:             The type of screenshot in the feedback.
     - parameter screenshotFilename:     The file name of the screenshot.
     - parameter title:                  The title of the feedback.
     - parameter body:                   The default body text.
     - parameter logs:                   The logs to include in the feedback, if any.
     - parameter logsFilename:           The file name of the logs text file.
     - parameter additionalInformation:  Any additional information you want to capture.
     - parameter applicationInformation: Information about the application to be captured.
     */
    init(screenshot: ScreenshotType,
        screenshotFilename: String = "Screenshot.png",
        title: String? = "Bug Report",
        body: String? = nil,
        logs: [String]? = nil,
        logsFilename: String = "logs",
        additionalInformation: [String: AnyObject]? = nil,
        applicationInformation: ApplicationInformation? = nil) {
            self.screenshot = screenshot
            self.screenshotFilename = screenshotFilename
            self.title = title
            self.body = body
            self.logs = logs
            self.logsFilename = logsFilename
            self.additionalInformation = additionalInformation
            self.applicationInformation = applicationInformation
    }
}
{'fraction_non_alphanumeric': 0.06687046236148261, 'fraction_numerical': 0.0020379569481594703, 'mean_word_length': 2.0410534469403565, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 5, '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': '5003301', 'n_tokens_mistral': 1873, 'n_tokens_neox': 1769, 'n_words': 715}