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