<commit_before>//
//  Promo.swift
//  MercadoPagoSDK
//
//  Created by <NAME> on 22/5/15.
//  Copyright (c) 2015 MercadoPago. All rights reserved.
//

import Foundation

public class Promo : Equatable{
	
	public var promoId : String!
	public var issuer : Issuer!
	public var recommendedMessage : String!
	public var paymentMethods : [PaymentMethod]!
	public var legals : String!
	public var url : String!
	
	public class func fromJSON(json : NSDictionary) -> Promo {
		
		let promo : Promo = Promo()
		promo.promoId = json["id"] as? String
		
		if let issuerDic = json["issuer"] as? NSDictionary {
			promo.issuer = Issuer.fromJSON(issuerDic)
		}

		promo.recommendedMessage = json["recommended_message"] as? String
		
		if let picDic = json["picture"] as? NSDictionary {
			promo.url = picDic["url"] as? String
		}
		
		var paymentMethods : [PaymentMethod] = [PaymentMethod]()
		if let pmArray = json["payment_methods"] as? NSArray {
			for i in 0..<pmArray.count {
				if let pmDic = pmArray[i] as? NSDictionary {
					paymentMethods.append(PaymentMethod.fromJSON(pmDic))
				}
			}
		}
		
		promo.paymentMethods = paymentMethods
		
		return promo
	}
	
	public class func getDateFromString(string: String!) -> NSDate! {
		if string == nil {<commit_msg>Add legals to Promo.swift<commit_after>//
//  Promo.swift
//  MercadoPagoSDK
//
//  Created by <NAME> on 22/5/15.
//  Copyright (c) 2015 MercadoPago. All rights reserved.
//

import Foundation

public class Promo : Equatable{
	
	public var promoId : String!
	public var issuer : Issuer!
	public var recommendedMessage : String!
	public var paymentMethods : [PaymentMethod]!
	public var legals : String!
	public var url : String!
	
	public class func fromJSON(json : NSDictionary) -> Promo {
		
		let promo : Promo = Promo()
		promo.promoId = json["id"] as? String
		
		if let issuerDic = json["issuer"] as? NSDictionary {
			promo.issuer = Issuer.fromJSON(issuerDic)
		}

		promo.recommendedMessage = json["recommended_message"] as? String
		
		if let picDic = json["picture"] as? NSDictionary {
			promo.url = picDic["url"] as? String
		}
		
		var paymentMethods : [PaymentMethod] = [PaymentMethod]()
		if let pmArray = json["payment_methods"] as? NSArray {
			for i in 0..<pmArray.count {
				if let pmDic = pmArray[i] as? NSDictionary {
					paymentMethods.append(PaymentMethod.fromJSON(pmDic))
				}
			}
		}
		
		promo.paymentMethods = paymentMethods
		
		promo.legals = json["legals"] as? String
		
		return promo
	}
	
	public class func getDateFromString(string: String!) -> NSDate! {
		if string == nil {
{'fraction_non_alphanumeric': 0.11457521434138737, 'fraction_numerical': 0.00779423226812159, 'mean_word_length': 3.4258620689655173, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 9, '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': '3507324', 'n_tokens_mistral': 989, 'n_tokens_neox': 849, 'n_words': 237}