All Downloads are FREE. Search and download functionalities are using the official Maven repository.

software.amazon.awssdk.services.health.model.OrganizationEventDetailsErrorItem Maven / Gradle / Ivy

Go to download

The AWS Java SDK for AWS Health APIs and Notifications module holds the client classes that are used for communicating with AWS Health APIs and Notifications service.

The newest version!
/*
 * 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.health.model;

import java.io.Serializable;
import java.util.Arrays;
import java.util.Collections;
import java.util.HashMap;
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.utils.ToString;
import software.amazon.awssdk.utils.builder.CopyableBuilder;
import software.amazon.awssdk.utils.builder.ToCopyableBuilder;

/**
 * 

* Error information returned when a DescribeEventDetailsForOrganization operation can't find a specified event. *

*/ @Generated("software.amazon.awssdk:codegen") public final class OrganizationEventDetailsErrorItem implements SdkPojo, Serializable, ToCopyableBuilder { private static final SdkField AWS_ACCOUNT_ID_FIELD = SdkField. builder(MarshallingType.STRING) .memberName("awsAccountId").getter(getter(OrganizationEventDetailsErrorItem::awsAccountId)) .setter(setter(Builder::awsAccountId)) .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("awsAccountId").build()).build(); private static final SdkField EVENT_ARN_FIELD = SdkField. builder(MarshallingType.STRING) .memberName("eventArn").getter(getter(OrganizationEventDetailsErrorItem::eventArn)).setter(setter(Builder::eventArn)) .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("eventArn").build()).build(); private static final SdkField ERROR_NAME_FIELD = SdkField. builder(MarshallingType.STRING) .memberName("errorName").getter(getter(OrganizationEventDetailsErrorItem::errorName)) .setter(setter(Builder::errorName)) .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("errorName").build()).build(); private static final SdkField ERROR_MESSAGE_FIELD = SdkField. builder(MarshallingType.STRING) .memberName("errorMessage").getter(getter(OrganizationEventDetailsErrorItem::errorMessage)) .setter(setter(Builder::errorMessage)) .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("errorMessage").build()).build(); private static final List> SDK_FIELDS = Collections.unmodifiableList(Arrays.asList(AWS_ACCOUNT_ID_FIELD, EVENT_ARN_FIELD, ERROR_NAME_FIELD, ERROR_MESSAGE_FIELD)); private static final Map> SDK_NAME_TO_FIELD = Collections .unmodifiableMap(new HashMap>() { { put("awsAccountId", AWS_ACCOUNT_ID_FIELD); put("eventArn", EVENT_ARN_FIELD); put("errorName", ERROR_NAME_FIELD); put("errorMessage", ERROR_MESSAGE_FIELD); } }); private static final long serialVersionUID = 1L; private final String awsAccountId; private final String eventArn; private final String errorName; private final String errorMessage; private OrganizationEventDetailsErrorItem(BuilderImpl builder) { this.awsAccountId = builder.awsAccountId; this.eventArn = builder.eventArn; this.errorName = builder.errorName; this.errorMessage = builder.errorMessage; } /** *

* Error information returned when a DescribeEventDetailsForOrganization operation can't find a specified event. *

* * @return Error information returned when a DescribeEventDetailsForOrganization operation can't find a specified event. */ public final String awsAccountId() { return awsAccountId; } /** *

* The unique identifier for the event. The event ARN has the * arn:aws:health:event-region::event/SERVICE/EVENT_TYPE_CODE/EVENT_TYPE_PLUS_ID * format. *

*

* For example, an event ARN might look like the following: *

*

* arn:aws:health:us-east-1::event/EC2/EC2_INSTANCE_RETIREMENT_SCHEDULED/EC2_INSTANCE_RETIREMENT_SCHEDULED_ABC123-DEF456 *

* * @return The unique identifier for the event. The event ARN has the * arn:aws:health:event-region::event/SERVICE/EVENT_TYPE_CODE/EVENT_TYPE_PLUS_ID * format.

*

* For example, an event ARN might look like the following: *

*

* arn:aws:health:us-east-1::event/EC2/EC2_INSTANCE_RETIREMENT_SCHEDULED/EC2_INSTANCE_RETIREMENT_SCHEDULED_ABC123-DEF456 */ public final String eventArn() { return eventArn; } /** *

* The name of the error. *

* * @return The name of the error. */ public final String errorName() { return errorName; } /** *

* A message that describes the error. *

*

* If you call the DescribeEventDetailsForOrganization operation and receive one of the following * errors, follow the recommendations in the message: *

*
    *
  • *

    * We couldn't find a public event that matches your request. To find an event that is account specific, you must * enter an Amazon Web Services account ID in the request. *

    *
  • *
  • *

    * We couldn't find an account specific event for the specified Amazon Web Services account. To find an event that * is public, you must enter a null value for the Amazon Web Services account ID in the request. *

    *
  • *
  • *

    * Your Amazon Web Services account doesn't include the Amazon Web Services Support plan required to use the Health * API. You must have either a Business, Enterprise On-Ramp, or Enterprise Support plan. *

    *
  • *
* * @return A message that describes the error.

*

* If you call the DescribeEventDetailsForOrganization operation and receive one of the * following errors, follow the recommendations in the message: *

*
    *
  • *

    * We couldn't find a public event that matches your request. To find an event that is account specific, you * must enter an Amazon Web Services account ID in the request. *

    *
  • *
  • *

    * We couldn't find an account specific event for the specified Amazon Web Services account. To find an * event that is public, you must enter a null value for the Amazon Web Services account ID in the request. *

    *
  • *
  • *

    * Your Amazon Web Services account doesn't include the Amazon Web Services Support plan required to use the * Health API. You must have either a Business, Enterprise On-Ramp, or Enterprise Support plan. *

    *
  • */ public final String errorMessage() { return errorMessage; } @Override public Builder toBuilder() { return new BuilderImpl(this); } public static Builder builder() { return new BuilderImpl(); } public static Class serializableBuilderClass() { return BuilderImpl.class; } @Override public final int hashCode() { int hashCode = 1; hashCode = 31 * hashCode + Objects.hashCode(awsAccountId()); hashCode = 31 * hashCode + Objects.hashCode(eventArn()); hashCode = 31 * hashCode + Objects.hashCode(errorName()); hashCode = 31 * hashCode + Objects.hashCode(errorMessage()); 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 OrganizationEventDetailsErrorItem)) { return false; } OrganizationEventDetailsErrorItem other = (OrganizationEventDetailsErrorItem) obj; return Objects.equals(awsAccountId(), other.awsAccountId()) && Objects.equals(eventArn(), other.eventArn()) && Objects.equals(errorName(), other.errorName()) && Objects.equals(errorMessage(), other.errorMessage()); } /** * 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("OrganizationEventDetailsErrorItem").add("AwsAccountId", awsAccountId()) .add("EventArn", eventArn()).add("ErrorName", errorName()).add("ErrorMessage", errorMessage()).build(); } public final Optional getValueForField(String fieldName, Class clazz) { switch (fieldName) { case "awsAccountId": return Optional.ofNullable(clazz.cast(awsAccountId())); case "eventArn": return Optional.ofNullable(clazz.cast(eventArn())); case "errorName": return Optional.ofNullable(clazz.cast(errorName())); case "errorMessage": return Optional.ofNullable(clazz.cast(errorMessage())); default: return Optional.empty(); } } @Override public final List> sdkFields() { return SDK_FIELDS; } @Override public final Map> sdkFieldNameToField() { return SDK_NAME_TO_FIELD; } private static Function getter(Function g) { return obj -> g.apply((OrganizationEventDetailsErrorItem) obj); } private static BiConsumer setter(BiConsumer s) { return (obj, val) -> s.accept((Builder) obj, val); } public interface Builder extends SdkPojo, CopyableBuilder { /** *

    * Error information returned when a DescribeEventDetailsForOrganization operation can't find a specified event. *

    * * @param awsAccountId * Error information returned when a DescribeEventDetailsForOrganization operation can't find a specified event. * @return Returns a reference to this object so that method calls can be chained together. */ Builder awsAccountId(String awsAccountId); /** *

    * The unique identifier for the event. The event ARN has the * arn:aws:health:event-region::event/SERVICE/EVENT_TYPE_CODE/EVENT_TYPE_PLUS_ID * format. *

    *

    * For example, an event ARN might look like the following: *

    *

    * arn:aws:health:us-east-1::event/EC2/EC2_INSTANCE_RETIREMENT_SCHEDULED/EC2_INSTANCE_RETIREMENT_SCHEDULED_ABC123-DEF456 *

    * * @param eventArn * The unique identifier for the event. The event ARN has the * arn:aws:health:event-region::event/SERVICE/EVENT_TYPE_CODE/EVENT_TYPE_PLUS_ID * format.

    *

    * For example, an event ARN might look like the following: *

    *

    * arn:aws:health:us-east-1::event/EC2/EC2_INSTANCE_RETIREMENT_SCHEDULED/EC2_INSTANCE_RETIREMENT_SCHEDULED_ABC123-DEF456 * @return Returns a reference to this object so that method calls can be chained together. */ Builder eventArn(String eventArn); /** *

    * The name of the error. *

    * * @param errorName * The name of the error. * @return Returns a reference to this object so that method calls can be chained together. */ Builder errorName(String errorName); /** *

    * A message that describes the error. *

    *

    * If you call the DescribeEventDetailsForOrganization operation and receive one of the following * errors, follow the recommendations in the message: *

    *
      *
    • *

      * We couldn't find a public event that matches your request. To find an event that is account specific, you * must enter an Amazon Web Services account ID in the request. *

      *
    • *
    • *

      * We couldn't find an account specific event for the specified Amazon Web Services account. To find an event * that is public, you must enter a null value for the Amazon Web Services account ID in the request. *

      *
    • *
    • *

      * Your Amazon Web Services account doesn't include the Amazon Web Services Support plan required to use the * Health API. You must have either a Business, Enterprise On-Ramp, or Enterprise Support plan. *

      *
    • *
    * * @param errorMessage * A message that describes the error.

    *

    * If you call the DescribeEventDetailsForOrganization operation and receive one of the * following errors, follow the recommendations in the message: *

    *
      *
    • *

      * We couldn't find a public event that matches your request. To find an event that is account specific, * you must enter an Amazon Web Services account ID in the request. *

      *
    • *
    • *

      * We couldn't find an account specific event for the specified Amazon Web Services account. To find an * event that is public, you must enter a null value for the Amazon Web Services account ID in the * request. *

      *
    • *
    • *

      * Your Amazon Web Services account doesn't include the Amazon Web Services Support plan required to use * the Health API. You must have either a Business, Enterprise On-Ramp, or Enterprise Support plan. *

      *
    • * @return Returns a reference to this object so that method calls can be chained together. */ Builder errorMessage(String errorMessage); } static final class BuilderImpl implements Builder { private String awsAccountId; private String eventArn; private String errorName; private String errorMessage; private BuilderImpl() { } private BuilderImpl(OrganizationEventDetailsErrorItem model) { awsAccountId(model.awsAccountId); eventArn(model.eventArn); errorName(model.errorName); errorMessage(model.errorMessage); } public final String getAwsAccountId() { return awsAccountId; } public final void setAwsAccountId(String awsAccountId) { this.awsAccountId = awsAccountId; } @Override public final Builder awsAccountId(String awsAccountId) { this.awsAccountId = awsAccountId; return this; } public final String getEventArn() { return eventArn; } public final void setEventArn(String eventArn) { this.eventArn = eventArn; } @Override public final Builder eventArn(String eventArn) { this.eventArn = eventArn; return this; } public final String getErrorName() { return errorName; } public final void setErrorName(String errorName) { this.errorName = errorName; } @Override public final Builder errorName(String errorName) { this.errorName = errorName; return this; } public final String getErrorMessage() { return errorMessage; } public final void setErrorMessage(String errorMessage) { this.errorMessage = errorMessage; } @Override public final Builder errorMessage(String errorMessage) { this.errorMessage = errorMessage; return this; } @Override public OrganizationEventDetailsErrorItem build() { return new OrganizationEventDetailsErrorItem(this); } @Override public List> sdkFields() { return SDK_FIELDS; } @Override public Map> sdkFieldNameToField() { return SDK_NAME_TO_FIELD; } } }




© 2015 - 2024 Weber Informatics LLC | Privacy Policy