]> git.basschouten.com Git - openhab-addons.git/blob
549f49c518d540507a12425c718a5fb33ade9db0
[openhab-addons.git] /
1 /**
2  * Copyright (c) 2010-2023 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.amplipi.internal.model;
14
15 import java.util.List;
16
17 import com.google.gson.annotations.SerializedName;
18
19 import io.swagger.v3.oas.annotations.media.Schema;
20
21 /**
22  * Reconfiguration of a Group
23  **/
24 @Schema(description = "Reconfiguration of a Group ")
25 public class GroupUpdate {
26
27     @Schema
28     /**
29      * Friendly name
30      **/
31     private String name;
32
33     @Schema
34     @SerializedName("source_id")
35     /**
36      * id of the connected source
37      **/
38     private Integer sourceId;
39
40     @Schema
41     /**
42      * Set of zones belonging to a group
43      **/
44     private List<Integer> zones;
45
46     @Schema
47     /**
48      * Set to true if output is all zones muted
49      **/
50     private Boolean mute;
51
52     @Schema
53     @SerializedName("vol_delta")
54     /**
55      * Average utput volume in dB
56      **/
57     private Integer volDelta;
58
59     /**
60      * Friendly name
61      *
62      * @return name
63      **/
64     public String getName() {
65         return name;
66     }
67
68     public void setName(String name) {
69         this.name = name;
70     }
71
72     public GroupUpdate name(String name) {
73         this.name = name;
74         return this;
75     }
76
77     /**
78      * id of the connected source
79      * minimum: 0
80      * maximum: 3
81      *
82      * @return sourceId
83      **/
84     public Integer getSourceId() {
85         return sourceId;
86     }
87
88     public void setSourceId(Integer sourceId) {
89         this.sourceId = sourceId;
90     }
91
92     public GroupUpdate sourceId(Integer sourceId) {
93         this.sourceId = sourceId;
94         return this;
95     }
96
97     /**
98      * Set of zones belonging to a group
99      *
100      * @return zones
101      **/
102     public List<Integer> getZones() {
103         return zones;
104     }
105
106     public void setZones(List<Integer> zones) {
107         this.zones = zones;
108     }
109
110     public GroupUpdate zones(List<Integer> zones) {
111         this.zones = zones;
112         return this;
113     }
114
115     public GroupUpdate addZonesItem(Integer zonesItem) {
116         this.zones.add(zonesItem);
117         return this;
118     }
119
120     /**
121      * Set to true if output is all zones muted
122      *
123      * @return mute
124      **/
125     public Boolean getMute() {
126         return mute;
127     }
128
129     public void setMute(Boolean mute) {
130         this.mute = mute;
131     }
132
133     public GroupUpdate mute(Boolean mute) {
134         this.mute = mute;
135         return this;
136     }
137
138     /**
139      * Average utput volume in dB
140      * minimum: -79
141      * maximum: 0
142      *
143      * @return volDelta
144      **/
145     public Integer getVolDelta() {
146         return volDelta;
147     }
148
149     public void setVolDelta(Integer volDelta) {
150         this.volDelta = volDelta;
151     }
152
153     public GroupUpdate volDelta(Integer volDelta) {
154         this.volDelta = volDelta;
155         return this;
156     }
157
158     @Override
159     public String toString() {
160         StringBuilder sb = new StringBuilder();
161         sb.append("class GroupUpdate {\n");
162
163         sb.append("    name: ").append(toIndentedString(name)).append("\n");
164         sb.append("    sourceId: ").append(toIndentedString(sourceId)).append("\n");
165         sb.append("    zones: ").append(toIndentedString(zones)).append("\n");
166         sb.append("    mute: ").append(toIndentedString(mute)).append("\n");
167         sb.append("    volDelta: ").append(toIndentedString(volDelta)).append("\n");
168         sb.append("}");
169         return sb.toString();
170     }
171
172     /**
173      * Convert the given object to string with each line indented by 4 spaces
174      * (except the first line).
175      */
176     private static String toIndentedString(Object o) {
177         if (o == null) {
178             return "null";
179         }
180         return o.toString().replace("\n", "\n    ");
181     }
182 }