software.amazon.awssdk.services.devopsguru.model.DescribeOrganizationResourceCollectionHealthResponse Maven / Gradle / Ivy
Show all versions of devopsguru 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.devopsguru.model;
import java.util.Arrays;
import java.util.Collection;
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.Consumer;
import java.util.function.Function;
import java.util.stream.Collectors;
import java.util.stream.Stream;
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.ListTrait;
import software.amazon.awssdk.core.traits.LocationTrait;
import software.amazon.awssdk.core.util.DefaultSdkAutoConstructList;
import software.amazon.awssdk.core.util.SdkAutoConstructList;
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 DescribeOrganizationResourceCollectionHealthResponse extends DevOpsGuruResponse
implements
ToCopyableBuilder {
private static final SdkField> CLOUD_FORMATION_FIELD = SdkField
.> builder(MarshallingType.LIST)
.memberName("CloudFormation")
.getter(getter(DescribeOrganizationResourceCollectionHealthResponse::cloudFormation))
.setter(setter(Builder::cloudFormation))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("CloudFormation").build(),
ListTrait
.builder()
.memberLocationName(null)
.memberFieldInfo(
SdkField. builder(MarshallingType.SDK_POJO)
.constructor(CloudFormationHealth::builder)
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD)
.locationName("member").build()).build()).build()).build();
private static final SdkField> SERVICE_FIELD = SdkField
.> builder(MarshallingType.LIST)
.memberName("Service")
.getter(getter(DescribeOrganizationResourceCollectionHealthResponse::service))
.setter(setter(Builder::service))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("Service").build(),
ListTrait
.builder()
.memberLocationName(null)
.memberFieldInfo(
SdkField. builder(MarshallingType.SDK_POJO)
.constructor(ServiceHealth::builder)
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD)
.locationName("member").build()).build()).build()).build();
private static final SdkField> ACCOUNT_FIELD = SdkField
.> builder(MarshallingType.LIST)
.memberName("Account")
.getter(getter(DescribeOrganizationResourceCollectionHealthResponse::account))
.setter(setter(Builder::account))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("Account").build(),
ListTrait
.builder()
.memberLocationName(null)
.memberFieldInfo(
SdkField. builder(MarshallingType.SDK_POJO)
.constructor(AccountHealth::builder)
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD)
.locationName("member").build()).build()).build()).build();
private static final SdkField NEXT_TOKEN_FIELD = SdkField. builder(MarshallingType.STRING)
.memberName("NextToken").getter(getter(DescribeOrganizationResourceCollectionHealthResponse::nextToken))
.setter(setter(Builder::nextToken))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("NextToken").build()).build();
private static final SdkField> TAGS_FIELD = SdkField
.> builder(MarshallingType.LIST)
.memberName("Tags")
.getter(getter(DescribeOrganizationResourceCollectionHealthResponse::tags))
.setter(setter(Builder::tags))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("Tags").build(),
ListTrait
.builder()
.memberLocationName(null)
.memberFieldInfo(
SdkField. builder(MarshallingType.SDK_POJO)
.constructor(TagHealth::builder)
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD)
.locationName("member").build()).build()).build()).build();
private static final List> SDK_FIELDS = Collections.unmodifiableList(Arrays.asList(CLOUD_FORMATION_FIELD,
SERVICE_FIELD, ACCOUNT_FIELD, NEXT_TOKEN_FIELD, TAGS_FIELD));
private static final Map> SDK_NAME_TO_FIELD = Collections
.unmodifiableMap(new HashMap>() {
{
put("CloudFormation", CLOUD_FORMATION_FIELD);
put("Service", SERVICE_FIELD);
put("Account", ACCOUNT_FIELD);
put("NextToken", NEXT_TOKEN_FIELD);
put("Tags", TAGS_FIELD);
}
});
private final List cloudFormation;
private final List service;
private final List account;
private final String nextToken;
private final List tags;
private DescribeOrganizationResourceCollectionHealthResponse(BuilderImpl builder) {
super(builder);
this.cloudFormation = builder.cloudFormation;
this.service = builder.service;
this.account = builder.account;
this.nextToken = builder.nextToken;
this.tags = builder.tags;
}
/**
* For responses, this returns true if the service returned a value for the CloudFormation property. This DOES NOT
* check that the value is non-empty (for which, you should check the {@code isEmpty()} method on the property).
* This is useful because the SDK will never return a null collection or map, but you may need to differentiate
* between the service returning nothing (or null) and the service returning an empty collection or map. For
* requests, this returns true if a value for the property was specified in the request builder, and false if a
* value was not specified.
*/
public final boolean hasCloudFormation() {
return cloudFormation != null && !(cloudFormation instanceof SdkAutoConstructList);
}
/**
*
* The returned CloudFormationHealthOverview
object that contains an InsightHealthOverview
* object with the requested system health information.
*
*
* Attempts to modify the collection returned by this method will result in an UnsupportedOperationException.
*
*
* This method will never return null. If you would like to know whether the service returned this field (so that
* you can differentiate between null and empty), you can use the {@link #hasCloudFormation} method.
*
*
* @return The returned CloudFormationHealthOverview
object that contains an
* InsightHealthOverview
object with the requested system health information.
*/
public final List cloudFormation() {
return cloudFormation;
}
/**
* For responses, this returns true if the service returned a value for the Service property. This DOES NOT check
* that the value is non-empty (for which, you should check the {@code isEmpty()} method on the property). This is
* useful because the SDK will never return a null collection or map, but you may need to differentiate between the
* service returning nothing (or null) and the service returning an empty collection or map. For requests, this
* returns true if a value for the property was specified in the request builder, and false if a value was not
* specified.
*/
public final boolean hasService() {
return service != null && !(service instanceof SdkAutoConstructList);
}
/**
*
* An array of ServiceHealth
objects that describes the health of the Amazon Web Services services
* associated with the resources in the collection.
*
*
* Attempts to modify the collection returned by this method will result in an UnsupportedOperationException.
*
*
* This method will never return null. If you would like to know whether the service returned this field (so that
* you can differentiate between null and empty), you can use the {@link #hasService} method.
*
*
* @return An array of ServiceHealth
objects that describes the health of the Amazon Web Services
* services associated with the resources in the collection.
*/
public final List service() {
return service;
}
/**
* For responses, this returns true if the service returned a value for the Account property. This DOES NOT check
* that the value is non-empty (for which, you should check the {@code isEmpty()} method on the property). This is
* useful because the SDK will never return a null collection or map, but you may need to differentiate between the
* service returning nothing (or null) and the service returning an empty collection or map. For requests, this
* returns true if a value for the property was specified in the request builder, and false if a value was not
* specified.
*/
public final boolean hasAccount() {
return account != null && !(account instanceof SdkAutoConstructList);
}
/**
*
* The name of the organization's account.
*
*
* Attempts to modify the collection returned by this method will result in an UnsupportedOperationException.
*
*
* This method will never return null. If you would like to know whether the service returned this field (so that
* you can differentiate between null and empty), you can use the {@link #hasAccount} method.
*
*
* @return The name of the organization's account.
*/
public final List account() {
return account;
}
/**
*
* The pagination token to use to retrieve the next page of results for this operation. If there are no more pages,
* this value is null.
*
*
* @return The pagination token to use to retrieve the next page of results for this operation. If there are no more
* pages, this value is null.
*/
public final String nextToken() {
return nextToken;
}
/**
* For responses, this returns true if the service returned a value for the Tags property. This DOES NOT check that
* the value is non-empty (for which, you should check the {@code isEmpty()} method on the property). This is useful
* because the SDK will never return a null collection or map, but you may need to differentiate between the service
* returning nothing (or null) and the service returning an empty collection or map. For requests, this returns true
* if a value for the property was specified in the request builder, and false if a value was not specified.
*/
public final boolean hasTags() {
return tags != null && !(tags instanceof SdkAutoConstructList);
}
/**
*
* Tags help you identify and organize your Amazon Web Services resources. Many Amazon Web Services services support
* tagging, so you can assign the same tag to resources from different services to indicate that the resources are
* related. For example, you can assign the same tag to an Amazon DynamoDB table resource that you assign to an
* Lambda function. For more information about using tags, see the Tagging
* best practices whitepaper.
*
*
* Each Amazon Web Services tag has two parts.
*
*
* -
*
* A tag key (for example, CostCenter
, Environment
, Project
, or
* Secret
). Tag keys are case-sensitive.
*
*
* -
*
* An optional field known as a tag value (for example, 111122223333
, Production
,
* or a team name). Omitting the tag value is the same as using an empty string. Like tag keys, tag
* values are case-sensitive.
*
*
*
*
* Together these are known as key-value pairs.
*
*
*
* The string used for a key in a tag that you use to define your resource coverage must begin with the
* prefix Devops-guru-
. The tag key might be DevOps-Guru-deployment-application
or
* devops-guru-rds-application
. When you create a key, the case of characters in the key
* can be whatever you choose. After you create a key, it is case-sensitive. For example, DevOps Guru works
* with a key named devops-guru-rds
and a key named DevOps-Guru-RDS
, and
* these act as two different keys. Possible key/value pairs in your application might be
* Devops-Guru-production-application/RDS
or Devops-Guru-production-application/containers
* .
*
*
*
* Attempts to modify the collection returned by this method will result in an UnsupportedOperationException.
*
*
* This method will never return null. If you would like to know whether the service returned this field (so that
* you can differentiate between null and empty), you can use the {@link #hasTags} method.
*
*
* @return Tags help you identify and organize your Amazon Web Services resources. Many Amazon Web Services services
* support tagging, so you can assign the same tag to resources from different services to indicate that the
* resources are related. For example, you can assign the same tag to an Amazon DynamoDB table resource that
* you assign to an Lambda function. For more information about using tags, see the Tagging best practices whitepaper.
*
* Each Amazon Web Services tag has two parts.
*
*
* -
*
* A tag key (for example, CostCenter
, Environment
, Project
,
* or Secret
). Tag keys are case-sensitive.
*
*
* -
*
* An optional field known as a tag value (for example, 111122223333
,
* Production
, or a team name). Omitting the tag value is the same as using an empty
* string. Like tag keys, tag values are case-sensitive.
*
*
*
*
* Together these are known as key-value pairs.
*
*
*
* The string used for a key in a tag that you use to define your resource coverage must begin with
* the prefix Devops-guru-
. The tag key might be
* DevOps-Guru-deployment-application
or devops-guru-rds-application
. When you
* create a key, the case of characters in the key can be whatever you choose. After you
* create a key, it is case-sensitive. For example, DevOps Guru works with a key named
* devops-guru-rds
and a key named DevOps-Guru-RDS
, and these act as two
* different keys. Possible key/value pairs in your application might be
* Devops-Guru-production-application/RDS
or
* Devops-Guru-production-application/containers
.
*
*/
public final List tags() {
return tags;
}
@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(hasCloudFormation() ? cloudFormation() : null);
hashCode = 31 * hashCode + Objects.hashCode(hasService() ? service() : null);
hashCode = 31 * hashCode + Objects.hashCode(hasAccount() ? account() : null);
hashCode = 31 * hashCode + Objects.hashCode(nextToken());
hashCode = 31 * hashCode + Objects.hashCode(hasTags() ? tags() : null);
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 DescribeOrganizationResourceCollectionHealthResponse)) {
return false;
}
DescribeOrganizationResourceCollectionHealthResponse other = (DescribeOrganizationResourceCollectionHealthResponse) obj;
return hasCloudFormation() == other.hasCloudFormation() && Objects.equals(cloudFormation(), other.cloudFormation())
&& hasService() == other.hasService() && Objects.equals(service(), other.service())
&& hasAccount() == other.hasAccount() && Objects.equals(account(), other.account())
&& Objects.equals(nextToken(), other.nextToken()) && hasTags() == other.hasTags()
&& Objects.equals(tags(), other.tags());
}
/**
* 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("DescribeOrganizationResourceCollectionHealthResponse")
.add("CloudFormation", hasCloudFormation() ? cloudFormation() : null)
.add("Service", hasService() ? service() : null).add("Account", hasAccount() ? account() : null)
.add("NextToken", nextToken()).add("Tags", hasTags() ? tags() : null).build();
}
public final Optional getValueForField(String fieldName, Class clazz) {
switch (fieldName) {
case "CloudFormation":
return Optional.ofNullable(clazz.cast(cloudFormation()));
case "Service":
return Optional.ofNullable(clazz.cast(service()));
case "Account":
return Optional.ofNullable(clazz.cast(account()));
case "NextToken":
return Optional.ofNullable(clazz.cast(nextToken()));
case "Tags":
return Optional.ofNullable(clazz.cast(tags()));
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