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.video;
017
018import com.fasterxml.jackson.annotation.JsonProperty;
019import com.vonage.client.Jsonable;
020import com.vonage.client.JsonableBaseObject;
021
022/**
023 * Represents properties of a video project.
024 */
025public class ProjectDetails extends JsonableBaseObject {
026        private String applicationId, name;
027        private ProjectStatus status;
028        private ProjectEnvironment environment;
029        private Long createdAt;
030
031        protected ProjectDetails() {
032        }
033
034        /**
035         * @return The Vonage application ID.
036         */
037        @JsonProperty("applicationId")
038        public String getApplicationId() {
039                return applicationId;
040        }
041
042        /**
043         * @return Whether the project is active or suspended.
044         */
045        @JsonProperty("status")
046        public ProjectStatus getStatus() {
047                return status;
048        }
049
050        /**
051         * @return The project name, if specified when created.
052         */
053        @JsonProperty("name")
054        public String getName() {
055                return name;
056        }
057
058        /**
059         * @return The environment the project is running on.
060         */
061        @JsonProperty("environment")
062        public ProjectEnvironment getEnvironment() {
063                return environment;
064        }
065
066        /**
067         * @return The time at which the project was created (a UNIX timestamp, in milliseconds).
068         */
069        @JsonProperty("createdAt")
070        public Long getCreatedAt() {
071                return createdAt;
072        }
073
074        /**
075         * Creates an instance of this class from a JSON payload.
076         *
077         * @param json The JSON string to parse.
078         * @return An instance of this class with the fields populated, if present.
079         */
080        public static ProjectDetails fromJson(String json) {
081                if (json == null || json.trim().isEmpty()) {
082                        return new ProjectDetails();
083                }
084                return Jsonable.fromJson(json);
085        }
086}