]> git.basschouten.com Git - openhab-addons.git/blob
5e3a7d629c7307116e4e7eb5d7e5ef60fe10a618
[openhab-addons.git] /
1 /**
2  * Copyright (c) 2010-2020 Contributors to the openHAB project
3  *
4  * See the NOTICE file(s) distributed with this work for additional
5  * information.
6  *
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
10  *
11  * SPDX-License-Identifier: EPL-2.0
12  */
13 package org.openhab.binding.amazonechocontrol.internal.jsons;
14
15 import org.eclipse.jdt.annotation.NonNullByDefault;
16 import org.eclipse.jdt.annotation.Nullable;
17
18 import com.google.gson.annotations.SerializedName;
19
20 /**
21  * The {@link JsonRegisterAppRequest} encapsulate the GSON data of register application request
22  *
23  * @author Michael Geramb - Initial contribution
24  */
25 @NonNullByDefault
26 public class JsonRegisterAppRequest {
27
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;
33     }
34
35     @SerializedName("requested_extensions")
36     public String[] requestedExtensions = { "device_info", "customer_info" };
37
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" };
47
48     public static class Cookies {
49         @SerializedName("website_cookies")
50         public @Nullable JsonWebSiteCookie @Nullable [] webSiteCookies;
51         public @Nullable String domain = ".amazon.com";
52     }
53
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";
72     }
73
74     public static class AuthData {
75         @SerializedName("access_token")
76         public @Nullable String accessToken;
77     }
78
79     public static class UserContextMap {
80         public String frc = "";
81     }
82 }