software.amazon.awssdk.services.guardduty.model.KubernetesRoleBindingDetails Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of guardduty Show documentation
Show all versions of guardduty Show documentation
The AWS Java SDK for Amazon GuardDuty module holds the client classes that are used for communicating
with Amazon GuardDuty Service
/*
* 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.guardduty.model;
import java.io.Serializable;
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;
/**
*
* Contains information about the role binding that grants the permission defined in a Kubernetes role.
*
*/
@Generated("software.amazon.awssdk:codegen")
public final class KubernetesRoleBindingDetails implements SdkPojo, Serializable,
ToCopyableBuilder {
private static final SdkField KIND_FIELD = SdkField. builder(MarshallingType.STRING).memberName("Kind")
.getter(getter(KubernetesRoleBindingDetails::kind)).setter(setter(Builder::kind))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("kind").build()).build();
private static final SdkField NAME_FIELD = SdkField. builder(MarshallingType.STRING).memberName("Name")
.getter(getter(KubernetesRoleBindingDetails::name)).setter(setter(Builder::name))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("name").build()).build();
private static final SdkField UID_FIELD = SdkField. builder(MarshallingType.STRING).memberName("Uid")
.getter(getter(KubernetesRoleBindingDetails::uid)).setter(setter(Builder::uid))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("uid").build()).build();
private static final SdkField ROLE_REF_NAME_FIELD = SdkField. builder(MarshallingType.STRING)
.memberName("RoleRefName").getter(getter(KubernetesRoleBindingDetails::roleRefName))
.setter(setter(Builder::roleRefName))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("roleRefName").build()).build();
private static final SdkField ROLE_REF_KIND_FIELD = SdkField. builder(MarshallingType.STRING)
.memberName("RoleRefKind").getter(getter(KubernetesRoleBindingDetails::roleRefKind))
.setter(setter(Builder::roleRefKind))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("roleRefKind").build()).build();
private static final List> SDK_FIELDS = Collections.unmodifiableList(Arrays.asList(KIND_FIELD, NAME_FIELD,
UID_FIELD, ROLE_REF_NAME_FIELD, ROLE_REF_KIND_FIELD));
private static final long serialVersionUID = 1L;
private final String kind;
private final String name;
private final String uid;
private final String roleRefName;
private final String roleRefKind;
private KubernetesRoleBindingDetails(BuilderImpl builder) {
this.kind = builder.kind;
this.name = builder.name;
this.uid = builder.uid;
this.roleRefName = builder.roleRefName;
this.roleRefKind = builder.roleRefKind;
}
/**
*
* The kind of the role. For role binding, this value will be RoleBinding
.
*
*
* @return The kind of the role. For role binding, this value will be RoleBinding
.
*/
public final String kind() {
return kind;
}
/**
*
* The name of the RoleBinding
.
*
*
* @return The name of the RoleBinding
.
*/
public final String name() {
return name;
}
/**
*
* The unique identifier of the role binding.
*
*
* @return The unique identifier of the role binding.
*/
public final String uid() {
return uid;
}
/**
*
* The name of the role being referenced. This must match the name of the Role
or
* ClusterRole
that you want to bind to.
*
*
* @return The name of the role being referenced. This must match the name of the Role
or
* ClusterRole
that you want to bind to.
*/
public final String roleRefName() {
return roleRefName;
}
/**
*
* The type of the role being referenced. This could be either Role
or ClusterRole
.
*
*
* @return The type of the role being referenced. This could be either Role
or ClusterRole
* .
*/
public final String roleRefKind() {
return roleRefKind;
}
@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 + Objects.hashCode(kind());
hashCode = 31 * hashCode + Objects.hashCode(name());
hashCode = 31 * hashCode + Objects.hashCode(uid());
hashCode = 31 * hashCode + Objects.hashCode(roleRefName());
hashCode = 31 * hashCode + Objects.hashCode(roleRefKind());
return hashCode;
}
@Override
public final boolean equals(Object obj) {
return equalsBySdkFields(obj);
}
@Override
public final boolean equalsBySdkFields(Object obj) {
if (this == obj) {
return true;
}
if (obj == null) {
return false;
}
if (!(obj instanceof KubernetesRoleBindingDetails)) {
return false;
}
KubernetesRoleBindingDetails other = (KubernetesRoleBindingDetails) obj;
return Objects.equals(kind(), other.kind()) && Objects.equals(name(), other.name()) && Objects.equals(uid(), other.uid())
&& Objects.equals(roleRefName(), other.roleRefName()) && Objects.equals(roleRefKind(), other.roleRefKind());
}
/**
* 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("KubernetesRoleBindingDetails").add("Kind", kind()).add("Name", name()).add("Uid", uid())
.add("RoleRefName", roleRefName()).add("RoleRefKind", roleRefKind()).build();
}
public final Optional getValueForField(String fieldName, Class clazz) {
switch (fieldName) {
case "Kind":
return Optional.ofNullable(clazz.cast(kind()));
case "Name":
return Optional.ofNullable(clazz.cast(name()));
case "Uid":
return Optional.ofNullable(clazz.cast(uid()));
case "RoleRefName":
return Optional.ofNullable(clazz.cast(roleRefName()));
case "RoleRefKind":
return Optional.ofNullable(clazz.cast(roleRefKind()));
default:
return Optional.empty();
}
}
@Override
public final List> sdkFields() {
return SDK_FIELDS;
}
private static Function
© 2015 - 2025 Weber Informatics LLC | Privacy Policy