Start line:  
End line:  

Snippet Preview

Snippet HTML Code

Stack Overflow Questions
  /*
   * Copyright 2010-2015 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.ec2.model;
 
 
Container for the parameters to the CreateVpcEndpoint operation.

Creates a VPC endpoint for a specified AWS service. An endpoint enables you to create a private connection between your VPC and another AWS service in your account. You can specify an endpoint policy to attach to the endpoint that will control access to the service from your VPC. You can also specify the VPC route tables that use the endpoint.

Currently, only endpoints to Amazon S3 are supported.

 
The ID of the VPC in which the endpoint will be used.
 
     private String vpcId;

    
The AWS service name, in the form com.amazonaws.<region>.<service>. To get a list of available services, use the DescribeVpcEndpointServices request.
 
     private String serviceName;

    
A policy to attach to the endpoint that controls access to the service. The policy must be in valid JSON format. If this parameter is not specified, we attach a default policy that allows full access to the service.
 
     private String policyDocument;

    
One or more route table IDs.
 
Unique, case-sensitive identifier you provide to ensure the idempotency of the request. For more information, see How to Ensure Idempotency.
 
     private String clientToken;

    
The ID of the VPC in which the endpoint will be used.

Returns:
The ID of the VPC in which the endpoint will be used.
 
     public String getVpcId() {
         return ;
     }
    
    
The ID of the VPC in which the endpoint will be used.

Parameters:
vpcId The ID of the VPC in which the endpoint will be used.
 
     public void setVpcId(String vpcId) {
         this. = vpcId;
     }
    
    
The ID of the VPC in which the endpoint will be used.

Returns a reference to this object so that method calls can be chained together.

Parameters:
vpcId The ID of the VPC in which the endpoint will be used.
Returns:
A reference to this updated object so that method calls can be chained together.
    public CreateVpcEndpointRequest withVpcId(String vpcId) {
        this. = vpcId;
        return this;
    }

    
The AWS service name, in the form com.amazonaws.<region>.<service>. To get a list of available services, use the DescribeVpcEndpointServices request.

Returns:
The AWS service name, in the form com.amazonaws.<region>.<service>. To get a list of available services, use the DescribeVpcEndpointServices request.
    public String getServiceName() {
        return ;
    }
    
    
The AWS service name, in the form com.amazonaws.<region>.<service>. To get a list of available services, use the DescribeVpcEndpointServices request.

Parameters:
serviceName The AWS service name, in the form com.amazonaws.<region>.<service>. To get a list of available services, use the DescribeVpcEndpointServices request.
    public void setServiceName(String serviceName) {
        this. = serviceName;
    }
    
    
The AWS service name, in the form com.amazonaws.<region>.<service>. To get a list of available services, use the DescribeVpcEndpointServices request.

Returns a reference to this object so that method calls can be chained together.

Parameters:
serviceName The AWS service name, in the form com.amazonaws.<region>.<service>. To get a list of available services, use the DescribeVpcEndpointServices request.
Returns:
A reference to this updated object so that method calls can be chained together.
    public CreateVpcEndpointRequest withServiceName(String serviceName) {
        this. = serviceName;
        return this;
    }

    
A policy to attach to the endpoint that controls access to the service. The policy must be in valid JSON format. If this parameter is not specified, we attach a default policy that allows full access to the service.

Returns:
A policy to attach to the endpoint that controls access to the service. The policy must be in valid JSON format. If this parameter is not specified, we attach a default policy that allows full access to the service.
    public String getPolicyDocument() {
        return ;
    }
    
    
A policy to attach to the endpoint that controls access to the service. The policy must be in valid JSON format. If this parameter is not specified, we attach a default policy that allows full access to the service.

Parameters:
policyDocument A policy to attach to the endpoint that controls access to the service. The policy must be in valid JSON format. If this parameter is not specified, we attach a default policy that allows full access to the service.
    public void setPolicyDocument(String policyDocument) {
        this. = policyDocument;
    }
    
    
A policy to attach to the endpoint that controls access to the service. The policy must be in valid JSON format. If this parameter is not specified, we attach a default policy that allows full access to the service.

Returns a reference to this object so that method calls can be chained together.

Parameters:
policyDocument A policy to attach to the endpoint that controls access to the service. The policy must be in valid JSON format. If this parameter is not specified, we attach a default policy that allows full access to the service.
Returns:
A reference to this updated object so that method calls can be chained together.
    public CreateVpcEndpointRequest withPolicyDocument(String policyDocument) {
        this. = policyDocument;
        return this;
    }

    
One or more route table IDs.

Returns:
One or more route table IDs.
    public java.util.List<StringgetRouteTableIds() {
        if ( == null) {
               = new com.amazonaws.internal.ListWithAutoConstructFlag<String>();
              .setAutoConstruct(true);
        }
        return ;
    }
    
    
One or more route table IDs.

Parameters:
routeTableIds One or more route table IDs.
    public void setRouteTableIds(java.util.Collection<StringrouteTableIds) {
        if (routeTableIds == null) {
            this. = null;
            return;
        }
        com.amazonaws.internal.ListWithAutoConstructFlag<StringrouteTableIdsCopy = new com.amazonaws.internal.ListWithAutoConstructFlag<String>(routeTableIds.size());
        routeTableIdsCopy.addAll(routeTableIds);
        this. = routeTableIdsCopy;
    }
    
    
One or more route table IDs.

NOTE: This method appends the values to the existing list (if any). Use setRouteTableIds(java.util.Collection) or withRouteTableIds(java.util.Collection) if you want to override the existing values.

Returns a reference to this object so that method calls can be chained together.

Parameters:
routeTableIds One or more route table IDs.
Returns:
A reference to this updated object so that method calls can be chained together.
    public CreateVpcEndpointRequest withRouteTableIds(String... routeTableIds) {
        if (getRouteTableIds() == nullsetRouteTableIds(new java.util.ArrayList<String>(routeTableIds.length));
        for (String value : routeTableIds) {
            getRouteTableIds().add(value);
        }
        return this;
    }
    
    
One or more route table IDs.

Returns a reference to this object so that method calls can be chained together.

Parameters:
routeTableIds One or more route table IDs.
Returns:
A reference to this updated object so that method calls can be chained together.
        if (routeTableIds == null) {
            this. = null;
        } else {
            com.amazonaws.internal.ListWithAutoConstructFlag<StringrouteTableIdsCopy = new com.amazonaws.internal.ListWithAutoConstructFlag<String>(routeTableIds.size());
            routeTableIdsCopy.addAll(routeTableIds);
            this. = routeTableIdsCopy;
        }
        return this;
    }

    
Unique, case-sensitive identifier you provide to ensure the idempotency of the request. For more information, see How to Ensure Idempotency.

Returns:
Unique, case-sensitive identifier you provide to ensure the idempotency of the request. For more information, see How to Ensure Idempotency.
    public String getClientToken() {
        return ;
    }
    
    
Unique, case-sensitive identifier you provide to ensure the idempotency of the request. For more information, see How to Ensure Idempotency.

Parameters:
clientToken Unique, case-sensitive identifier you provide to ensure the idempotency of the request. For more information, see How to Ensure Idempotency.
    public void setClientToken(String clientToken) {
        this. = clientToken;
    }
    
    
Unique, case-sensitive identifier you provide to ensure the idempotency of the request. For more information, see How to Ensure Idempotency.

Returns a reference to this object so that method calls can be chained together.

Parameters:
clientToken Unique, case-sensitive identifier you provide to ensure the idempotency of the request. For more information, see How to Ensure Idempotency.
Returns:
A reference to this updated object so that method calls can be chained together.
    public CreateVpcEndpointRequest withClientToken(String clientToken) {
        this. = clientToken;
        return this;
    }

    
This method is intended for internal use only. Returns the marshaled request configured with additional parameters to enable operation dry-run.
    @Override
        request.addParameter("DryRun", Boolean.toString(true));
        return request;
    }
    
    
Returns a string representation of this object; useful for testing and debugging.

Returns:
A string representation of this object.
See also:
java.lang.Object.toString()
    @Override
    public String toString() {
        StringBuilder sb = new StringBuilder();
        sb.append("{");
        if (getVpcId() != nullsb.append("VpcId: " + getVpcId() + ",");
        if (getServiceName() != nullsb.append("ServiceName: " + getServiceName() + ",");
        if (getPolicyDocument() != nullsb.append("PolicyDocument: " + getPolicyDocument() + ",");
        if (getRouteTableIds() != nullsb.append("RouteTableIds: " + getRouteTableIds() + ",");
        if (getClientToken() != nullsb.append("ClientToken: " + getClientToken() );
        sb.append("}");
        return sb.toString();
    }
    
    @Override
    public int hashCode() {
        final int prime = 31;
        int hashCode = 1;
        
        hashCode = prime * hashCode + ((getVpcId() == null) ? 0 : getVpcId().hashCode()); 
        hashCode = prime * hashCode + ((getServiceName() == null) ? 0 : getServiceName().hashCode()); 
        hashCode = prime * hashCode + ((getPolicyDocument() == null) ? 0 : getPolicyDocument().hashCode()); 
        hashCode = prime * hashCode + ((getRouteTableIds() == null) ? 0 : getRouteTableIds().hashCode()); 
        hashCode = prime * hashCode + ((getClientToken() == null) ? 0 : getClientToken().hashCode()); 
        return hashCode;
    }
    
    @Override
    public boolean equals(Object obj) {
        if (this == objreturn true;
        if (obj == nullreturn false;
        if (obj instanceof CreateVpcEndpointRequest == falsereturn false;
        CreateVpcEndpointRequest other = (CreateVpcEndpointRequest)obj;
        
        if (other.getVpcId() == null ^ this.getVpcId() == nullreturn false;
        if (other.getVpcId() != null && other.getVpcId().equals(this.getVpcId()) == falsereturn false
        if (other.getServiceName() == null ^ this.getServiceName() == nullreturn false;
        if (other.getServiceName() != null && other.getServiceName().equals(this.getServiceName()) == falsereturn false
        if (other.getPolicyDocument() == null ^ this.getPolicyDocument() == nullreturn false;
        if (other.getPolicyDocument() != null && other.getPolicyDocument().equals(this.getPolicyDocument()) == falsereturn false
        if (other.getRouteTableIds() == null ^ this.getRouteTableIds() == nullreturn false;
        if (other.getRouteTableIds() != null && other.getRouteTableIds().equals(this.getRouteTableIds()) == falsereturn false
        if (other.getClientToken() == null ^ this.getClientToken() == nullreturn false;
        if (other.getClientToken() != null && other.getClientToken().equals(this.getClientToken()) == falsereturn false
        return true;
    }
    
    @Override
    public CreateVpcEndpointRequest clone() {
        
            return (CreateVpcEndpointRequestsuper.clone();
    }
}
    
New to GrepCode? Check out our FAQ X