Please wait. This can take some minutes ...
Many resources are needed to download a project. Please understand that we have to compensate our server costs. Thank you in advance.
Project price only 1 $
You can buy this project and download/modify it how often you want.
software.amazon.awssdk.services.ssm.model.OpsItemSummary 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.ssm.model;
import java.io.Serializable;
import java.time.Instant;
import java.util.Arrays;
import java.util.Collections;
import java.util.List;
import java.util.Map;
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.core.traits.MapTrait;
import software.amazon.awssdk.core.util.DefaultSdkAutoConstructMap;
import software.amazon.awssdk.core.util.SdkAutoConstructMap;
import software.amazon.awssdk.utils.CollectionUtils;
import software.amazon.awssdk.utils.ToString;
import software.amazon.awssdk.utils.builder.CopyableBuilder;
import software.amazon.awssdk.utils.builder.ToCopyableBuilder;
/**
*
* A count of OpsItems.
*
*/
@Generated("software.amazon.awssdk:codegen")
public final class OpsItemSummary implements SdkPojo, Serializable, ToCopyableBuilder {
private static final SdkField CREATED_BY_FIELD = SdkField. builder(MarshallingType.STRING)
.memberName("CreatedBy").getter(getter(OpsItemSummary::createdBy)).setter(setter(Builder::createdBy))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("CreatedBy").build()).build();
private static final SdkField CREATED_TIME_FIELD = SdkField. builder(MarshallingType.INSTANT)
.memberName("CreatedTime").getter(getter(OpsItemSummary::createdTime)).setter(setter(Builder::createdTime))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("CreatedTime").build()).build();
private static final SdkField LAST_MODIFIED_BY_FIELD = SdkField. builder(MarshallingType.STRING)
.memberName("LastModifiedBy").getter(getter(OpsItemSummary::lastModifiedBy)).setter(setter(Builder::lastModifiedBy))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("LastModifiedBy").build()).build();
private static final SdkField LAST_MODIFIED_TIME_FIELD = SdkField. builder(MarshallingType.INSTANT)
.memberName("LastModifiedTime").getter(getter(OpsItemSummary::lastModifiedTime))
.setter(setter(Builder::lastModifiedTime))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("LastModifiedTime").build()).build();
private static final SdkField PRIORITY_FIELD = SdkField. builder(MarshallingType.INTEGER)
.memberName("Priority").getter(getter(OpsItemSummary::priority)).setter(setter(Builder::priority))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("Priority").build()).build();
private static final SdkField SOURCE_FIELD = SdkField. builder(MarshallingType.STRING).memberName("Source")
.getter(getter(OpsItemSummary::source)).setter(setter(Builder::source))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("Source").build()).build();
private static final SdkField STATUS_FIELD = SdkField. builder(MarshallingType.STRING).memberName("Status")
.getter(getter(OpsItemSummary::statusAsString)).setter(setter(Builder::status))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("Status").build()).build();
private static final SdkField OPS_ITEM_ID_FIELD = SdkField. builder(MarshallingType.STRING)
.memberName("OpsItemId").getter(getter(OpsItemSummary::opsItemId)).setter(setter(Builder::opsItemId))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("OpsItemId").build()).build();
private static final SdkField TITLE_FIELD = SdkField. builder(MarshallingType.STRING).memberName("Title")
.getter(getter(OpsItemSummary::title)).setter(setter(Builder::title))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("Title").build()).build();
private static final SdkField> OPERATIONAL_DATA_FIELD = SdkField
.> builder(MarshallingType.MAP)
.memberName("OperationalData")
.getter(getter(OpsItemSummary::operationalData))
.setter(setter(Builder::operationalData))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("OperationalData").build(),
MapTrait.builder()
.keyLocationName("key")
.valueLocationName("value")
.valueFieldInfo(
SdkField. builder(MarshallingType.SDK_POJO)
.constructor(OpsItemDataValue::builder)
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD)
.locationName("value").build()).build()).build()).build();
private static final SdkField CATEGORY_FIELD = SdkField. builder(MarshallingType.STRING)
.memberName("Category").getter(getter(OpsItemSummary::category)).setter(setter(Builder::category))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("Category").build()).build();
private static final SdkField SEVERITY_FIELD = SdkField. builder(MarshallingType.STRING)
.memberName("Severity").getter(getter(OpsItemSummary::severity)).setter(setter(Builder::severity))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("Severity").build()).build();
private static final List> SDK_FIELDS = Collections.unmodifiableList(Arrays.asList(CREATED_BY_FIELD,
CREATED_TIME_FIELD, LAST_MODIFIED_BY_FIELD, LAST_MODIFIED_TIME_FIELD, PRIORITY_FIELD, SOURCE_FIELD, STATUS_FIELD,
OPS_ITEM_ID_FIELD, TITLE_FIELD, OPERATIONAL_DATA_FIELD, CATEGORY_FIELD, SEVERITY_FIELD));
private static final long serialVersionUID = 1L;
private final String createdBy;
private final Instant createdTime;
private final String lastModifiedBy;
private final Instant lastModifiedTime;
private final Integer priority;
private final String source;
private final String status;
private final String opsItemId;
private final String title;
private final Map operationalData;
private final String category;
private final String severity;
private OpsItemSummary(BuilderImpl builder) {
this.createdBy = builder.createdBy;
this.createdTime = builder.createdTime;
this.lastModifiedBy = builder.lastModifiedBy;
this.lastModifiedTime = builder.lastModifiedTime;
this.priority = builder.priority;
this.source = builder.source;
this.status = builder.status;
this.opsItemId = builder.opsItemId;
this.title = builder.title;
this.operationalData = builder.operationalData;
this.category = builder.category;
this.severity = builder.severity;
}
/**
*
* The Amazon Resource Name (ARN) of the IAM entity that created the OpsItem.
*
*
* @return The Amazon Resource Name (ARN) of the IAM entity that created the OpsItem.
*/
public String createdBy() {
return createdBy;
}
/**
*
* The date and time the OpsItem was created.
*
*
* @return The date and time the OpsItem was created.
*/
public Instant createdTime() {
return createdTime;
}
/**
*
* The Amazon Resource Name (ARN) of the IAM entity that created the OpsItem.
*
*
* @return The Amazon Resource Name (ARN) of the IAM entity that created the OpsItem.
*/
public String lastModifiedBy() {
return lastModifiedBy;
}
/**
*
* The date and time the OpsItem was last updated.
*
*
* @return The date and time the OpsItem was last updated.
*/
public Instant lastModifiedTime() {
return lastModifiedTime;
}
/**
*
* The importance of this OpsItem in relation to other OpsItems in the system.
*
*
* @return The importance of this OpsItem in relation to other OpsItems in the system.
*/
public Integer priority() {
return priority;
}
/**
*
* The impacted AWS resource.
*
*
* @return The impacted AWS resource.
*/
public String source() {
return source;
}
/**
*
* The OpsItem status. Status can be Open
, In Progress
, or Resolved
.
*
*
* If the service returns an enum value that is not available in the current SDK version, {@link #status} will
* return {@link OpsItemStatus#UNKNOWN_TO_SDK_VERSION}. The raw value returned by the service is available from
* {@link #statusAsString}.
*
*
* @return The OpsItem status. Status can be Open
, In Progress
, or Resolved
.
* @see OpsItemStatus
*/
public OpsItemStatus status() {
return OpsItemStatus.fromValue(status);
}
/**
*
* The OpsItem status. Status can be Open
, In Progress
, or Resolved
.
*
*
* If the service returns an enum value that is not available in the current SDK version, {@link #status} will
* return {@link OpsItemStatus#UNKNOWN_TO_SDK_VERSION}. The raw value returned by the service is available from
* {@link #statusAsString}.
*
*
* @return The OpsItem status. Status can be Open
, In Progress
, or Resolved
.
* @see OpsItemStatus
*/
public String statusAsString() {
return status;
}
/**
*
* The ID of the OpsItem.
*
*
* @return The ID of the OpsItem.
*/
public String opsItemId() {
return opsItemId;
}
/**
*
* A short heading that describes the nature of the OpsItem and the impacted resource.
*
*
* @return A short heading that describes the nature of the OpsItem and the impacted resource.
*/
public String title() {
return title;
}
/**
* Returns true if the OperationalData property was specified by the sender (it may be empty), or false if the
* sender did not specify the value (it will be empty). For responses returned by the SDK, the sender is the AWS
* service.
*/
public boolean hasOperationalData() {
return operationalData != null && !(operationalData instanceof SdkAutoConstructMap);
}
/**
*
* Operational data is custom data that provides useful reference details about the OpsItem.
*
*
* Attempts to modify the collection returned by this method will result in an UnsupportedOperationException.
*
*
* You can use {@link #hasOperationalData()} to see if a value was sent in this field.
*
*
* @return Operational data is custom data that provides useful reference details about the OpsItem.
*/
public Map operationalData() {
return operationalData;
}
/**
*
* A list of OpsItems by category.
*
*
* @return A list of OpsItems by category.
*/
public String category() {
return category;
}
/**
*
* A list of OpsItems by severity.
*
*
* @return A list of OpsItems by severity.
*/
public String severity() {
return severity;
}
@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(createdBy());
hashCode = 31 * hashCode + Objects.hashCode(createdTime());
hashCode = 31 * hashCode + Objects.hashCode(lastModifiedBy());
hashCode = 31 * hashCode + Objects.hashCode(lastModifiedTime());
hashCode = 31 * hashCode + Objects.hashCode(priority());
hashCode = 31 * hashCode + Objects.hashCode(source());
hashCode = 31 * hashCode + Objects.hashCode(statusAsString());
hashCode = 31 * hashCode + Objects.hashCode(opsItemId());
hashCode = 31 * hashCode + Objects.hashCode(title());
hashCode = 31 * hashCode + Objects.hashCode(operationalData());
hashCode = 31 * hashCode + Objects.hashCode(category());
hashCode = 31 * hashCode + Objects.hashCode(severity());
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 OpsItemSummary)) {
return false;
}
OpsItemSummary other = (OpsItemSummary) obj;
return Objects.equals(createdBy(), other.createdBy()) && Objects.equals(createdTime(), other.createdTime())
&& Objects.equals(lastModifiedBy(), other.lastModifiedBy())
&& Objects.equals(lastModifiedTime(), other.lastModifiedTime()) && Objects.equals(priority(), other.priority())
&& Objects.equals(source(), other.source()) && Objects.equals(statusAsString(), other.statusAsString())
&& Objects.equals(opsItemId(), other.opsItemId()) && Objects.equals(title(), other.title())
&& Objects.equals(operationalData(), other.operationalData()) && Objects.equals(category(), other.category())
&& Objects.equals(severity(), other.severity());
}
/**
* 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("OpsItemSummary").add("CreatedBy", createdBy()).add("CreatedTime", createdTime())
.add("LastModifiedBy", lastModifiedBy()).add("LastModifiedTime", lastModifiedTime()).add("Priority", priority())
.add("Source", source()).add("Status", statusAsString()).add("OpsItemId", opsItemId()).add("Title", title())
.add("OperationalData", operationalData()).add("Category", category()).add("Severity", severity()).build();
}
public Optional getValueForField(String fieldName, Class clazz) {
switch (fieldName) {
case "CreatedBy":
return Optional.ofNullable(clazz.cast(createdBy()));
case "CreatedTime":
return Optional.ofNullable(clazz.cast(createdTime()));
case "LastModifiedBy":
return Optional.ofNullable(clazz.cast(lastModifiedBy()));
case "LastModifiedTime":
return Optional.ofNullable(clazz.cast(lastModifiedTime()));
case "Priority":
return Optional.ofNullable(clazz.cast(priority()));
case "Source":
return Optional.ofNullable(clazz.cast(source()));
case "Status":
return Optional.ofNullable(clazz.cast(statusAsString()));
case "OpsItemId":
return Optional.ofNullable(clazz.cast(opsItemId()));
case "Title":
return Optional.ofNullable(clazz.cast(title()));
case "OperationalData":
return Optional.ofNullable(clazz.cast(operationalData()));
case "Category":
return Optional.ofNullable(clazz.cast(category()));
case "Severity":
return Optional.ofNullable(clazz.cast(severity()));
default:
return Optional.empty();
}
}
@Override
public List> sdkFields() {
return SDK_FIELDS;
}
private static Function getter(Function g) {
return obj -> g.apply((OpsItemSummary) obj);
}
private static BiConsumer setter(BiConsumer s) {
return (obj, val) -> s.accept((Builder) obj, val);
}
public interface Builder extends SdkPojo, CopyableBuilder {
/**
*
* The Amazon Resource Name (ARN) of the IAM entity that created the OpsItem.
*
*
* @param createdBy
* The Amazon Resource Name (ARN) of the IAM entity that created the OpsItem.
* @return Returns a reference to this object so that method calls can be chained together.
*/
Builder createdBy(String createdBy);
/**
*
* The date and time the OpsItem was created.
*
*
* @param createdTime
* The date and time the OpsItem was created.
* @return Returns a reference to this object so that method calls can be chained together.
*/
Builder createdTime(Instant createdTime);
/**
*
* The Amazon Resource Name (ARN) of the IAM entity that created the OpsItem.
*
*
* @param lastModifiedBy
* The Amazon Resource Name (ARN) of the IAM entity that created the OpsItem.
* @return Returns a reference to this object so that method calls can be chained together.
*/
Builder lastModifiedBy(String lastModifiedBy);
/**
*
* The date and time the OpsItem was last updated.
*
*
* @param lastModifiedTime
* The date and time the OpsItem was last updated.
* @return Returns a reference to this object so that method calls can be chained together.
*/
Builder lastModifiedTime(Instant lastModifiedTime);
/**
*
* The importance of this OpsItem in relation to other OpsItems in the system.
*
*
* @param priority
* The importance of this OpsItem in relation to other OpsItems in the system.
* @return Returns a reference to this object so that method calls can be chained together.
*/
Builder priority(Integer priority);
/**
*
* The impacted AWS resource.
*
*
* @param source
* The impacted AWS resource.
* @return Returns a reference to this object so that method calls can be chained together.
*/
Builder source(String source);
/**
*
* The OpsItem status. Status can be Open
, In Progress
, or Resolved
.
*
*
* @param status
* The OpsItem status. Status can be Open
, In Progress
, or
* Resolved
.
* @see OpsItemStatus
* @return Returns a reference to this object so that method calls can be chained together.
* @see OpsItemStatus
*/
Builder status(String status);
/**
*
* The OpsItem status. Status can be Open
, In Progress
, or Resolved
.
*
*
* @param status
* The OpsItem status. Status can be Open
, In Progress
, or
* Resolved
.
* @see OpsItemStatus
* @return Returns a reference to this object so that method calls can be chained together.
* @see OpsItemStatus
*/
Builder status(OpsItemStatus status);
/**
*
* The ID of the OpsItem.
*
*
* @param opsItemId
* The ID of the OpsItem.
* @return Returns a reference to this object so that method calls can be chained together.
*/
Builder opsItemId(String opsItemId);
/**
*
* A short heading that describes the nature of the OpsItem and the impacted resource.
*
*
* @param title
* A short heading that describes the nature of the OpsItem and the impacted resource.
* @return Returns a reference to this object so that method calls can be chained together.
*/
Builder title(String title);
/**
*
* Operational data is custom data that provides useful reference details about the OpsItem.
*
*
* @param operationalData
* Operational data is custom data that provides useful reference details about the OpsItem.
* @return Returns a reference to this object so that method calls can be chained together.
*/
Builder operationalData(Map operationalData);
/**
*
* A list of OpsItems by category.
*
*
* @param category
* A list of OpsItems by category.
* @return Returns a reference to this object so that method calls can be chained together.
*/
Builder category(String category);
/**
*
* A list of OpsItems by severity.
*
*
* @param severity
* A list of OpsItems by severity.
* @return Returns a reference to this object so that method calls can be chained together.
*/
Builder severity(String severity);
}
static final class BuilderImpl implements Builder {
private String createdBy;
private Instant createdTime;
private String lastModifiedBy;
private Instant lastModifiedTime;
private Integer priority;
private String source;
private String status;
private String opsItemId;
private String title;
private Map operationalData = DefaultSdkAutoConstructMap.getInstance();
private String category;
private String severity;
private BuilderImpl() {
}
private BuilderImpl(OpsItemSummary model) {
createdBy(model.createdBy);
createdTime(model.createdTime);
lastModifiedBy(model.lastModifiedBy);
lastModifiedTime(model.lastModifiedTime);
priority(model.priority);
source(model.source);
status(model.status);
opsItemId(model.opsItemId);
title(model.title);
operationalData(model.operationalData);
category(model.category);
severity(model.severity);
}
public final String getCreatedBy() {
return createdBy;
}
@Override
public final Builder createdBy(String createdBy) {
this.createdBy = createdBy;
return this;
}
public final void setCreatedBy(String createdBy) {
this.createdBy = createdBy;
}
public final Instant getCreatedTime() {
return createdTime;
}
@Override
public final Builder createdTime(Instant createdTime) {
this.createdTime = createdTime;
return this;
}
public final void setCreatedTime(Instant createdTime) {
this.createdTime = createdTime;
}
public final String getLastModifiedBy() {
return lastModifiedBy;
}
@Override
public final Builder lastModifiedBy(String lastModifiedBy) {
this.lastModifiedBy = lastModifiedBy;
return this;
}
public final void setLastModifiedBy(String lastModifiedBy) {
this.lastModifiedBy = lastModifiedBy;
}
public final Instant getLastModifiedTime() {
return lastModifiedTime;
}
@Override
public final Builder lastModifiedTime(Instant lastModifiedTime) {
this.lastModifiedTime = lastModifiedTime;
return this;
}
public final void setLastModifiedTime(Instant lastModifiedTime) {
this.lastModifiedTime = lastModifiedTime;
}
public final Integer getPriority() {
return priority;
}
@Override
public final Builder priority(Integer priority) {
this.priority = priority;
return this;
}
public final void setPriority(Integer priority) {
this.priority = priority;
}
public final String getSource() {
return source;
}
@Override
public final Builder source(String source) {
this.source = source;
return this;
}
public final void setSource(String source) {
this.source = source;
}
public final String getStatus() {
return status;
}
@Override
public final Builder status(String status) {
this.status = status;
return this;
}
@Override
public final Builder status(OpsItemStatus status) {
this.status(status == null ? null : status.toString());
return this;
}
public final void setStatus(String status) {
this.status = status;
}
public final String getOpsItemId() {
return opsItemId;
}
@Override
public final Builder opsItemId(String opsItemId) {
this.opsItemId = opsItemId;
return this;
}
public final void setOpsItemId(String opsItemId) {
this.opsItemId = opsItemId;
}
public final String getTitle() {
return title;
}
@Override
public final Builder title(String title) {
this.title = title;
return this;
}
public final void setTitle(String title) {
this.title = title;
}
public final Map getOperationalData() {
return operationalData != null ? CollectionUtils.mapValues(operationalData, OpsItemDataValue::toBuilder) : null;
}
@Override
public final Builder operationalData(Map operationalData) {
this.operationalData = OpsItemOperationalDataCopier.copy(operationalData);
return this;
}
public final void setOperationalData(Map operationalData) {
this.operationalData = OpsItemOperationalDataCopier.copyFromBuilder(operationalData);
}
public final String getCategory() {
return category;
}
@Override
public final Builder category(String category) {
this.category = category;
return this;
}
public final void setCategory(String category) {
this.category = category;
}
public final String getSeverity() {
return severity;
}
@Override
public final Builder severity(String severity) {
this.severity = severity;
return this;
}
public final void setSeverity(String severity) {
this.severity = severity;
}
@Override
public OpsItemSummary build() {
return new OpsItemSummary(this);
}
@Override
public List> sdkFields() {
return SDK_FIELDS;
}
}
}