software.amazon.awssdk.services.apigateway.model.UpdateClientCertificateResponse Maven / Gradle / Ivy
Show all versions of api-gateway Show documentation
/*
* Copyright 2013-2018 Amazon.com, Inc. or its affiliates. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License"). You may not use this file except in compliance with
* the License. A copy of the License is located at
*
* http://aws.amazon.com/apache2.0
*
* or in the "license" file accompanying this file. This file is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR
* CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions
* and limitations under the License.
*/
package software.amazon.awssdk.services.apigateway.model;
import java.time.Instant;
import java.util.Objects;
import java.util.Optional;
import javax.annotation.Generated;
import software.amazon.awssdk.utils.ToString;
import software.amazon.awssdk.utils.builder.CopyableBuilder;
import software.amazon.awssdk.utils.builder.ToCopyableBuilder;
/**
*
* Represents a client certificate used to configure client-side SSL authentication while sending requests to the
* integration endpoint.
*
* Client certificates are used to authenticate an API by the backend server. To authenticate an
* API client (or user), use IAM roles and policies, a custom Authorizer or an Amazon Cognito user pool.
*
*/
@Generated("software.amazon.awssdk:codegen")
public class UpdateClientCertificateResponse extends APIGatewayResponse implements
ToCopyableBuilder {
private final String clientCertificateId;
private final String description;
private final String pemEncodedCertificate;
private final Instant createdDate;
private final Instant expirationDate;
private UpdateClientCertificateResponse(BuilderImpl builder) {
super(builder);
this.clientCertificateId = builder.clientCertificateId;
this.description = builder.description;
this.pemEncodedCertificate = builder.pemEncodedCertificate;
this.createdDate = builder.createdDate;
this.expirationDate = builder.expirationDate;
}
/**
*
* The identifier of the client certificate.
*
*
* @return The identifier of the client certificate.
*/
public String clientCertificateId() {
return clientCertificateId;
}
/**
*
* The description of the client certificate.
*
*
* @return The description of the client certificate.
*/
public String description() {
return description;
}
/**
*
* The PEM-encoded public key of the client certificate, which can be used to configure certificate authentication
* in the integration endpoint .
*
*
* @return The PEM-encoded public key of the client certificate, which can be used to configure certificate
* authentication in the integration endpoint .
*/
public String pemEncodedCertificate() {
return pemEncodedCertificate;
}
/**
*
* The timestamp when the client certificate was created.
*
*
* @return The timestamp when the client certificate was created.
*/
public Instant createdDate() {
return createdDate;
}
/**
*
* The timestamp when the client certificate will expire.
*
*
* @return The timestamp when the client certificate will expire.
*/
public Instant expirationDate() {
return expirationDate;
}
@Override
public Builder toBuilder() {
return new BuilderImpl(this);
}
public static Builder builder() {
return new BuilderImpl();
}
public static Class serializableBuilderClass() {
return BuilderImpl.class;
}
@Override
public int hashCode() {
int hashCode = 1;
hashCode = 31 * hashCode + Objects.hashCode(clientCertificateId());
hashCode = 31 * hashCode + Objects.hashCode(description());
hashCode = 31 * hashCode + Objects.hashCode(pemEncodedCertificate());
hashCode = 31 * hashCode + Objects.hashCode(createdDate());
hashCode = 31 * hashCode + Objects.hashCode(expirationDate());
return hashCode;
}
@Override
public boolean equals(Object obj) {
if (this == obj) {
return true;
}
if (obj == null) {
return false;
}
if (!(obj instanceof UpdateClientCertificateResponse)) {
return false;
}
UpdateClientCertificateResponse other = (UpdateClientCertificateResponse) obj;
return Objects.equals(clientCertificateId(), other.clientCertificateId())
&& Objects.equals(description(), other.description())
&& Objects.equals(pemEncodedCertificate(), other.pemEncodedCertificate())
&& Objects.equals(createdDate(), other.createdDate()) && Objects.equals(expirationDate(), other.expirationDate());
}
@Override
public String toString() {
return ToString.builder("UpdateClientCertificateResponse").add("ClientCertificateId", clientCertificateId())
.add("Description", description()).add("PemEncodedCertificate", pemEncodedCertificate())
.add("CreatedDate", createdDate()).add("ExpirationDate", expirationDate()).build();
}
public Optional getValueForField(String fieldName, Class clazz) {
switch (fieldName) {
case "clientCertificateId":
return Optional.of(clazz.cast(clientCertificateId()));
case "description":
return Optional.of(clazz.cast(description()));
case "pemEncodedCertificate":
return Optional.of(clazz.cast(pemEncodedCertificate()));
case "createdDate":
return Optional.of(clazz.cast(createdDate()));
case "expirationDate":
return Optional.of(clazz.cast(expirationDate()));
default:
return Optional.empty();
}
}
public interface Builder extends APIGatewayResponse.Builder, CopyableBuilder {
/**
*
* The identifier of the client certificate.
*
*
* @param clientCertificateId
* The identifier of the client certificate.
* @return Returns a reference to this object so that method calls can be chained together.
*/
Builder clientCertificateId(String clientCertificateId);
/**
*
* The description of the client certificate.
*
*
* @param description
* The description of the client certificate.
* @return Returns a reference to this object so that method calls can be chained together.
*/
Builder description(String description);
/**
*
* The PEM-encoded public key of the client certificate, which can be used to configure certificate
* authentication in the integration endpoint .
*
*
* @param pemEncodedCertificate
* The PEM-encoded public key of the client certificate, which can be used to configure certificate
* authentication in the integration endpoint .
* @return Returns a reference to this object so that method calls can be chained together.
*/
Builder pemEncodedCertificate(String pemEncodedCertificate);
/**
*
* The timestamp when the client certificate was created.
*
*
* @param createdDate
* The timestamp when the client certificate was created.
* @return Returns a reference to this object so that method calls can be chained together.
*/
Builder createdDate(Instant createdDate);
/**
*
* The timestamp when the client certificate will expire.
*
*
* @param expirationDate
* The timestamp when the client certificate will expire.
* @return Returns a reference to this object so that method calls can be chained together.
*/
Builder expirationDate(Instant expirationDate);
}
static final class BuilderImpl extends APIGatewayResponse.BuilderImpl implements Builder {
private String clientCertificateId;
private String description;
private String pemEncodedCertificate;
private Instant createdDate;
private Instant expirationDate;
private BuilderImpl() {
}
private BuilderImpl(UpdateClientCertificateResponse model) {
clientCertificateId(model.clientCertificateId);
description(model.description);
pemEncodedCertificate(model.pemEncodedCertificate);
createdDate(model.createdDate);
expirationDate(model.expirationDate);
}
public final String getClientCertificateId() {
return clientCertificateId;
}
@Override
public final Builder clientCertificateId(String clientCertificateId) {
this.clientCertificateId = clientCertificateId;
return this;
}
public final void setClientCertificateId(String clientCertificateId) {
this.clientCertificateId = clientCertificateId;
}
public final String getDescription() {
return description;
}
@Override
public final Builder description(String description) {
this.description = description;
return this;
}
public final void setDescription(String description) {
this.description = description;
}
public final String getPemEncodedCertificate() {
return pemEncodedCertificate;
}
@Override
public final Builder pemEncodedCertificate(String pemEncodedCertificate) {
this.pemEncodedCertificate = pemEncodedCertificate;
return this;
}
public final void setPemEncodedCertificate(String pemEncodedCertificate) {
this.pemEncodedCertificate = pemEncodedCertificate;
}
public final Instant getCreatedDate() {
return createdDate;
}
@Override
public final Builder createdDate(Instant createdDate) {
this.createdDate = createdDate;
return this;
}
public final void setCreatedDate(Instant createdDate) {
this.createdDate = createdDate;
}
public final Instant getExpirationDate() {
return expirationDate;
}
@Override
public final Builder expirationDate(Instant expirationDate) {
this.expirationDate = expirationDate;
return this;
}
public final void setExpirationDate(Instant expirationDate) {
this.expirationDate = expirationDate;
}
@Override
public UpdateClientCertificateResponse build() {
return new UpdateClientCertificateResponse(this);
}
}
}