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.redact;
017
018import com.fasterxml.jackson.annotation.JsonValue;
019import com.vonage.client.Jsonable;
020
021/**
022 * Represents a request to the Redact API.
023 */
024public class RedactRequest implements Jsonable {
025    private final String id;
026    private final Product product;
027    private Type type;
028
029    /**
030     * Construct a RedactRequest object with all required fields.
031     *
032     * @param id      The transaction id to redact.
033     * @param product The {@link Product} that the id relates to.
034     */
035    public RedactRequest(String id, Product product) {
036        this.id = id;
037        this.product = product;
038    }
039
040    public String getId() {
041        return id;
042    }
043
044    public Product getProduct() {
045        return product;
046    }
047
048    public Type getType() {
049        return type;
050    }
051
052    public void setType(Type type) {
053        this.type = type;
054    }
055
056    public enum Product {
057        SMS("sms"),
058        VOICE("voice"),
059        NUMBER_INSIGHTS("number-insight"),
060        VERIFY("verify"),
061        VERIFY_SDK("verify-sdk"),
062        MESSAGES("messages"),
063        WORKFLOW("workflow");
064
065        private final String value;
066
067        Product(String value) {
068            this.value = value;
069        }
070
071        @JsonValue
072        public String getValue() {
073            return value;
074        }
075    }
076
077    public enum Type {
078        INBOUND, OUTBOUND;
079
080        @JsonValue
081        public String getValue() {
082            return name().toLowerCase();
083        }
084    }
085}