<commit_before>//
//  OAuthToken.swift
//  StravaSwift
//
//  Created by Matthew on 11/11/2015.
//  Copyright © 2015 <NAME>. All rights reserved.
//

import Foundation
import SwiftyJSON

/**
OAuthToken which is required for requesting Strava resources
 **/
public struct OAuthToken: Strava {

    /** The access token **/
    public let accessToken: String?
    
    /** The athlete **/
    public let athlete: Athlete?

    /**
     Initializer
     
     - Parameter json: A SwiftyJSON object
     **/
    public init(_ json: JSON) {
        accessToken = json["access_token"].string
        athlete = Athlete(json["athlete"])
    }
}<commit_msg>Added refresh token and new init<commit_after>//
//  OAuthToken.swift
//  StravaSwift
//
//  Created by Matthew on 11/11/2015.
//  Copyright © 2015 <NAME>. All rights reserved.
//

import Foundation
import SwiftyJSON

/**
OAuthToken which is required for requesting Strava resources
 **/
public struct OAuthToken: Strava {

    /** The access token **/
    public let accessToken: String?
    
    /** The refresh token **/
    public let refreshToken: String?
    
    /** The athlete **/
    public let athlete: Athlete?

    /**
     Initializers
     
     - Parameter json: A SwiftyJSON object
     **/
    public init(_ json: JSON) {
        accessToken = json["access_token"].string
        refreshToken = json["refresh_token"].string
        athlete = Athlete(json["athlete"])
    }
    
    public init(access: String?, refresh: String?) {
        accessToken = access
        refreshToken = refresh
        athlete = nil
    }

}
{'fraction_non_alphanumeric': 0.11342155009451796, 'fraction_numerical': 0.015122873345935728, 'mean_word_length': 2.3787234042553194, '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': '2617091', 'n_tokens_mistral': 491, 'n_tokens_neox': 461, 'n_words': 141}