/* * Copyright 2010-2018 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; import java.io.Serializable; /** *
* Describes a reservation. *
*/ public class Reservation implements Serializable { /** * The ID of the reservation. */ private String reservationId; /** * The ID of the AWS account that owns the reservation. */ private String ownerId; /** * The ID of the requester that launched the instances on your behalf * (for example, AWS Management Console or Auto Scaling). */ private String requesterId; /** * [EC2-Classic only] One or more security groups. */ private com.amazonaws.internal.ListWithAutoConstructFlag* Returns a reference to this object so that method calls can be chained together. * * @param reservationId The ID of the reservation. * * @return A reference to this updated object so that method calls can be chained * together. */ public Reservation withReservationId(String reservationId) { this.reservationId = reservationId; return this; } /** * The ID of the AWS account that owns the reservation. * * @return The ID of the AWS account that owns the reservation. */ public String getOwnerId() { return ownerId; } /** * The ID of the AWS account that owns the reservation. * * @param ownerId The ID of the AWS account that owns the reservation. */ public void setOwnerId(String ownerId) { this.ownerId = ownerId; } /** * The ID of the AWS account that owns the reservation. *
* Returns a reference to this object so that method calls can be chained together. * * @param ownerId The ID of the AWS account that owns the reservation. * * @return A reference to this updated object so that method calls can be chained * together. */ public Reservation withOwnerId(String ownerId) { this.ownerId = ownerId; return this; } /** * The ID of the requester that launched the instances on your behalf * (for example, AWS Management Console or Auto Scaling). * * @return The ID of the requester that launched the instances on your behalf * (for example, AWS Management Console or Auto Scaling). */ public String getRequesterId() { return requesterId; } /** * The ID of the requester that launched the instances on your behalf * (for example, AWS Management Console or Auto Scaling). * * @param requesterId The ID of the requester that launched the instances on your behalf * (for example, AWS Management Console or Auto Scaling). */ public void setRequesterId(String requesterId) { this.requesterId = requesterId; } /** * The ID of the requester that launched the instances on your behalf * (for example, AWS Management Console or Auto Scaling). *
* Returns a reference to this object so that method calls can be chained together.
*
* @param requesterId The ID of the requester that launched the instances on your behalf
* (for example, AWS Management Console or Auto Scaling).
*
* @return A reference to this updated object so that method calls can be chained
* together.
*/
public Reservation withRequesterId(String requesterId) {
this.requesterId = requesterId;
return this;
}
/**
* [EC2-Classic only] One or more security groups.
*
* @return [EC2-Classic only] One or more security groups.
*/
public java.util.List
* Returns a reference to this object so that method calls can be chained together.
*
* @param groups [EC2-Classic only] One or more security groups.
*
* @return A reference to this updated object so that method calls can be chained
* together.
*/
public Reservation withGroups(GroupIdentifier... groups) {
if (getGroups() == null) setGroups(new java.util.ArrayList
* Returns a reference to this object so that method calls can be chained together.
*
* @param groups [EC2-Classic only] One or more security groups.
*
* @return A reference to this updated object so that method calls can be chained
* together.
*/
public Reservation withGroups(java.util.Collection
* Returns a reference to this object so that method calls can be chained together.
*
* @param groupNames [EC2-Classic only] One or more security groups.
*
* @return A reference to this updated object so that method calls can be chained
* together.
*/
public Reservation withGroupNames(String... groupNames) {
if (getGroupNames() == null) setGroupNames(new java.util.ArrayList
* Returns a reference to this object so that method calls can be chained together.
*
* @param groupNames [EC2-Classic only] One or more security groups.
*
* @return A reference to this updated object so that method calls can be chained
* together.
*/
public Reservation withGroupNames(java.util.Collection
* Returns a reference to this object so that method calls can be chained together.
*
* @param instances One or more instances.
*
* @return A reference to this updated object so that method calls can be chained
* together.
*/
public Reservation withInstances(Instance... instances) {
if (getInstances() == null) setInstances(new java.util.ArrayList
* Returns a reference to this object so that method calls can be chained together.
*
* @param instances One or more instances.
*
* @return A reference to this updated object so that method calls can be chained
* together.
*/
public Reservation withInstances(java.util.Collection