2 * Copyright (c) 2010-2020 Contributors to the openHAB project
4 * See the NOTICE file(s) distributed with this work for additional
7 * This program and the accompanying materials are made available under the
8 * terms of the Eclipse Public License 2.0 which is available at
9 * http://www.eclipse.org/legal/epl-2.0
11 * SPDX-License-Identifier: EPL-2.0
13 package org.openhab.binding.amazonechocontrol.internal.jsons;
15 import org.eclipse.jdt.annotation.NonNullByDefault;
16 import org.eclipse.jdt.annotation.Nullable;
18 import com.google.gson.annotations.SerializedName;
21 * The {@link JsonRegisterAppRequest} encapsulate the GSON data of register application request
23 * @author Michael Geramb - Initial contribution
26 public class JsonRegisterAppRequest {
28 public JsonRegisterAppRequest(String serial, String accessToken, String frc, JsonWebSiteCookie[] webSiteCookies) {
29 registrationData.deviceSerial = serial;
30 authData.accessToken = accessToken;
31 userContextMap.frc = frc;
32 cookies.webSiteCookies = webSiteCookies;
35 @SerializedName("requested_extensions")
36 public String[] requestedExtensions = { "device_info", "customer_info" };
38 public Cookies cookies = new Cookies();
39 @SerializedName("registration_data")
40 public RegistrationData registrationData = new RegistrationData();
41 @SerializedName("auth_data")
42 public AuthData authData = new AuthData();
43 @SerializedName("user_context_map")
44 public UserContextMap userContextMap = new UserContextMap();
45 @SerializedName("requested_token_type")
46 public String[] requestedTokenType = { "bearer", "mac_dms", "website_cookies" };
48 public static class Cookies {
49 @SerializedName("website_cookies")
50 public @Nullable JsonWebSiteCookie @Nullable [] webSiteCookies;
51 public @Nullable String domain = ".amazon.com";
54 public static class RegistrationData {
55 public String domain = "Device";
56 @SerializedName("app_version")
57 public String appVersion = "2.2.223830.0";
58 @SerializedName("device_type")
59 public String deviceType = "A2IVLV5VM2W81";
60 @SerializedName("device_name")
61 public String deviceName = "%FIRST_NAME%'s%DUPE_STRATEGY_1ST%openHAB Alexa Binding";
62 @SerializedName("os_version")
63 public String osVersion = "11.4.1";
64 @SerializedName("device_serial")
65 public @Nullable String deviceSerial;
66 @SerializedName("device_model")
67 public String deviceModel = "iPhone";
68 @SerializedName("app_name")
69 public String appName = "openHAB Alexa Binding";
70 @SerializedName("software_version")
71 public String softwareVersion = "1";
74 public static class AuthData {
75 @SerializedName("access_token")
76 public @Nullable String accessToken;
79 public static class UserContextMap {
80 public String frc = "";