2 * Copyright (c) 2010-2021 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, @Nullable String accessToken, String frc,
29 JsonWebSiteCookie[] webSiteCookies) {
30 registrationData.deviceSerial = serial;
31 authData.accessToken = accessToken;
32 userContextMap.frc = frc;
33 cookies.webSiteCookies = webSiteCookies;
36 @SerializedName("requested_extensions")
37 public String[] requestedExtensions = { "device_info", "customer_info" };
39 public Cookies cookies = new Cookies();
40 @SerializedName("registration_data")
41 public RegistrationData registrationData = new RegistrationData();
42 @SerializedName("auth_data")
43 public AuthData authData = new AuthData();
44 @SerializedName("user_context_map")
45 public UserContextMap userContextMap = new UserContextMap();
46 @SerializedName("requested_token_type")
47 public String[] requestedTokenType = { "bearer", "mac_dms", "website_cookies" };
49 public static class Cookies {
50 @SerializedName("website_cookies")
51 public @Nullable JsonWebSiteCookie @Nullable [] webSiteCookies;
52 public @Nullable String domain = ".amazon.com";
55 public static class RegistrationData {
56 public String domain = "Device";
57 @SerializedName("app_version")
58 public String appVersion = "2.2.223830.0";
59 @SerializedName("device_type")
60 public String deviceType = "A2IVLV5VM2W81";
61 @SerializedName("device_name")
62 public String deviceName = "%FIRST_NAME%'s%DUPE_STRATEGY_1ST%openHAB Alexa Binding";
63 @SerializedName("os_version")
64 public String osVersion = "11.4.1";
65 @SerializedName("device_serial")
66 public @Nullable String deviceSerial;
67 @SerializedName("device_model")
68 public String deviceModel = "iPhone";
69 @SerializedName("app_name")
70 public String appName = "openHAB Alexa Binding";
71 @SerializedName("software_version")
72 public String softwareVersion = "1";
75 public static class AuthData {
76 @SerializedName("access_token")
77 public @Nullable String accessToken;
80 public static class UserContextMap {
81 public String frc = "";