View Javadoc
1   /*
2    * Licensed to the Apache Software Foundation (ASF) under one
3    * or more contributor license agreements.  See the NOTICE file
4    * distributed with this work for additional information
5    * regarding copyright ownership.  The ASF licenses this file
6    * to you under the Apache License, Version 2.0 (the
7    * "License"); you may not use this file except in compliance
8    * with the License.  You may obtain a copy of the License at
9    *
10   *   http://www.apache.org/licenses/LICENSE-2.0
11   *
12   * Unless required by applicable law or agreed to in writing,
13   * software distributed under the License is distributed on an
14   * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
15   * KIND, either express or implied.  See the License for the
16   * specific language governing permissions and limitations
17   * under the License.
18   */
19  package org.apache.syncope.common.rest.api.beans;
20  
21  import io.swagger.v3.oas.annotations.Parameter;
22  import io.swagger.v3.oas.annotations.enums.ParameterIn;
23  import io.swagger.v3.oas.annotations.media.Schema;
24  import java.time.OffsetDateTime;
25  import javax.ws.rs.QueryParam;
26  
27  public class MfaTrustedDeviceQuery extends AbstractQuery {
28  
29      private static final long serialVersionUID = -7381828286332101171L;
30  
31      public static class Builder extends AbstractQuery.Builder<MfaTrustedDeviceQuery, MfaTrustedDeviceQuery.Builder> {
32  
33          @Override
34          protected MfaTrustedDeviceQuery newInstance() {
35              return new MfaTrustedDeviceQuery();
36          }
37  
38          public MfaTrustedDeviceQuery.Builder id(final Long id) {
39              getInstance().setId(id);
40              return this;
41          }
42  
43          public MfaTrustedDeviceQuery.Builder recordKey(final String recordKey) {
44              getInstance().setRecordKey(recordKey);
45              return this;
46          }
47  
48          public MfaTrustedDeviceQuery.Builder principal(final String principal) {
49              getInstance().setPrincipal(principal);
50              return this;
51          }
52  
53          public MfaTrustedDeviceQuery.Builder expirationDate(final OffsetDateTime date) {
54              getInstance().setExpirationDate(date);
55              return this;
56          }
57  
58          public MfaTrustedDeviceQuery.Builder recordDate(final OffsetDateTime date) {
59              getInstance().setRecordDate(date);
60              return this;
61          }
62      }
63  
64      private Long id;
65  
66      private String recordKey;
67  
68      private OffsetDateTime expirationDate;
69  
70      private OffsetDateTime recordDate;
71  
72      private String principal;
73  
74      @Parameter(name = "id", in = ParameterIn.QUERY, schema =
75              @Schema(implementation = Long.class))
76      public Long getId() {
77          return id;
78      }
79  
80      @QueryParam("id")
81      public void setId(final Long id) {
82          this.id = id;
83      }
84  
85      @Parameter(name = "recordKey", in = ParameterIn.QUERY, schema =
86              @Schema(implementation = String.class))
87      public String getRecordKey() {
88          return recordKey;
89      }
90  
91      @QueryParam("recordKey")
92      public void setRecordKey(final String recordKey) {
93          this.recordKey = recordKey;
94      }
95  
96      @Parameter(name = "expirationDate", in = ParameterIn.QUERY, schema =
97              @Schema(implementation = OffsetDateTime.class))
98      public OffsetDateTime getExpirationDate() {
99          return expirationDate;
100     }
101 
102     @QueryParam("expirationDate")
103     public void setExpirationDate(final OffsetDateTime expirationDate) {
104         this.expirationDate = expirationDate;
105     }
106 
107     @Parameter(name = "recordDate", in = ParameterIn.QUERY, schema =
108             @Schema(implementation = OffsetDateTime.class))
109     public OffsetDateTime getRecordDate() {
110         return recordDate;
111     }
112 
113     @QueryParam("recordDate")
114     public void setRecordDate(final OffsetDateTime recordDate) {
115         this.recordDate = recordDate;
116     }
117 
118     @Parameter(name = "principal", in = ParameterIn.QUERY, schema =
119             @Schema(implementation = String.class))
120     public String getPrincipal() {
121         return principal;
122     }
123 
124     @QueryParam("principal")
125     public void setPrincipal(final String principal) {
126         this.principal = principal;
127     }
128 }