<commit_before>/*
 * Copyright (c) 2016, Apptentive, Inc. All Rights Reserved.
 * Please refer to the LICENSE file for the terms and conditions
 * under which redistribution and use of this file is permitted.
 */

package com.apptentive.android.sdk.model;

import com.apptentive.android.sdk.ApptentiveLog;

import org.json.JSONException;
import org.json.JSONObject;

public class ConversationTokenRequest extends JSONObject {
	public ConversationTokenRequest() {
	}

	public void setDevice(DevicePayload device) {
		try {
			put(DevicePayload.KEY, device);
		} catch (JSONException e) {
			ApptentiveLog.e("Error adding %s to ConversationTokenRequest", DevicePayload.KEY);
		}
	}

	public void setSdk(SdkPayload sdk) {
		try {
			put(SdkPayload.KEY, sdk);
		} catch (JSONException e) {
			ApptentiveLog.e("Error adding %s to ConversationTokenRequest", SdkPayload.KEY);
		}
	}

	public void setPerson(PersonPayload person) {
		try {
			put(PersonPayload.KEY, person);
		} catch (JSONException e) {
			ApptentiveLog.e("Error adding %s to ConversationTokenRequest", PersonPayload.KEY);
		}
	}

	public void setAppRelease(AppReleasePayload appRelease) {
		try {
			put(AppReleasePayload.KEY, appRelease);
		} catch (JSONException e) {
			ApptentiveLog.e("Error adding %s to ConversationTokenRequest", AppReleasePayload.KEY);
		}
	}
}<commit_msg>Fix Conversation creation request. It was stringifying each piece of the request, instead of treating them as sub objects.<commit_after>/*
 * Copyright (c) 2016, Apptentive, Inc. All Rights Reserved.
 * Please refer to the LICENSE file for the terms and conditions
 * under which redistribution and use of this file is permitted.
 */

package com.apptentive.android.sdk.model;

import com.apptentive.android.sdk.ApptentiveLog;

import org.json.JSONException;
import org.json.JSONObject;

public class ConversationTokenRequest extends JSONObject {
	public ConversationTokenRequest() {
	}

	public void setDevice(DevicePayload device) {
		try {
			put(DevicePayload.KEY, device == null ? null : device.getJsonObject());
		} catch (JSONException e) {
			ApptentiveLog.e("Error adding %s to ConversationTokenRequest", DevicePayload.KEY);
		}
	}

	public void setSdk(SdkPayload sdk) {
		try {
			put(SdkPayload.KEY, sdk == null ? null : sdk.getJsonObject());
		} catch (JSONException e) {
			ApptentiveLog.e("Error adding %s to ConversationTokenRequest", SdkPayload.KEY);
		}
	}

	public void setPerson(PersonPayload person) {
		try {
			put(PersonPayload.KEY, person == null ? null : person.getJsonObject());
		} catch (JSONException e) {
			ApptentiveLog.e("Error adding %s to ConversationTokenRequest", PersonPayload.KEY);
		}
	}

	public void setAppRelease(AppReleasePayload appRelease) {
		try {
			put(AppReleasePayload.KEY, appRelease == null ? null : appRelease.getJsonObject());
		} catch (JSONException e) {
			ApptentiveLog.e("Error adding %s to ConversationTokenRequest", AppReleasePayload.KEY);
		}
	}
}
{'fraction_non_alphanumeric': 0.10196476964769648, 'fraction_numerical': 0.0027100271002710027, 'mean_word_length': 4.603415559772296, 'pattern_counts': {'":': 0, '<': 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': '5329682', 'n_tokens_mistral': 981, 'n_tokens_neox': 905, 'n_words': 248}