
software.amazon.awssdk.services.amplify.model.Webhook Maven / Gradle / Ivy
/*
* Copyright 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.amplify.model;
import java.io.Serializable;
import java.time.Instant;
import java.util.Arrays;
import java.util.Collections;
import java.util.List;
import java.util.Objects;
import java.util.Optional;
import java.util.function.BiConsumer;
import java.util.function.Function;
import software.amazon.awssdk.annotations.Generated;
import software.amazon.awssdk.core.SdkField;
import software.amazon.awssdk.core.SdkPojo;
import software.amazon.awssdk.core.protocol.MarshallLocation;
import software.amazon.awssdk.core.protocol.MarshallingType;
import software.amazon.awssdk.core.traits.LocationTrait;
import software.amazon.awssdk.utils.ToString;
import software.amazon.awssdk.utils.builder.CopyableBuilder;
import software.amazon.awssdk.utils.builder.ToCopyableBuilder;
/**
*
* Structure for webhook, which associates a webhook with an Amplify App.
*
*/
@Generated("software.amazon.awssdk:codegen")
public final class Webhook implements SdkPojo, Serializable, ToCopyableBuilder {
private static final SdkField WEBHOOK_ARN_FIELD = SdkField. builder(MarshallingType.STRING)
.getter(getter(Webhook::webhookArn)).setter(setter(Builder::webhookArn))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("webhookArn").build()).build();
private static final SdkField WEBHOOK_ID_FIELD = SdkField. builder(MarshallingType.STRING)
.getter(getter(Webhook::webhookId)).setter(setter(Builder::webhookId))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("webhookId").build()).build();
private static final SdkField WEBHOOK_URL_FIELD = SdkField. builder(MarshallingType.STRING)
.getter(getter(Webhook::webhookUrl)).setter(setter(Builder::webhookUrl))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("webhookUrl").build()).build();
private static final SdkField BRANCH_NAME_FIELD = SdkField. builder(MarshallingType.STRING)
.getter(getter(Webhook::branchName)).setter(setter(Builder::branchName))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("branchName").build()).build();
private static final SdkField DESCRIPTION_FIELD = SdkField. builder(MarshallingType.STRING)
.getter(getter(Webhook::description)).setter(setter(Builder::description))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("description").build()).build();
private static final SdkField CREATE_TIME_FIELD = SdkField. builder(MarshallingType.INSTANT)
.getter(getter(Webhook::createTime)).setter(setter(Builder::createTime))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("createTime").build()).build();
private static final SdkField UPDATE_TIME_FIELD = SdkField. builder(MarshallingType.INSTANT)
.getter(getter(Webhook::updateTime)).setter(setter(Builder::updateTime))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("updateTime").build()).build();
private static final List> SDK_FIELDS = Collections.unmodifiableList(Arrays.asList(WEBHOOK_ARN_FIELD,
WEBHOOK_ID_FIELD, WEBHOOK_URL_FIELD, BRANCH_NAME_FIELD, DESCRIPTION_FIELD, CREATE_TIME_FIELD, UPDATE_TIME_FIELD));
private static final long serialVersionUID = 1L;
private final String webhookArn;
private final String webhookId;
private final String webhookUrl;
private final String branchName;
private final String description;
private final Instant createTime;
private final Instant updateTime;
private Webhook(BuilderImpl builder) {
this.webhookArn = builder.webhookArn;
this.webhookId = builder.webhookId;
this.webhookUrl = builder.webhookUrl;
this.branchName = builder.branchName;
this.description = builder.description;
this.createTime = builder.createTime;
this.updateTime = builder.updateTime;
}
/**
*
* ARN for the webhook.
*
*
* @return ARN for the webhook.
*/
public String webhookArn() {
return webhookArn;
}
/**
*
* Id of the webhook.
*
*
* @return Id of the webhook.
*/
public String webhookId() {
return webhookId;
}
/**
*
* Url of the webhook.
*
*
* @return Url of the webhook.
*/
public String webhookUrl() {
return webhookUrl;
}
/**
*
* Name for a branch, part of an Amplify App.
*
*
* @return Name for a branch, part of an Amplify App.
*/
public String branchName() {
return branchName;
}
/**
*
* Description for a webhook.
*
*
* @return Description for a webhook.
*/
public String description() {
return description;
}
/**
*
* Create date / time for a webhook.
*
*
* @return Create date / time for a webhook.
*/
public Instant createTime() {
return createTime;
}
/**
*
* Update date / time for a webhook.
*
*
* @return Update date / time for a webhook.
*/
public Instant updateTime() {
return updateTime;
}
@Override
public Builder toBuilder() {
return new BuilderImpl(this);
}
public static Builder builder() {
return new BuilderImpl();
}
public static Class extends Builder> serializableBuilderClass() {
return BuilderImpl.class;
}
@Override
public int hashCode() {
int hashCode = 1;
hashCode = 31 * hashCode + Objects.hashCode(webhookArn());
hashCode = 31 * hashCode + Objects.hashCode(webhookId());
hashCode = 31 * hashCode + Objects.hashCode(webhookUrl());
hashCode = 31 * hashCode + Objects.hashCode(branchName());
hashCode = 31 * hashCode + Objects.hashCode(description());
hashCode = 31 * hashCode + Objects.hashCode(createTime());
hashCode = 31 * hashCode + Objects.hashCode(updateTime());
return hashCode;
}
@Override
public boolean equals(Object obj) {
return equalsBySdkFields(obj);
}
@Override
public boolean equalsBySdkFields(Object obj) {
if (this == obj) {
return true;
}
if (obj == null) {
return false;
}
if (!(obj instanceof Webhook)) {
return false;
}
Webhook other = (Webhook) obj;
return Objects.equals(webhookArn(), other.webhookArn()) && Objects.equals(webhookId(), other.webhookId())
&& Objects.equals(webhookUrl(), other.webhookUrl()) && Objects.equals(branchName(), other.branchName())
&& Objects.equals(description(), other.description()) && Objects.equals(createTime(), other.createTime())
&& Objects.equals(updateTime(), other.updateTime());
}
/**
* Returns a string representation of this object. This is useful for testing and debugging. Sensitive data will be
* redacted from this string using a placeholder value.
*/
@Override
public String toString() {
return ToString.builder("Webhook").add("WebhookArn", webhookArn()).add("WebhookId", webhookId())
.add("WebhookUrl", webhookUrl()).add("BranchName", branchName()).add("Description", description())
.add("CreateTime", createTime()).add("UpdateTime", updateTime()).build();
}
public Optional getValueForField(String fieldName, Class clazz) {
switch (fieldName) {
case "webhookArn":
return Optional.ofNullable(clazz.cast(webhookArn()));
case "webhookId":
return Optional.ofNullable(clazz.cast(webhookId()));
case "webhookUrl":
return Optional.ofNullable(clazz.cast(webhookUrl()));
case "branchName":
return Optional.ofNullable(clazz.cast(branchName()));
case "description":
return Optional.ofNullable(clazz.cast(description()));
case "createTime":
return Optional.ofNullable(clazz.cast(createTime()));
case "updateTime":
return Optional.ofNullable(clazz.cast(updateTime()));
default:
return Optional.empty();
}
}
@Override
public List> sdkFields() {
return SDK_FIELDS;
}
private static Function
© 2015 - 2025 Weber Informatics LLC | Privacy Policy