/* * 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.codestarconnections.model; import java.io.Serializable; import javax.annotation.Generated; import com.amazonaws.AmazonWebServiceRequest; /** * * @see AWS * API Documentation */ @Generated("com.amazonaws:aws-java-sdk-code-generator") public class CreateHostRequest extends com.amazonaws.AmazonWebServiceRequest implements Serializable, Cloneable { /** *

* The name of the host to be created. The name must be unique in the calling AWS account. *

*/ private String name; /** *

* The name of the installed provider to be associated with your connection. The host resource represents the * infrastructure where your provider type is installed. The valid provider type is GitHub Enterprise Server. *

*/ private String providerType; /** *

* The endpoint of the infrastructure to be represented by the host after it is created. *

*/ private String providerEndpoint; /** *

* The VPC configuration to be provisioned for the host. A VPC must be configured and the infrastructure to be * represented by the host must already be connected to the VPC. *

*/ private VpcConfiguration vpcConfiguration; private java.util.List tags; /** *

* The name of the host to be created. The name must be unique in the calling AWS account. *

* * @param name * The name of the host to be created. The name must be unique in the calling AWS account. */ public void setName(String name) { this.name = name; } /** *

* The name of the host to be created. The name must be unique in the calling AWS account. *

* * @return The name of the host to be created. The name must be unique in the calling AWS account. */ public String getName() { return this.name; } /** *

* The name of the host to be created. The name must be unique in the calling AWS account. *

* * @param name * The name of the host to be created. The name must be unique in the calling AWS account. * @return Returns a reference to this object so that method calls can be chained together. */ public CreateHostRequest withName(String name) { setName(name); return this; } /** *

* The name of the installed provider to be associated with your connection. The host resource represents the * infrastructure where your provider type is installed. The valid provider type is GitHub Enterprise Server. *

* * @param providerType * The name of the installed provider to be associated with your connection. The host resource represents the * infrastructure where your provider type is installed. The valid provider type is GitHub Enterprise Server. * @see ProviderType */ public void setProviderType(String providerType) { this.providerType = providerType; } /** *

* The name of the installed provider to be associated with your connection. The host resource represents the * infrastructure where your provider type is installed. The valid provider type is GitHub Enterprise Server. *

* * @return The name of the installed provider to be associated with your connection. The host resource represents * the infrastructure where your provider type is installed. The valid provider type is GitHub Enterprise * Server. * @see ProviderType */ public String getProviderType() { return this.providerType; } /** *

* The name of the installed provider to be associated with your connection. The host resource represents the * infrastructure where your provider type is installed. The valid provider type is GitHub Enterprise Server. *

* * @param providerType * The name of the installed provider to be associated with your connection. The host resource represents the * infrastructure where your provider type is installed. The valid provider type is GitHub Enterprise Server. * @return Returns a reference to this object so that method calls can be chained together. * @see ProviderType */ public CreateHostRequest withProviderType(String providerType) { setProviderType(providerType); return this; } /** *

* The name of the installed provider to be associated with your connection. The host resource represents the * infrastructure where your provider type is installed. The valid provider type is GitHub Enterprise Server. *

* * @param providerType * The name of the installed provider to be associated with your connection. The host resource represents the * infrastructure where your provider type is installed. The valid provider type is GitHub Enterprise Server. * @return Returns a reference to this object so that method calls can be chained together. * @see ProviderType */ public CreateHostRequest withProviderType(ProviderType providerType) { this.providerType = providerType.toString(); return this; } /** *

* The endpoint of the infrastructure to be represented by the host after it is created. *

* * @param providerEndpoint * The endpoint of the infrastructure to be represented by the host after it is created. */ public void setProviderEndpoint(String providerEndpoint) { this.providerEndpoint = providerEndpoint; } /** *

* The endpoint of the infrastructure to be represented by the host after it is created. *

* * @return The endpoint of the infrastructure to be represented by the host after it is created. */ public String getProviderEndpoint() { return this.providerEndpoint; } /** *

* The endpoint of the infrastructure to be represented by the host after it is created. *

* * @param providerEndpoint * The endpoint of the infrastructure to be represented by the host after it is created. * @return Returns a reference to this object so that method calls can be chained together. */ public CreateHostRequest withProviderEndpoint(String providerEndpoint) { setProviderEndpoint(providerEndpoint); return this; } /** *

* The VPC configuration to be provisioned for the host. A VPC must be configured and the infrastructure to be * represented by the host must already be connected to the VPC. *

* * @param vpcConfiguration * The VPC configuration to be provisioned for the host. A VPC must be configured and the infrastructure to * be represented by the host must already be connected to the VPC. */ public void setVpcConfiguration(VpcConfiguration vpcConfiguration) { this.vpcConfiguration = vpcConfiguration; } /** *

* The VPC configuration to be provisioned for the host. A VPC must be configured and the infrastructure to be * represented by the host must already be connected to the VPC. *

* * @return The VPC configuration to be provisioned for the host. A VPC must be configured and the infrastructure to * be represented by the host must already be connected to the VPC. */ public VpcConfiguration getVpcConfiguration() { return this.vpcConfiguration; } /** *

* The VPC configuration to be provisioned for the host. A VPC must be configured and the infrastructure to be * represented by the host must already be connected to the VPC. *

* * @param vpcConfiguration * The VPC configuration to be provisioned for the host. A VPC must be configured and the infrastructure to * be represented by the host must already be connected to the VPC. * @return Returns a reference to this object so that method calls can be chained together. */ public CreateHostRequest withVpcConfiguration(VpcConfiguration vpcConfiguration) { setVpcConfiguration(vpcConfiguration); return this; } /** * @return */ public java.util.List getTags() { return tags; } /** * @param tags */ public void setTags(java.util.Collection tags) { if (tags == null) { this.tags = null; return; } this.tags = new java.util.ArrayList(tags); } /** *

* NOTE: This method appends the values to the existing list (if any). Use * {@link #setTags(java.util.Collection)} or {@link #withTags(java.util.Collection)} if you want to override the * existing values. *

* * @param tags * @return Returns a reference to this object so that method calls can be chained together. */ public CreateHostRequest withTags(Tag... tags) { if (this.tags == null) { setTags(new java.util.ArrayList(tags.length)); } for (Tag ele : tags) { this.tags.add(ele); } return this; } /** * @param tags * @return Returns a reference to this object so that method calls can be chained together. */ public CreateHostRequest withTags(java.util.Collection tags) { setTags(tags); 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 (getName() != null) sb.append("Name: ").append(getName()).append(","); if (getProviderType() != null) sb.append("ProviderType: ").append(getProviderType()).append(","); if (getProviderEndpoint() != null) sb.append("ProviderEndpoint: ").append(getProviderEndpoint()).append(","); if (getVpcConfiguration() != null) sb.append("VpcConfiguration: ").append(getVpcConfiguration()).append(","); if (getTags() != null) sb.append("Tags: ").append(getTags()); sb.append("}"); return sb.toString(); } @Override public boolean equals(Object obj) { if (this == obj) return true; if (obj == null) return false; if (obj instanceof CreateHostRequest == false) return false; CreateHostRequest other = (CreateHostRequest) obj; if (other.getName() == null ^ this.getName() == null) return false; if (other.getName() != null && other.getName().equals(this.getName()) == false) return false; if (other.getProviderType() == null ^ this.getProviderType() == null) return false; if (other.getProviderType() != null && other.getProviderType().equals(this.getProviderType()) == false) return false; if (other.getProviderEndpoint() == null ^ this.getProviderEndpoint() == null) return false; if (other.getProviderEndpoint() != null && other.getProviderEndpoint().equals(this.getProviderEndpoint()) == false) return false; if (other.getVpcConfiguration() == null ^ this.getVpcConfiguration() == null) return false; if (other.getVpcConfiguration() != null && other.getVpcConfiguration().equals(this.getVpcConfiguration()) == false) return false; if (other.getTags() == null ^ this.getTags() == null) return false; if (other.getTags() != null && other.getTags().equals(this.getTags()) == false) return false; return true; } @Override public int hashCode() { final int prime = 31; int hashCode = 1; hashCode = prime * hashCode + ((getName() == null) ? 0 : getName().hashCode()); hashCode = prime * hashCode + ((getProviderType() == null) ? 0 : getProviderType().hashCode()); hashCode = prime * hashCode + ((getProviderEndpoint() == null) ? 0 : getProviderEndpoint().hashCode()); hashCode = prime * hashCode + ((getVpcConfiguration() == null) ? 0 : getVpcConfiguration().hashCode()); hashCode = prime * hashCode + ((getTags() == null) ? 0 : getTags().hashCode()); return hashCode; } @Override public CreateHostRequest clone() { return (CreateHostRequest) super.clone(); } }