/* * Copyright 2018-2023 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 com.amazonaws.services.servicediscovery.model; import java.io.Serializable; import javax.annotation.Generated; import com.amazonaws.protocol.StructuredPojo; import com.amazonaws.protocol.ProtocolMarshaller; /** *

* A complex type that contains information about the specified service. *

* * @see AWS API * Documentation */ @Generated("com.amazonaws:aws-java-sdk-code-generator") public class Service implements Serializable, Cloneable, StructuredPojo { /** *

* The ID that Cloud Map assigned to the service when you created it. *

*/ private String id; /** *

* The Amazon Resource Name (ARN) that Cloud Map assigns to the service when you create it. *

*/ private String arn; /** *

* The name of the service. *

*/ private String name; /** *

* The ID of the namespace that was used to create the service. *

*/ private String namespaceId; /** *

* The description of the service. *

*/ private String description; /** *

* The number of instances that are currently associated with the service. Instances that were previously associated * with the service but that are deleted aren't included in the count. The count might not reflect pending * registrations and deregistrations. *

*/ private Integer instanceCount; /** *

* A complex type that contains information about the Route 53 DNS records that you want Cloud Map to create when * you register an instance. *

* *

* The record types of a service can only be changed by deleting the service and recreating it with a new * Dnsconfig. *

*
*/ private DnsConfig dnsConfig; /** *

* Describes the systems that can be used to discover the service instances. *

*
*
DNS_HTTP
*
*

* The service instances can be discovered using either DNS queries or the DiscoverInstances API * operation. *

*
*
HTTP
*
*

* The service instances can only be discovered using the DiscoverInstances API operation. *

*
*
DNS
*
*

* Reserved. *

*
*
*/ private String type; /** *

* Public DNS and HTTP namespaces only. A complex type that contains settings for an optional health check. * If you specify settings for a health check, Cloud Map associates the health check with the records that you * specify in DnsConfig. *

*

* For information about the charges for health checks, see Amazon * Route 53 Pricing. *

*/ private HealthCheckConfig healthCheckConfig; /** *

* A complex type that contains information about an optional custom health check. *

* *

* If you specify a health check configuration, you can specify either HealthCheckCustomConfig or * HealthCheckConfig but not both. *

*
*/ private HealthCheckCustomConfig healthCheckCustomConfig; /** *

* The date and time that the service was created, in Unix format and Coordinated Universal Time (UTC). The value of * CreateDate is accurate to milliseconds. For example, the value 1516925490.087 * represents Friday, January 26, 2018 12:11:30.087 AM. *

*/ private java.util.Date createDate; /** *

* A unique string that identifies the request and that allows failed requests to be retried without the risk of * running the operation twice. CreatorRequestId can be any unique string (for example, a * date/timestamp). *

*/ private String creatorRequestId; /** *

* The ID that Cloud Map assigned to the service when you created it. *

* * @param id * The ID that Cloud Map assigned to the service when you created it. */ public void setId(String id) { this.id = id; } /** *

* The ID that Cloud Map assigned to the service when you created it. *

* * @return The ID that Cloud Map assigned to the service when you created it. */ public String getId() { return this.id; } /** *

* The ID that Cloud Map assigned to the service when you created it. *

* * @param id * The ID that Cloud Map assigned to the service when you created it. * @return Returns a reference to this object so that method calls can be chained together. */ public Service withId(String id) { setId(id); return this; } /** *

* The Amazon Resource Name (ARN) that Cloud Map assigns to the service when you create it. *

* * @param arn * The Amazon Resource Name (ARN) that Cloud Map assigns to the service when you create it. */ public void setArn(String arn) { this.arn = arn; } /** *

* The Amazon Resource Name (ARN) that Cloud Map assigns to the service when you create it. *

* * @return The Amazon Resource Name (ARN) that Cloud Map assigns to the service when you create it. */ public String getArn() { return this.arn; } /** *

* The Amazon Resource Name (ARN) that Cloud Map assigns to the service when you create it. *

* * @param arn * The Amazon Resource Name (ARN) that Cloud Map assigns to the service when you create it. * @return Returns a reference to this object so that method calls can be chained together. */ public Service withArn(String arn) { setArn(arn); return this; } /** *

* The name of the service. *

* * @param name * The name of the service. */ public void setName(String name) { this.name = name; } /** *

* The name of the service. *

* * @return The name of the service. */ public String getName() { return this.name; } /** *

* The name of the service. *

* * @param name * The name of the service. * @return Returns a reference to this object so that method calls can be chained together. */ public Service withName(String name) { setName(name); return this; } /** *

* The ID of the namespace that was used to create the service. *

* * @param namespaceId * The ID of the namespace that was used to create the service. */ public void setNamespaceId(String namespaceId) { this.namespaceId = namespaceId; } /** *

* The ID of the namespace that was used to create the service. *

* * @return The ID of the namespace that was used to create the service. */ public String getNamespaceId() { return this.namespaceId; } /** *

* The ID of the namespace that was used to create the service. *

* * @param namespaceId * The ID of the namespace that was used to create the service. * @return Returns a reference to this object so that method calls can be chained together. */ public Service withNamespaceId(String namespaceId) { setNamespaceId(namespaceId); return this; } /** *

* The description of the service. *

* * @param description * The description of the service. */ public void setDescription(String description) { this.description = description; } /** *

* The description of the service. *

* * @return The description of the service. */ public String getDescription() { return this.description; } /** *

* The description of the service. *

* * @param description * The description of the service. * @return Returns a reference to this object so that method calls can be chained together. */ public Service withDescription(String description) { setDescription(description); return this; } /** *

* The number of instances that are currently associated with the service. Instances that were previously associated * with the service but that are deleted aren't included in the count. The count might not reflect pending * registrations and deregistrations. *

* * @param instanceCount * The number of instances that are currently associated with the service. Instances that were previously * associated with the service but that are deleted aren't included in the count. The count might not reflect * pending registrations and deregistrations. */ public void setInstanceCount(Integer instanceCount) { this.instanceCount = instanceCount; } /** *

* The number of instances that are currently associated with the service. Instances that were previously associated * with the service but that are deleted aren't included in the count. The count might not reflect pending * registrations and deregistrations. *

* * @return The number of instances that are currently associated with the service. Instances that were previously * associated with the service but that are deleted aren't included in the count. The count might not * reflect pending registrations and deregistrations. */ public Integer getInstanceCount() { return this.instanceCount; } /** *

* The number of instances that are currently associated with the service. Instances that were previously associated * with the service but that are deleted aren't included in the count. The count might not reflect pending * registrations and deregistrations. *

* * @param instanceCount * The number of instances that are currently associated with the service. Instances that were previously * associated with the service but that are deleted aren't included in the count. The count might not reflect * pending registrations and deregistrations. * @return Returns a reference to this object so that method calls can be chained together. */ public Service withInstanceCount(Integer instanceCount) { setInstanceCount(instanceCount); return this; } /** *

* A complex type that contains information about the Route 53 DNS records that you want Cloud Map to create when * you register an instance. *

* *

* The record types of a service can only be changed by deleting the service and recreating it with a new * Dnsconfig. *

*
* * @param dnsConfig * A complex type that contains information about the Route 53 DNS records that you want Cloud Map to create * when you register an instance.

*

* The record types of a service can only be changed by deleting the service and recreating it with a new * Dnsconfig. *

*/ public void setDnsConfig(DnsConfig dnsConfig) { this.dnsConfig = dnsConfig; } /** *

* A complex type that contains information about the Route 53 DNS records that you want Cloud Map to create when * you register an instance. *

* *

* The record types of a service can only be changed by deleting the service and recreating it with a new * Dnsconfig. *

*
* * @return A complex type that contains information about the Route 53 DNS records that you want Cloud Map to create * when you register an instance.

*

* The record types of a service can only be changed by deleting the service and recreating it with a new * Dnsconfig. *

*/ public DnsConfig getDnsConfig() { return this.dnsConfig; } /** *

* A complex type that contains information about the Route 53 DNS records that you want Cloud Map to create when * you register an instance. *

* *

* The record types of a service can only be changed by deleting the service and recreating it with a new * Dnsconfig. *

*
* * @param dnsConfig * A complex type that contains information about the Route 53 DNS records that you want Cloud Map to create * when you register an instance.

*

* The record types of a service can only be changed by deleting the service and recreating it with a new * Dnsconfig. *

* @return Returns a reference to this object so that method calls can be chained together. */ public Service withDnsConfig(DnsConfig dnsConfig) { setDnsConfig(dnsConfig); return this; } /** *

* Describes the systems that can be used to discover the service instances. *

*
*
DNS_HTTP
*
*

* The service instances can be discovered using either DNS queries or the DiscoverInstances API * operation. *

*
*
HTTP
*
*

* The service instances can only be discovered using the DiscoverInstances API operation. *

*
*
DNS
*
*

* Reserved. *

*
*
* * @param type * Describes the systems that can be used to discover the service instances.

*
*
DNS_HTTP
*
*

* The service instances can be discovered using either DNS queries or the DiscoverInstances API * operation. *

*
*
HTTP
*
*

* The service instances can only be discovered using the DiscoverInstances API operation. *

*
*
DNS
*
*

* Reserved. *

*
* @see ServiceType */ public void setType(String type) { this.type = type; } /** *

* Describes the systems that can be used to discover the service instances. *

*
*
DNS_HTTP
*
*

* The service instances can be discovered using either DNS queries or the DiscoverInstances API * operation. *

*
*
HTTP
*
*

* The service instances can only be discovered using the DiscoverInstances API operation. *

*
*
DNS
*
*

* Reserved. *

*
*
* * @return Describes the systems that can be used to discover the service instances.

*
*
DNS_HTTP
*
*

* The service instances can be discovered using either DNS queries or the DiscoverInstances * API operation. *

*
*
HTTP
*
*

* The service instances can only be discovered using the DiscoverInstances API operation. *

*
*
DNS
*
*

* Reserved. *

*
* @see ServiceType */ public String getType() { return this.type; } /** *

* Describes the systems that can be used to discover the service instances. *

*
*
DNS_HTTP
*
*

* The service instances can be discovered using either DNS queries or the DiscoverInstances API * operation. *

*
*
HTTP
*
*

* The service instances can only be discovered using the DiscoverInstances API operation. *

*
*
DNS
*
*

* Reserved. *

*
*
* * @param type * Describes the systems that can be used to discover the service instances.

*
*
DNS_HTTP
*
*

* The service instances can be discovered using either DNS queries or the DiscoverInstances API * operation. *

*
*
HTTP
*
*

* The service instances can only be discovered using the DiscoverInstances API operation. *

*
*
DNS
*
*

* Reserved. *

*
* @return Returns a reference to this object so that method calls can be chained together. * @see ServiceType */ public Service withType(String type) { setType(type); return this; } /** *

* Describes the systems that can be used to discover the service instances. *

*
*
DNS_HTTP
*
*

* The service instances can be discovered using either DNS queries or the DiscoverInstances API * operation. *

*
*
HTTP
*
*

* The service instances can only be discovered using the DiscoverInstances API operation. *

*
*
DNS
*
*

* Reserved. *

*
*
* * @param type * Describes the systems that can be used to discover the service instances.

*
*
DNS_HTTP
*
*

* The service instances can be discovered using either DNS queries or the DiscoverInstances API * operation. *

*
*
HTTP
*
*

* The service instances can only be discovered using the DiscoverInstances API operation. *

*
*
DNS
*
*

* Reserved. *

*
* @return Returns a reference to this object so that method calls can be chained together. * @see ServiceType */ public Service withType(ServiceType type) { this.type = type.toString(); return this; } /** *

* Public DNS and HTTP namespaces only. A complex type that contains settings for an optional health check. * If you specify settings for a health check, Cloud Map associates the health check with the records that you * specify in DnsConfig. *

*

* For information about the charges for health checks, see Amazon * Route 53 Pricing. *

* * @param healthCheckConfig * Public DNS and HTTP namespaces only. A complex type that contains settings for an optional health * check. If you specify settings for a health check, Cloud Map associates the health check with the records * that you specify in DnsConfig.

*

* For information about the charges for health checks, see Amazon Route 53 Pricing. */ public void setHealthCheckConfig(HealthCheckConfig healthCheckConfig) { this.healthCheckConfig = healthCheckConfig; } /** *

* Public DNS and HTTP namespaces only. A complex type that contains settings for an optional health check. * If you specify settings for a health check, Cloud Map associates the health check with the records that you * specify in DnsConfig. *

*

* For information about the charges for health checks, see Amazon * Route 53 Pricing. *

* * @return Public DNS and HTTP namespaces only. A complex type that contains settings for an optional health * check. If you specify settings for a health check, Cloud Map associates the health check with the records * that you specify in DnsConfig.

*

* For information about the charges for health checks, see Amazon Route 53 Pricing. */ public HealthCheckConfig getHealthCheckConfig() { return this.healthCheckConfig; } /** *

* Public DNS and HTTP namespaces only. A complex type that contains settings for an optional health check. * If you specify settings for a health check, Cloud Map associates the health check with the records that you * specify in DnsConfig. *

*

* For information about the charges for health checks, see Amazon * Route 53 Pricing. *

* * @param healthCheckConfig * Public DNS and HTTP namespaces only. A complex type that contains settings for an optional health * check. If you specify settings for a health check, Cloud Map associates the health check with the records * that you specify in DnsConfig.

*

* For information about the charges for health checks, see Amazon Route 53 Pricing. * @return Returns a reference to this object so that method calls can be chained together. */ public Service withHealthCheckConfig(HealthCheckConfig healthCheckConfig) { setHealthCheckConfig(healthCheckConfig); return this; } /** *

* A complex type that contains information about an optional custom health check. *

* *

* If you specify a health check configuration, you can specify either HealthCheckCustomConfig or * HealthCheckConfig but not both. *

*
* * @param healthCheckCustomConfig * A complex type that contains information about an optional custom health check.

*

* If you specify a health check configuration, you can specify either HealthCheckCustomConfig * or HealthCheckConfig but not both. *

*/ public void setHealthCheckCustomConfig(HealthCheckCustomConfig healthCheckCustomConfig) { this.healthCheckCustomConfig = healthCheckCustomConfig; } /** *

* A complex type that contains information about an optional custom health check. *

* *

* If you specify a health check configuration, you can specify either HealthCheckCustomConfig or * HealthCheckConfig but not both. *

*
* * @return A complex type that contains information about an optional custom health check.

*

* If you specify a health check configuration, you can specify either HealthCheckCustomConfig * or HealthCheckConfig but not both. *

*/ public HealthCheckCustomConfig getHealthCheckCustomConfig() { return this.healthCheckCustomConfig; } /** *

* A complex type that contains information about an optional custom health check. *

* *

* If you specify a health check configuration, you can specify either HealthCheckCustomConfig or * HealthCheckConfig but not both. *

*
* * @param healthCheckCustomConfig * A complex type that contains information about an optional custom health check.

*

* If you specify a health check configuration, you can specify either HealthCheckCustomConfig * or HealthCheckConfig but not both. *

* @return Returns a reference to this object so that method calls can be chained together. */ public Service withHealthCheckCustomConfig(HealthCheckCustomConfig healthCheckCustomConfig) { setHealthCheckCustomConfig(healthCheckCustomConfig); return this; } /** *

* The date and time that the service was created, in Unix format and Coordinated Universal Time (UTC). The value of * CreateDate is accurate to milliseconds. For example, the value 1516925490.087 * represents Friday, January 26, 2018 12:11:30.087 AM. *

* * @param createDate * The date and time that the service was created, in Unix format and Coordinated Universal Time (UTC). The * value of CreateDate is accurate to milliseconds. For example, the value * 1516925490.087 represents Friday, January 26, 2018 12:11:30.087 AM. */ public void setCreateDate(java.util.Date createDate) { this.createDate = createDate; } /** *

* The date and time that the service was created, in Unix format and Coordinated Universal Time (UTC). The value of * CreateDate is accurate to milliseconds. For example, the value 1516925490.087 * represents Friday, January 26, 2018 12:11:30.087 AM. *

* * @return The date and time that the service was created, in Unix format and Coordinated Universal Time (UTC). The * value of CreateDate is accurate to milliseconds. For example, the value * 1516925490.087 represents Friday, January 26, 2018 12:11:30.087 AM. */ public java.util.Date getCreateDate() { return this.createDate; } /** *

* The date and time that the service was created, in Unix format and Coordinated Universal Time (UTC). The value of * CreateDate is accurate to milliseconds. For example, the value 1516925490.087 * represents Friday, January 26, 2018 12:11:30.087 AM. *

* * @param createDate * The date and time that the service was created, in Unix format and Coordinated Universal Time (UTC). The * value of CreateDate is accurate to milliseconds. For example, the value * 1516925490.087 represents Friday, January 26, 2018 12:11:30.087 AM. * @return Returns a reference to this object so that method calls can be chained together. */ public Service withCreateDate(java.util.Date createDate) { setCreateDate(createDate); return this; } /** *

* A unique string that identifies the request and that allows failed requests to be retried without the risk of * running the operation twice. CreatorRequestId can be any unique string (for example, a * date/timestamp). *

* * @param creatorRequestId * A unique string that identifies the request and that allows failed requests to be retried without the risk * of running the operation twice. CreatorRequestId can be any unique string (for example, a * date/timestamp). */ public void setCreatorRequestId(String creatorRequestId) { this.creatorRequestId = creatorRequestId; } /** *

* A unique string that identifies the request and that allows failed requests to be retried without the risk of * running the operation twice. CreatorRequestId can be any unique string (for example, a * date/timestamp). *

* * @return A unique string that identifies the request and that allows failed requests to be retried without the * risk of running the operation twice. CreatorRequestId can be any unique string (for example, * a date/timestamp). */ public String getCreatorRequestId() { return this.creatorRequestId; } /** *

* A unique string that identifies the request and that allows failed requests to be retried without the risk of * running the operation twice. CreatorRequestId can be any unique string (for example, a * date/timestamp). *

* * @param creatorRequestId * A unique string that identifies the request and that allows failed requests to be retried without the risk * of running the operation twice. CreatorRequestId can be any unique string (for example, a * date/timestamp). * @return Returns a reference to this object so that method calls can be chained together. */ public Service withCreatorRequestId(String creatorRequestId) { setCreatorRequestId(creatorRequestId); return this; } /** * 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. * * @return A string representation of this object. * * @see java.lang.Object#toString() */ @Override public String toString() { StringBuilder sb = new StringBuilder(); sb.append("{"); if (getId() != null) sb.append("Id: ").append(getId()).append(","); if (getArn() != null) sb.append("Arn: ").append(getArn()).append(","); if (getName() != null) sb.append("Name: ").append(getName()).append(","); if (getNamespaceId() != null) sb.append("NamespaceId: ").append(getNamespaceId()).append(","); if (getDescription() != null) sb.append("Description: ").append(getDescription()).append(","); if (getInstanceCount() != null) sb.append("InstanceCount: ").append(getInstanceCount()).append(","); if (getDnsConfig() != null) sb.append("DnsConfig: ").append(getDnsConfig()).append(","); if (getType() != null) sb.append("Type: ").append(getType()).append(","); if (getHealthCheckConfig() != null) sb.append("HealthCheckConfig: ").append(getHealthCheckConfig()).append(","); if (getHealthCheckCustomConfig() != null) sb.append("HealthCheckCustomConfig: ").append(getHealthCheckCustomConfig()).append(","); if (getCreateDate() != null) sb.append("CreateDate: ").append(getCreateDate()).append(","); if (getCreatorRequestId() != null) sb.append("CreatorRequestId: ").append(getCreatorRequestId()); sb.append("}"); return sb.toString(); } @Override public boolean equals(Object obj) { if (this == obj) return true; if (obj == null) return false; if (obj instanceof Service == false) return false; Service other = (Service) obj; if (other.getId() == null ^ this.getId() == null) return false; if (other.getId() != null && other.getId().equals(this.getId()) == false) return false; if (other.getArn() == null ^ this.getArn() == null) return false; if (other.getArn() != null && other.getArn().equals(this.getArn()) == false) return false; if (other.getName() == null ^ this.getName() == null) return false; if (other.getName() != null && other.getName().equals(this.getName()) == false) return false; if (other.getNamespaceId() == null ^ this.getNamespaceId() == null) return false; if (other.getNamespaceId() != null && other.getNamespaceId().equals(this.getNamespaceId()) == false) return false; if (other.getDescription() == null ^ this.getDescription() == null) return false; if (other.getDescription() != null && other.getDescription().equals(this.getDescription()) == false) return false; if (other.getInstanceCount() == null ^ this.getInstanceCount() == null) return false; if (other.getInstanceCount() != null && other.getInstanceCount().equals(this.getInstanceCount()) == false) return false; if (other.getDnsConfig() == null ^ this.getDnsConfig() == null) return false; if (other.getDnsConfig() != null && other.getDnsConfig().equals(this.getDnsConfig()) == false) return false; if (other.getType() == null ^ this.getType() == null) return false; if (other.getType() != null && other.getType().equals(this.getType()) == false) return false; if (other.getHealthCheckConfig() == null ^ this.getHealthCheckConfig() == null) return false; if (other.getHealthCheckConfig() != null && other.getHealthCheckConfig().equals(this.getHealthCheckConfig()) == false) return false; if (other.getHealthCheckCustomConfig() == null ^ this.getHealthCheckCustomConfig() == null) return false; if (other.getHealthCheckCustomConfig() != null && other.getHealthCheckCustomConfig().equals(this.getHealthCheckCustomConfig()) == false) return false; if (other.getCreateDate() == null ^ this.getCreateDate() == null) return false; if (other.getCreateDate() != null && other.getCreateDate().equals(this.getCreateDate()) == false) return false; if (other.getCreatorRequestId() == null ^ this.getCreatorRequestId() == null) return false; if (other.getCreatorRequestId() != null && other.getCreatorRequestId().equals(this.getCreatorRequestId()) == false) return false; return true; } @Override public int hashCode() { final int prime = 31; int hashCode = 1; hashCode = prime * hashCode + ((getId() == null) ? 0 : getId().hashCode()); hashCode = prime * hashCode + ((getArn() == null) ? 0 : getArn().hashCode()); hashCode = prime * hashCode + ((getName() == null) ? 0 : getName().hashCode()); hashCode = prime * hashCode + ((getNamespaceId() == null) ? 0 : getNamespaceId().hashCode()); hashCode = prime * hashCode + ((getDescription() == null) ? 0 : getDescription().hashCode()); hashCode = prime * hashCode + ((getInstanceCount() == null) ? 0 : getInstanceCount().hashCode()); hashCode = prime * hashCode + ((getDnsConfig() == null) ? 0 : getDnsConfig().hashCode()); hashCode = prime * hashCode + ((getType() == null) ? 0 : getType().hashCode()); hashCode = prime * hashCode + ((getHealthCheckConfig() == null) ? 0 : getHealthCheckConfig().hashCode()); hashCode = prime * hashCode + ((getHealthCheckCustomConfig() == null) ? 0 : getHealthCheckCustomConfig().hashCode()); hashCode = prime * hashCode + ((getCreateDate() == null) ? 0 : getCreateDate().hashCode()); hashCode = prime * hashCode + ((getCreatorRequestId() == null) ? 0 : getCreatorRequestId().hashCode()); return hashCode; } @Override public Service clone() { try { return (Service) super.clone(); } catch (CloneNotSupportedException e) { throw new IllegalStateException("Got a CloneNotSupportedException from Object.clone() " + "even though we're Cloneable!", e); } } @com.amazonaws.annotation.SdkInternalApi @Override public void marshall(ProtocolMarshaller protocolMarshaller) { com.amazonaws.services.servicediscovery.model.transform.ServiceMarshaller.getInstance().marshall(this, protocolMarshaller); } }