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.proactiveconnect;
017
018import com.fasterxml.jackson.annotation.JsonProperty;
019import com.vonage.client.Jsonable;
020import com.vonage.client.JsonableBaseObject;
021
022/**
023 * Provides info on list changes compared to the latest sync.
024 */
025public class SyncStatus extends JsonableBaseObject {
026        private SyncStatusValue value;
027        private String details;
028        private Boolean metadataModified, dataModified, dirty;
029
030        protected SyncStatus() {
031        }
032
033        /**
034         * Synchronization state of the list.
035         *
036         * @return The sync status enum.
037         */
038        @JsonProperty("value")
039        public SyncStatusValue getValue() {
040                return value;
041        }
042
043        /**
044         * Details on the sync status.
045         *
046         * @return Sync status details as a string.
047         */
048        @JsonProperty("details")
049        public String getDetails() {
050                return details;
051        }
052
053        /**
054         * Whether the list definition has been modified since last sync.
055         *
056         * @return {@code true} if the list metadata was modified since last sync.
057         */
058        @JsonProperty("metadata_modified")
059        public Boolean getMetadataModified() {
060                return metadataModified;
061        }
062
063        /**
064         * Whether one or more list items were added, removed and/or modified since last sync.
065         *
066         * @return {@code true} if the list data was modified since last sync.
067         */
068        @JsonProperty("data_modified")
069        public Boolean getDataModified() {
070                return dataModified;
071        }
072
073        /**
074         * Whether the list content or metadata were modified since last sync.
075         *
076         * @return {@code true} if the list was modified since last sync.
077         */
078        @JsonProperty("dirty")
079        public Boolean getDirty() {
080                return dirty;
081        }
082        
083        /**
084         * Creates an instance of this class from a JSON payload.
085         *
086         * @param json The JSON string to parse.
087         * @return An instance of this class with the fields populated, if present.
088         */
089        public static SyncStatus fromJson(String json) {
090                return Jsonable.fromJson(json);
091        }
092}