software.amazon.awssdk.services.route53profiles.model.UpdateProfileResourceAssociationRequest Maven / Gradle / Ivy
Show all versions of route53profiles Show documentation
/*
* 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.route53profiles.model;
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.Consumer;
import java.util.function.Function;
import software.amazon.awssdk.annotations.Generated;
import software.amazon.awssdk.awscore.AwsRequestOverrideConfiguration;
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;
/**
*/
@Generated("software.amazon.awssdk:codegen")
public final class UpdateProfileResourceAssociationRequest extends Route53ProfilesRequest implements
ToCopyableBuilder {
private static final SdkField NAME_FIELD = SdkField. builder(MarshallingType.STRING).memberName("Name")
.getter(getter(UpdateProfileResourceAssociationRequest::name)).setter(setter(Builder::name))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("Name").build()).build();
private static final SdkField PROFILE_RESOURCE_ASSOCIATION_ID_FIELD = SdkField
. builder(MarshallingType.STRING).memberName("ProfileResourceAssociationId")
.getter(getter(UpdateProfileResourceAssociationRequest::profileResourceAssociationId))
.setter(setter(Builder::profileResourceAssociationId))
.traits(LocationTrait.builder().location(MarshallLocation.PATH).locationName("ProfileResourceAssociationId").build())
.build();
private static final SdkField RESOURCE_PROPERTIES_FIELD = SdkField. builder(MarshallingType.STRING)
.memberName("ResourceProperties").getter(getter(UpdateProfileResourceAssociationRequest::resourceProperties))
.setter(setter(Builder::resourceProperties))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("ResourceProperties").build())
.build();
private static final List> SDK_FIELDS = Collections.unmodifiableList(Arrays.asList(NAME_FIELD,
PROFILE_RESOURCE_ASSOCIATION_ID_FIELD, RESOURCE_PROPERTIES_FIELD));
private final String name;
private final String profileResourceAssociationId;
private final String resourceProperties;
private UpdateProfileResourceAssociationRequest(BuilderImpl builder) {
super(builder);
this.name = builder.name;
this.profileResourceAssociationId = builder.profileResourceAssociationId;
this.resourceProperties = builder.resourceProperties;
}
/**
*
* Name of the resource association.
*
*
* @return Name of the resource association.
*/
public final String name() {
return name;
}
/**
*
* ID of the resource association.
*
*
* @return ID of the resource association.
*/
public final String profileResourceAssociationId() {
return profileResourceAssociationId;
}
/**
*
* If you are adding a DNS Firewall rule group, include also a priority. The priority indicates the processing order
* for the rule groups, starting with the priority assinged the lowest value.
*
*
* The allowed values for priority are between 100 and 9900.
*
*
* @return If you are adding a DNS Firewall rule group, include also a priority. The priority indicates the
* processing order for the rule groups, starting with the priority assinged the lowest value.
*
* The allowed values for priority are between 100 and 9900.
*/
public final String resourceProperties() {
return resourceProperties;
}
@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 final int hashCode() {
int hashCode = 1;
hashCode = 31 * hashCode + super.hashCode();
hashCode = 31 * hashCode + Objects.hashCode(name());
hashCode = 31 * hashCode + Objects.hashCode(profileResourceAssociationId());
hashCode = 31 * hashCode + Objects.hashCode(resourceProperties());
return hashCode;
}
@Override
public final boolean equals(Object obj) {
return super.equals(obj) && equalsBySdkFields(obj);
}
@Override
public final boolean equalsBySdkFields(Object obj) {
if (this == obj) {
return true;
}
if (obj == null) {
return false;
}
if (!(obj instanceof UpdateProfileResourceAssociationRequest)) {
return false;
}
UpdateProfileResourceAssociationRequest other = (UpdateProfileResourceAssociationRequest) obj;
return Objects.equals(name(), other.name())
&& Objects.equals(profileResourceAssociationId(), other.profileResourceAssociationId())
&& Objects.equals(resourceProperties(), other.resourceProperties());
}
/**
* 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 final String toString() {
return ToString.builder("UpdateProfileResourceAssociationRequest").add("Name", name())
.add("ProfileResourceAssociationId", profileResourceAssociationId())
.add("ResourceProperties", resourceProperties()).build();
}
public final Optional getValueForField(String fieldName, Class clazz) {
switch (fieldName) {
case "Name":
return Optional.ofNullable(clazz.cast(name()));
case "ProfileResourceAssociationId":
return Optional.ofNullable(clazz.cast(profileResourceAssociationId()));
case "ResourceProperties":
return Optional.ofNullable(clazz.cast(resourceProperties()));
default:
return Optional.empty();
}
}
@Override
public final List> sdkFields() {
return SDK_FIELDS;
}
private static Function
*
* The allowed values for priority are between 100 and 9900.
* @return Returns a reference to this object so that method calls can be chained together.
*/
Builder resourceProperties(String resourceProperties);
@Override
Builder overrideConfiguration(AwsRequestOverrideConfiguration overrideConfiguration);
@Override
Builder overrideConfiguration(Consumer builderConsumer);
}
static final class BuilderImpl extends Route53ProfilesRequest.BuilderImpl implements Builder {
private String name;
private String profileResourceAssociationId;
private String resourceProperties;
private BuilderImpl() {
}
private BuilderImpl(UpdateProfileResourceAssociationRequest model) {
super(model);
name(model.name);
profileResourceAssociationId(model.profileResourceAssociationId);
resourceProperties(model.resourceProperties);
}
public final String getName() {
return name;
}
public final void setName(String name) {
this.name = name;
}
@Override
public final Builder name(String name) {
this.name = name;
return this;
}
public final String getProfileResourceAssociationId() {
return profileResourceAssociationId;
}
public final void setProfileResourceAssociationId(String profileResourceAssociationId) {
this.profileResourceAssociationId = profileResourceAssociationId;
}
@Override
public final Builder profileResourceAssociationId(String profileResourceAssociationId) {
this.profileResourceAssociationId = profileResourceAssociationId;
return this;
}
public final String getResourceProperties() {
return resourceProperties;
}
public final void setResourceProperties(String resourceProperties) {
this.resourceProperties = resourceProperties;
}
@Override
public final Builder resourceProperties(String resourceProperties) {
this.resourceProperties = resourceProperties;
return this;
}
@Override
public Builder overrideConfiguration(AwsRequestOverrideConfiguration overrideConfiguration) {
super.overrideConfiguration(overrideConfiguration);
return this;
}
@Override
public Builder overrideConfiguration(Consumer builderConsumer) {
super.overrideConfiguration(builderConsumer);
return this;
}
@Override
public UpdateProfileResourceAssociationRequest build() {
return new UpdateProfileResourceAssociationRequest(this);
}
@Override
public List> sdkFields() {
return SDK_FIELDS;
}
}
}