|
| 1 | +/* |
| 2 | + * (C) Copyright IBM Corp. 2022. |
| 3 | + * |
| 4 | + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with |
| 5 | + * the License. You may obtain a copy of the License at |
| 6 | + * |
| 7 | + * http://www.apache.org/licenses/LICENSE-2.0 |
| 8 | + * |
| 9 | + * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on |
| 10 | + * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the |
| 11 | + * specific language governing permissions and limitations under the License. |
| 12 | + */ |
| 13 | +package com.ibm.watson.assistant.v1.model; |
| 14 | + |
| 15 | +import java.util.ArrayList; |
| 16 | +import java.util.List; |
| 17 | +import java.util.Map; |
| 18 | + |
| 19 | +/** DialogNodeOutputGenericDialogNodeOutputResponseTypeAudio. */ |
| 20 | +public class DialogNodeOutputGenericDialogNodeOutputResponseTypeAudio |
| 21 | + extends DialogNodeOutputGeneric { |
| 22 | + |
| 23 | + /** Builder. */ |
| 24 | + public static class Builder { |
| 25 | + private String responseType; |
| 26 | + private String source; |
| 27 | + private String title; |
| 28 | + private String description; |
| 29 | + private List<ResponseGenericChannel> channels; |
| 30 | + private Map<String, Object> channelOptions; |
| 31 | + private String altText; |
| 32 | + |
| 33 | + public Builder( |
| 34 | + DialogNodeOutputGeneric dialogNodeOutputGenericDialogNodeOutputResponseTypeAudio) { |
| 35 | + this.responseType = dialogNodeOutputGenericDialogNodeOutputResponseTypeAudio.responseType; |
| 36 | + this.source = dialogNodeOutputGenericDialogNodeOutputResponseTypeAudio.source; |
| 37 | + this.title = dialogNodeOutputGenericDialogNodeOutputResponseTypeAudio.title; |
| 38 | + this.description = dialogNodeOutputGenericDialogNodeOutputResponseTypeAudio.description; |
| 39 | + this.channels = dialogNodeOutputGenericDialogNodeOutputResponseTypeAudio.channels; |
| 40 | + this.channelOptions = dialogNodeOutputGenericDialogNodeOutputResponseTypeAudio.channelOptions; |
| 41 | + this.altText = dialogNodeOutputGenericDialogNodeOutputResponseTypeAudio.altText; |
| 42 | + } |
| 43 | + |
| 44 | + /** Instantiates a new builder. */ |
| 45 | + public Builder() {} |
| 46 | + |
| 47 | + /** |
| 48 | + * Instantiates a new builder with required properties. |
| 49 | + * |
| 50 | + * @param responseType the responseType |
| 51 | + * @param source the source |
| 52 | + */ |
| 53 | + public Builder(String responseType, String source) { |
| 54 | + this.responseType = responseType; |
| 55 | + this.source = source; |
| 56 | + } |
| 57 | + |
| 58 | + /** |
| 59 | + * Builds a DialogNodeOutputGenericDialogNodeOutputResponseTypeAudio. |
| 60 | + * |
| 61 | + * @return the new DialogNodeOutputGenericDialogNodeOutputResponseTypeAudio instance |
| 62 | + */ |
| 63 | + public DialogNodeOutputGenericDialogNodeOutputResponseTypeAudio build() { |
| 64 | + return new DialogNodeOutputGenericDialogNodeOutputResponseTypeAudio(this); |
| 65 | + } |
| 66 | + |
| 67 | + /** |
| 68 | + * Adds an channels to channels. |
| 69 | + * |
| 70 | + * @param channels the new channels |
| 71 | + * @return the DialogNodeOutputGenericDialogNodeOutputResponseTypeAudio builder |
| 72 | + */ |
| 73 | + public Builder addChannels(ResponseGenericChannel channels) { |
| 74 | + com.ibm.cloud.sdk.core.util.Validator.notNull(channels, "channels cannot be null"); |
| 75 | + if (this.channels == null) { |
| 76 | + this.channels = new ArrayList<ResponseGenericChannel>(); |
| 77 | + } |
| 78 | + this.channels.add(channels); |
| 79 | + return this; |
| 80 | + } |
| 81 | + |
| 82 | + /** |
| 83 | + * Set the responseType. |
| 84 | + * |
| 85 | + * @param responseType the responseType |
| 86 | + * @return the DialogNodeOutputGenericDialogNodeOutputResponseTypeAudio builder |
| 87 | + */ |
| 88 | + public Builder responseType(String responseType) { |
| 89 | + this.responseType = responseType; |
| 90 | + return this; |
| 91 | + } |
| 92 | + |
| 93 | + /** |
| 94 | + * Set the source. |
| 95 | + * |
| 96 | + * @param source the source |
| 97 | + * @return the DialogNodeOutputGenericDialogNodeOutputResponseTypeAudio builder |
| 98 | + */ |
| 99 | + public Builder source(String source) { |
| 100 | + this.source = source; |
| 101 | + return this; |
| 102 | + } |
| 103 | + |
| 104 | + /** |
| 105 | + * Set the title. |
| 106 | + * |
| 107 | + * @param title the title |
| 108 | + * @return the DialogNodeOutputGenericDialogNodeOutputResponseTypeAudio builder |
| 109 | + */ |
| 110 | + public Builder title(String title) { |
| 111 | + this.title = title; |
| 112 | + return this; |
| 113 | + } |
| 114 | + |
| 115 | + /** |
| 116 | + * Set the description. |
| 117 | + * |
| 118 | + * @param description the description |
| 119 | + * @return the DialogNodeOutputGenericDialogNodeOutputResponseTypeAudio builder |
| 120 | + */ |
| 121 | + public Builder description(String description) { |
| 122 | + this.description = description; |
| 123 | + return this; |
| 124 | + } |
| 125 | + |
| 126 | + /** |
| 127 | + * Set the channels. Existing channels will be replaced. |
| 128 | + * |
| 129 | + * @param channels the channels |
| 130 | + * @return the DialogNodeOutputGenericDialogNodeOutputResponseTypeAudio builder |
| 131 | + */ |
| 132 | + public Builder channels(List<ResponseGenericChannel> channels) { |
| 133 | + this.channels = channels; |
| 134 | + return this; |
| 135 | + } |
| 136 | + |
| 137 | + /** |
| 138 | + * Set the channelOptions. |
| 139 | + * |
| 140 | + * @param channelOptions the channelOptions |
| 141 | + * @return the DialogNodeOutputGenericDialogNodeOutputResponseTypeAudio builder |
| 142 | + */ |
| 143 | + public Builder channelOptions(Map<String, Object> channelOptions) { |
| 144 | + this.channelOptions = channelOptions; |
| 145 | + return this; |
| 146 | + } |
| 147 | + |
| 148 | + /** |
| 149 | + * Set the altText. |
| 150 | + * |
| 151 | + * @param altText the altText |
| 152 | + * @return the DialogNodeOutputGenericDialogNodeOutputResponseTypeAudio builder |
| 153 | + */ |
| 154 | + public Builder altText(String altText) { |
| 155 | + this.altText = altText; |
| 156 | + return this; |
| 157 | + } |
| 158 | + } |
| 159 | + |
| 160 | + protected DialogNodeOutputGenericDialogNodeOutputResponseTypeAudio(Builder builder) { |
| 161 | + com.ibm.cloud.sdk.core.util.Validator.notNull( |
| 162 | + builder.responseType, "responseType cannot be null"); |
| 163 | + com.ibm.cloud.sdk.core.util.Validator.notNull(builder.source, "source cannot be null"); |
| 164 | + responseType = builder.responseType; |
| 165 | + source = builder.source; |
| 166 | + title = builder.title; |
| 167 | + description = builder.description; |
| 168 | + channels = builder.channels; |
| 169 | + channelOptions = builder.channelOptions; |
| 170 | + altText = builder.altText; |
| 171 | + } |
| 172 | + |
| 173 | + /** |
| 174 | + * New builder. |
| 175 | + * |
| 176 | + * @return a DialogNodeOutputGenericDialogNodeOutputResponseTypeAudio builder |
| 177 | + */ |
| 178 | + public Builder newBuilder() { |
| 179 | + return new Builder(this); |
| 180 | + } |
| 181 | +} |
0 commit comments