001/*
002 *   Copyright 2024 Vonage
003 *
004 *   Licensed under the Apache License, Version 2.0 (the "License");
005 *   you may not use this file except in compliance with the License.
006 *   You may obtain a copy of the License at
007 *
008 *        http://www.apache.org/licenses/LICENSE-2.0
009 *
010 *   Unless required by applicable law or agreed to in writing, software
011 *   distributed under the License is distributed on an "AS IS" BASIS,
012 *   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
013 *   See the License for the specific language governing permissions and
014 *   limitations under the License.
015 */
016package com.vonage.client.meetings;
017
018import com.fasterxml.jackson.annotation.JsonProperty;
019import com.vonage.client.Jsonable;
020import java.util.Objects;
021import java.util.UUID;
022
023public class UpdateApplicationRequest implements Jsonable {
024        private final UUID defaultThemeId;
025
026        UpdateApplicationRequest(Builder builder) {
027                defaultThemeId = Objects.requireNonNull(builder.defaultThemeId, "Default theme ID is required.");
028        }
029
030        /**
031         * @return The theme ID to set as application default theme.
032         */
033        @JsonProperty("default_theme_id")
034        public UUID getDefaultThemeId() {
035                return defaultThemeId;
036        }
037        
038        /**
039         * Generates a JSON payload from this request.
040         *
041         * @return JSON representation of this UpdateApplicationRequest object.
042         */
043        @Override
044        public String toJson() {
045                return "{\"update_details\":" + Jsonable.super.toJson() + "}";
046        }
047
048        /**
049         * Entry point for constructing an instance of this class.
050         *
051         * @return A new Builder.
052         */
053        public static Builder builder() {
054                return new Builder();
055        }
056        
057        public static class Builder {
058                private UUID defaultThemeId;
059        
060                Builder() {}
061
062                /**
063                 *
064                 * @param defaultThemeId The theme ID to set as application default theme.
065                 *
066                 * @return This builder.
067                 */
068                public Builder defaultThemeId(UUID defaultThemeId) {
069                        this.defaultThemeId = defaultThemeId;
070                        return this;
071                }
072
073        
074                /**
075                 * Builds the {@linkplain UpdateApplicationRequest}.
076                 *
077                 * @return An instance of UpdateApplicationRequest, populated with all fields from this builder.
078                 */
079                public UpdateApplicationRequest build() {
080                        return new UpdateApplicationRequest(this);
081                }
082        }
083}