001/* 002 * Copyright 2020 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.sns.request; 017 018 019import java.util.HashMap; 020import java.util.Map; 021 022 023public abstract class SnsRequest { 024 private final String command; 025 private String to; 026 private String topicArn; 027 028 public SnsRequest(final String command, 029 final String to, 030 final String topicArn) { 031 this.command = command; 032 this.to = to; 033 this.topicArn = topicArn; 034 } 035 036 public String getCommand() { 037 return this.command; 038 } 039 040 public Map<String, String> getQueryParameters() { 041 Map<String, String> params = new HashMap<>(); 042 params.put("cmd", getCommand()); 043 params.put("to", this.to); 044 params.put("topic", this.topicArn); 045 return params; 046 } 047}