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.conversations; 017 018import java.time.Instant; 019 020/** 021 * Filters results for {@link ConversationsClient#listConversations(ListConversationsRequest)}. 022 */ 023public final class ListConversationsRequest extends AbstractConversationsFilterRequest { 024 ListConversationsRequest(Builder builder) { 025 super(builder); 026 } 027 028 @Override 029 public Instant getStartDate() { 030 return super.getStartDate(); 031 } 032 033 @Override 034 public Instant getEndDate() { 035 return super.getEndDate(); 036 } 037 038 /** 039 * Entry point for constructing an instance of this class. 040 * 041 * @return A new Builder. 042 */ 043 public static Builder builder() { 044 return new Builder(); 045 } 046 047 public static final class Builder extends AbstractConversationsFilterRequest.Builder<ListConversationsRequest, Builder> { 048 Builder() {} 049 050 @Override 051 public Builder startDate(Instant startDate) { 052 return super.startDate(startDate); 053 } 054 055 @Override 056 public Builder endDate(Instant endDate) { 057 return super.endDate(endDate); 058 } 059 060 /** 061 * Builds the {@linkplain ListConversationsRequest}. 062 * 063 * @return An instance of ListConversationsRequest, populated with all fields from this builder. 064 */ 065 public ListConversationsRequest build() { 066 return new ListConversationsRequest(this); 067 } 068 } 069}