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.opsworks.model;
 
 
Container for the parameters to the CreateDeployment operation.

Runs deployment or stack commands. For more information, see Deploying Apps and Run Stack Commands .

Required Permissions : To use this action, an IAM user must have a Deploy or Manage permissions level for the stack, or an attached policy that explicitly grants permissions. For more information on user permissions, see Managing User Permissions .

 
 public class CreateDeploymentRequest extends AmazonWebServiceRequest implements SerializableCloneable {

    
The stack ID.
 
     private String stackId;

    
The app ID. This parameter is required for app deployments, but not for other deployment commands.
 
     private String appId;

    
The instance IDs for the deployment targets.
 
A DeploymentCommand object that specifies the deployment command and any associated arguments.
 
     private DeploymentCommand command;

    
A user-defined comment.
 
     private String comment;

    
A string that contains user-defined, custom JSON. It is used to override the corresponding default stack configuration JSON values. The string should be in the following format and must escape characters such as '"'.:

"{\"key1\": \"value1\", \"key2\": \"value2\",...}"

For more information on custom JSON, see Use Custom JSON to Modify the Stack Configuration Attributes.

 
     private String customJson;

    
The stack ID.

Returns:
The stack ID.
 
     public String getStackId() {
         return ;
     }
    
    
The stack ID.

Parameters:
stackId The stack ID.
 
     public void setStackId(String stackId) {
         this. = stackId;
     }
    
    
The stack ID.

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

Parameters:
stackId The stack ID.
Returns:
A reference to this updated object so that method calls can be chained together.
    public CreateDeploymentRequest withStackId(String stackId) {
        this. = stackId;
        return this;
    }

    
The app ID. This parameter is required for app deployments, but not for other deployment commands.

Returns:
The app ID. This parameter is required for app deployments, but not for other deployment commands.
    public String getAppId() {
        return ;
    }
    
    
The app ID. This parameter is required for app deployments, but not for other deployment commands.

Parameters:
appId The app ID. This parameter is required for app deployments, but not for other deployment commands.
    public void setAppId(String appId) {
        this. = appId;
    }
    
    
The app ID. This parameter is required for app deployments, but not for other deployment commands.

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

Parameters:
appId The app ID. This parameter is required for app deployments, but not for other deployment commands.
Returns:
A reference to this updated object so that method calls can be chained together.
    public CreateDeploymentRequest withAppId(String appId) {
        this. = appId;
        return this;
    }

    
The instance IDs for the deployment targets.

Returns:
The instance IDs for the deployment targets.
    public java.util.List<StringgetInstanceIds() {
        if ( == null) {
               = new com.amazonaws.internal.ListWithAutoConstructFlag<String>();
              .setAutoConstruct(true);
        }
        return ;
    }
    
    
The instance IDs for the deployment targets.

Parameters:
instanceIds The instance IDs for the deployment targets.
    public void setInstanceIds(java.util.Collection<StringinstanceIds) {
        if (instanceIds == null) {
            this. = null;
            return;
        }
        instanceIdsCopy.addAll(instanceIds);
        this. = instanceIdsCopy;
    }
    
    
The instance IDs for the deployment targets.

NOTE: This method appends the values to the existing list (if any). Use setInstanceIds(java.util.Collection) or withInstanceIds(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:
instanceIds The instance IDs for the deployment targets.
Returns:
A reference to this updated object so that method calls can be chained together.
    public CreateDeploymentRequest withInstanceIds(String... instanceIds) {
        if (getInstanceIds() == nullsetInstanceIds(new java.util.ArrayList<String>(instanceIds.length));
        for (String value : instanceIds) {
            getInstanceIds().add(value);
        }
        return this;
    }
    
    
The instance IDs for the deployment targets.

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

Parameters:
instanceIds The instance IDs for the deployment targets.
Returns:
A reference to this updated object so that method calls can be chained together.
        if (instanceIds == null) {
            this. = null;
        } else {
            com.amazonaws.internal.ListWithAutoConstructFlag<StringinstanceIdsCopy = new com.amazonaws.internal.ListWithAutoConstructFlag<String>(instanceIds.size());
            instanceIdsCopy.addAll(instanceIds);
            this. = instanceIdsCopy;
        }
        return this;
    }

    
A DeploymentCommand object that specifies the deployment command and any associated arguments.

Returns:
A DeploymentCommand object that specifies the deployment command and any associated arguments.
    public DeploymentCommand getCommand() {
        return ;
    }
    
    
A DeploymentCommand object that specifies the deployment command and any associated arguments.

Parameters:
command A DeploymentCommand object that specifies the deployment command and any associated arguments.
    public void setCommand(DeploymentCommand command) {
        this. = command;
    }
    
    
A DeploymentCommand object that specifies the deployment command and any associated arguments.

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

Parameters:
command A DeploymentCommand object that specifies the deployment command and any associated arguments.
Returns:
A reference to this updated object so that method calls can be chained together.
        this. = command;
        return this;
    }

    
A user-defined comment.

Returns:
A user-defined comment.
    public String getComment() {
        return ;
    }
    
    
A user-defined comment.

Parameters:
comment A user-defined comment.
    public void setComment(String comment) {
        this. = comment;
    }
    
    
A user-defined comment.

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

Parameters:
comment A user-defined comment.
Returns:
A reference to this updated object so that method calls can be chained together.
    public CreateDeploymentRequest withComment(String comment) {
        this. = comment;
        return this;
    }

    
A string that contains user-defined, custom JSON. It is used to override the corresponding default stack configuration JSON values. The string should be in the following format and must escape characters such as '"'.:

"{\"key1\": \"value1\", \"key2\": \"value2\",...}"

For more information on custom JSON, see Use Custom JSON to Modify the Stack Configuration Attributes.

Returns:
A string that contains user-defined, custom JSON. It is used to override the corresponding default stack configuration JSON values. The string should be in the following format and must escape characters such as '"'.:

"{\"key1\": \"value1\", \"key2\": \"value2\",...}"

For more information on custom JSON, see Use Custom JSON to Modify the Stack Configuration Attributes.

    public String getCustomJson() {
        return ;
    }
    
    
A string that contains user-defined, custom JSON. It is used to override the corresponding default stack configuration JSON values. The string should be in the following format and must escape characters such as '"'.:

"{\"key1\": \"value1\", \"key2\": \"value2\",...}"

For more information on custom JSON, see Use Custom JSON to Modify the Stack Configuration Attributes.

Parameters:
customJson A string that contains user-defined, custom JSON. It is used to override the corresponding default stack configuration JSON values. The string should be in the following format and must escape characters such as '"'.:

"{\"key1\": \"value1\", \"key2\": \"value2\",...}"

For more information on custom JSON, see Use Custom JSON to Modify the Stack Configuration Attributes.

    public void setCustomJson(String customJson) {
        this. = customJson;
    }
    
    
A string that contains user-defined, custom JSON. It is used to override the corresponding default stack configuration JSON values. The string should be in the following format and must escape characters such as '"'.:

"{\"key1\": \"value1\", \"key2\": \"value2\",...}"

For more information on custom JSON, see Use Custom JSON to Modify the Stack Configuration Attributes.

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

Parameters:
customJson A string that contains user-defined, custom JSON. It is used to override the corresponding default stack configuration JSON values. The string should be in the following format and must escape characters such as '"'.:

"{\"key1\": \"value1\", \"key2\": \"value2\",...}"

For more information on custom JSON, see Use Custom JSON to Modify the Stack Configuration Attributes.

Returns:
A reference to this updated object so that method calls can be chained together.
    public CreateDeploymentRequest withCustomJson(String customJson) {
        this. = customJson;
        return this;
    }

    
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 (getStackId() != nullsb.append("StackId: " + getStackId() + ",");
        if (getAppId() != nullsb.append("AppId: " + getAppId() + ",");
        if (getInstanceIds() != nullsb.append("InstanceIds: " + getInstanceIds() + ",");
        if (getCommand() != nullsb.append("Command: " + getCommand() + ",");
        if (getComment() != nullsb.append("Comment: " + getComment() + ",");
        if (getCustomJson() != nullsb.append("CustomJson: " + getCustomJson() );
        sb.append("}");
        return sb.toString();
    }
    
    @Override
    public int hashCode() {
        final int prime = 31;
        int hashCode = 1;
        
        hashCode = prime * hashCode + ((getStackId() == null) ? 0 : getStackId().hashCode()); 
        hashCode = prime * hashCode + ((getAppId() == null) ? 0 : getAppId().hashCode()); 
        hashCode = prime * hashCode + ((getInstanceIds() == null) ? 0 : getInstanceIds().hashCode()); 
        hashCode = prime * hashCode + ((getCommand() == null) ? 0 : getCommand().hashCode()); 
        hashCode = prime * hashCode + ((getComment() == null) ? 0 : getComment().hashCode()); 
        hashCode = prime * hashCode + ((getCustomJson() == null) ? 0 : getCustomJson().hashCode()); 
        return hashCode;
    }
    
    @Override
    public boolean equals(Object obj) {
        if (this == objreturn true;
        if (obj == nullreturn false;
        if (obj instanceof CreateDeploymentRequest == falsereturn false;
        CreateDeploymentRequest other = (CreateDeploymentRequest)obj;
        
        if (other.getStackId() == null ^ this.getStackId() == nullreturn false;
        if (other.getStackId() != null && other.getStackId().equals(this.getStackId()) == falsereturn false
        if (other.getAppId() == null ^ this.getAppId() == nullreturn false;
        if (other.getAppId() != null && other.getAppId().equals(this.getAppId()) == falsereturn false
        if (other.getInstanceIds() == null ^ this.getInstanceIds() == nullreturn false;
        if (other.getInstanceIds() != null && other.getInstanceIds().equals(this.getInstanceIds()) == falsereturn false
        if (other.getCommand() == null ^ this.getCommand() == nullreturn false;
        if (other.getCommand() != null && other.getCommand().equals(this.getCommand()) == falsereturn false
        if (other.getComment() == null ^ this.getComment() == nullreturn false;
        if (other.getComment() != null && other.getComment().equals(this.getComment()) == falsereturn false
        if (other.getCustomJson() == null ^ this.getCustomJson() == nullreturn false;
        if (other.getCustomJson() != null && other.getCustomJson().equals(this.getCustomJson()) == falsereturn false
        return true;
    }
    
    @Override
    public CreateDeploymentRequest clone() {
        
            return (CreateDeploymentRequestsuper.clone();
    }
}
    
New to GrepCode? Check out our FAQ X