All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.amazonaws.services.ec2.model.ModifyTrafficMirrorSessionRequest Maven / Gradle / Ivy

Go to download

The AWS Java SDK for Amazon EC2 module holds the client classes that are used for communicating with Amazon EC2 Service

There is a newer version: 1.12.778
Show newest version
/*
 * Copyright 2019-2024 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;
import javax.annotation.Generated;

import com.amazonaws.AmazonWebServiceRequest;
import com.amazonaws.Request;
import com.amazonaws.services.ec2.model.transform.ModifyTrafficMirrorSessionRequestMarshaller;

/**
 * 
 */
@Generated("com.amazonaws:aws-java-sdk-code-generator")
public class ModifyTrafficMirrorSessionRequest extends AmazonWebServiceRequest implements Serializable, Cloneable,
        DryRunSupportedRequest {

    /**
     * 

* The ID of the Traffic Mirror session. *

*/ private String trafficMirrorSessionId; /** *

* The Traffic Mirror target. The target must be in the same VPC as the source, or have a VPC peering connection * with the source. *

*/ private String trafficMirrorTargetId; /** *

* The ID of the Traffic Mirror filter. *

*/ private String trafficMirrorFilterId; /** *

* The number of bytes in each packet to mirror. These are bytes after the VXLAN header. To mirror a subset, set * this to the length (in bytes) to mirror. For example, if you set this value to 100, then the first 100 bytes that * meet the filter criteria are copied to the target. Do not specify this parameter when you want to mirror the * entire packet. *

*

* For sessions with Network Load Balancer (NLB) traffic mirror targets, the default PacketLength will * be set to 8500. Valid values are 1-8500. Setting a PacketLength greater than 8500 will result in an * error response. *

*/ private Integer packetLength; /** *

* The session number determines the order in which sessions are evaluated when an interface is used by multiple * sessions. The first session with a matching filter is the one that mirrors the packets. *

*

* Valid values are 1-32766. *

*/ private Integer sessionNumber; /** *

* The virtual network ID of the Traffic Mirror session. *

*/ private Integer virtualNetworkId; /** *

* The description to assign to the Traffic Mirror session. *

*/ private String description; /** *

* The properties that you want to remove from the Traffic Mirror session. *

*

* When you remove a property from a Traffic Mirror session, the property is set to the default. *

*/ private com.amazonaws.internal.SdkInternalList removeFields; /** *

* The ID of the Traffic Mirror session. *

* * @param trafficMirrorSessionId * The ID of the Traffic Mirror session. */ public void setTrafficMirrorSessionId(String trafficMirrorSessionId) { this.trafficMirrorSessionId = trafficMirrorSessionId; } /** *

* The ID of the Traffic Mirror session. *

* * @return The ID of the Traffic Mirror session. */ public String getTrafficMirrorSessionId() { return this.trafficMirrorSessionId; } /** *

* The ID of the Traffic Mirror session. *

* * @param trafficMirrorSessionId * The ID of the Traffic Mirror session. * @return Returns a reference to this object so that method calls can be chained together. */ public ModifyTrafficMirrorSessionRequest withTrafficMirrorSessionId(String trafficMirrorSessionId) { setTrafficMirrorSessionId(trafficMirrorSessionId); return this; } /** *

* The Traffic Mirror target. The target must be in the same VPC as the source, or have a VPC peering connection * with the source. *

* * @param trafficMirrorTargetId * The Traffic Mirror target. The target must be in the same VPC as the source, or have a VPC peering * connection with the source. */ public void setTrafficMirrorTargetId(String trafficMirrorTargetId) { this.trafficMirrorTargetId = trafficMirrorTargetId; } /** *

* The Traffic Mirror target. The target must be in the same VPC as the source, or have a VPC peering connection * with the source. *

* * @return The Traffic Mirror target. The target must be in the same VPC as the source, or have a VPC peering * connection with the source. */ public String getTrafficMirrorTargetId() { return this.trafficMirrorTargetId; } /** *

* The Traffic Mirror target. The target must be in the same VPC as the source, or have a VPC peering connection * with the source. *

* * @param trafficMirrorTargetId * The Traffic Mirror target. The target must be in the same VPC as the source, or have a VPC peering * connection with the source. * @return Returns a reference to this object so that method calls can be chained together. */ public ModifyTrafficMirrorSessionRequest withTrafficMirrorTargetId(String trafficMirrorTargetId) { setTrafficMirrorTargetId(trafficMirrorTargetId); return this; } /** *

* The ID of the Traffic Mirror filter. *

* * @param trafficMirrorFilterId * The ID of the Traffic Mirror filter. */ public void setTrafficMirrorFilterId(String trafficMirrorFilterId) { this.trafficMirrorFilterId = trafficMirrorFilterId; } /** *

* The ID of the Traffic Mirror filter. *

* * @return The ID of the Traffic Mirror filter. */ public String getTrafficMirrorFilterId() { return this.trafficMirrorFilterId; } /** *

* The ID of the Traffic Mirror filter. *

* * @param trafficMirrorFilterId * The ID of the Traffic Mirror filter. * @return Returns a reference to this object so that method calls can be chained together. */ public ModifyTrafficMirrorSessionRequest withTrafficMirrorFilterId(String trafficMirrorFilterId) { setTrafficMirrorFilterId(trafficMirrorFilterId); return this; } /** *

* The number of bytes in each packet to mirror. These are bytes after the VXLAN header. To mirror a subset, set * this to the length (in bytes) to mirror. For example, if you set this value to 100, then the first 100 bytes that * meet the filter criteria are copied to the target. Do not specify this parameter when you want to mirror the * entire packet. *

*

* For sessions with Network Load Balancer (NLB) traffic mirror targets, the default PacketLength will * be set to 8500. Valid values are 1-8500. Setting a PacketLength greater than 8500 will result in an * error response. *

* * @param packetLength * The number of bytes in each packet to mirror. These are bytes after the VXLAN header. To mirror a subset, * set this to the length (in bytes) to mirror. For example, if you set this value to 100, then the first 100 * bytes that meet the filter criteria are copied to the target. Do not specify this parameter when you want * to mirror the entire packet.

*

* For sessions with Network Load Balancer (NLB) traffic mirror targets, the default * PacketLength will be set to 8500. Valid values are 1-8500. Setting a * PacketLength greater than 8500 will result in an error response. */ public void setPacketLength(Integer packetLength) { this.packetLength = packetLength; } /** *

* The number of bytes in each packet to mirror. These are bytes after the VXLAN header. To mirror a subset, set * this to the length (in bytes) to mirror. For example, if you set this value to 100, then the first 100 bytes that * meet the filter criteria are copied to the target. Do not specify this parameter when you want to mirror the * entire packet. *

*

* For sessions with Network Load Balancer (NLB) traffic mirror targets, the default PacketLength will * be set to 8500. Valid values are 1-8500. Setting a PacketLength greater than 8500 will result in an * error response. *

* * @return The number of bytes in each packet to mirror. These are bytes after the VXLAN header. To mirror a subset, * set this to the length (in bytes) to mirror. For example, if you set this value to 100, then the first * 100 bytes that meet the filter criteria are copied to the target. Do not specify this parameter when you * want to mirror the entire packet.

*

* For sessions with Network Load Balancer (NLB) traffic mirror targets, the default * PacketLength will be set to 8500. Valid values are 1-8500. Setting a * PacketLength greater than 8500 will result in an error response. */ public Integer getPacketLength() { return this.packetLength; } /** *

* The number of bytes in each packet to mirror. These are bytes after the VXLAN header. To mirror a subset, set * this to the length (in bytes) to mirror. For example, if you set this value to 100, then the first 100 bytes that * meet the filter criteria are copied to the target. Do not specify this parameter when you want to mirror the * entire packet. *

*

* For sessions with Network Load Balancer (NLB) traffic mirror targets, the default PacketLength will * be set to 8500. Valid values are 1-8500. Setting a PacketLength greater than 8500 will result in an * error response. *

* * @param packetLength * The number of bytes in each packet to mirror. These are bytes after the VXLAN header. To mirror a subset, * set this to the length (in bytes) to mirror. For example, if you set this value to 100, then the first 100 * bytes that meet the filter criteria are copied to the target. Do not specify this parameter when you want * to mirror the entire packet.

*

* For sessions with Network Load Balancer (NLB) traffic mirror targets, the default * PacketLength will be set to 8500. Valid values are 1-8500. Setting a * PacketLength greater than 8500 will result in an error response. * @return Returns a reference to this object so that method calls can be chained together. */ public ModifyTrafficMirrorSessionRequest withPacketLength(Integer packetLength) { setPacketLength(packetLength); return this; } /** *

* The session number determines the order in which sessions are evaluated when an interface is used by multiple * sessions. The first session with a matching filter is the one that mirrors the packets. *

*

* Valid values are 1-32766. *

* * @param sessionNumber * The session number determines the order in which sessions are evaluated when an interface is used by * multiple sessions. The first session with a matching filter is the one that mirrors the packets.

*

* Valid values are 1-32766. */ public void setSessionNumber(Integer sessionNumber) { this.sessionNumber = sessionNumber; } /** *

* The session number determines the order in which sessions are evaluated when an interface is used by multiple * sessions. The first session with a matching filter is the one that mirrors the packets. *

*

* Valid values are 1-32766. *

* * @return The session number determines the order in which sessions are evaluated when an interface is used by * multiple sessions. The first session with a matching filter is the one that mirrors the packets.

*

* Valid values are 1-32766. */ public Integer getSessionNumber() { return this.sessionNumber; } /** *

* The session number determines the order in which sessions are evaluated when an interface is used by multiple * sessions. The first session with a matching filter is the one that mirrors the packets. *

*

* Valid values are 1-32766. *

* * @param sessionNumber * The session number determines the order in which sessions are evaluated when an interface is used by * multiple sessions. The first session with a matching filter is the one that mirrors the packets.

*

* Valid values are 1-32766. * @return Returns a reference to this object so that method calls can be chained together. */ public ModifyTrafficMirrorSessionRequest withSessionNumber(Integer sessionNumber) { setSessionNumber(sessionNumber); return this; } /** *

* The virtual network ID of the Traffic Mirror session. *

* * @param virtualNetworkId * The virtual network ID of the Traffic Mirror session. */ public void setVirtualNetworkId(Integer virtualNetworkId) { this.virtualNetworkId = virtualNetworkId; } /** *

* The virtual network ID of the Traffic Mirror session. *

* * @return The virtual network ID of the Traffic Mirror session. */ public Integer getVirtualNetworkId() { return this.virtualNetworkId; } /** *

* The virtual network ID of the Traffic Mirror session. *

* * @param virtualNetworkId * The virtual network ID of the Traffic Mirror session. * @return Returns a reference to this object so that method calls can be chained together. */ public ModifyTrafficMirrorSessionRequest withVirtualNetworkId(Integer virtualNetworkId) { setVirtualNetworkId(virtualNetworkId); return this; } /** *

* The description to assign to the Traffic Mirror session. *

* * @param description * The description to assign to the Traffic Mirror session. */ public void setDescription(String description) { this.description = description; } /** *

* The description to assign to the Traffic Mirror session. *

* * @return The description to assign to the Traffic Mirror session. */ public String getDescription() { return this.description; } /** *

* The description to assign to the Traffic Mirror session. *

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

* The properties that you want to remove from the Traffic Mirror session. *

*

* When you remove a property from a Traffic Mirror session, the property is set to the default. *

* * @return The properties that you want to remove from the Traffic Mirror session.

*

* When you remove a property from a Traffic Mirror session, the property is set to the default. * @see TrafficMirrorSessionField */ public java.util.List getRemoveFields() { if (removeFields == null) { removeFields = new com.amazonaws.internal.SdkInternalList(); } return removeFields; } /** *

* The properties that you want to remove from the Traffic Mirror session. *

*

* When you remove a property from a Traffic Mirror session, the property is set to the default. *

* * @param removeFields * The properties that you want to remove from the Traffic Mirror session.

*

* When you remove a property from a Traffic Mirror session, the property is set to the default. * @see TrafficMirrorSessionField */ public void setRemoveFields(java.util.Collection removeFields) { if (removeFields == null) { this.removeFields = null; return; } this.removeFields = new com.amazonaws.internal.SdkInternalList(removeFields); } /** *

* The properties that you want to remove from the Traffic Mirror session. *

*

* When you remove a property from a Traffic Mirror session, the property is set to the default. *

*

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

* * @param removeFields * The properties that you want to remove from the Traffic Mirror session.

*

* When you remove a property from a Traffic Mirror session, the property is set to the default. * @return Returns a reference to this object so that method calls can be chained together. * @see TrafficMirrorSessionField */ public ModifyTrafficMirrorSessionRequest withRemoveFields(String... removeFields) { if (this.removeFields == null) { setRemoveFields(new com.amazonaws.internal.SdkInternalList(removeFields.length)); } for (String ele : removeFields) { this.removeFields.add(ele); } return this; } /** *

* The properties that you want to remove from the Traffic Mirror session. *

*

* When you remove a property from a Traffic Mirror session, the property is set to the default. *

* * @param removeFields * The properties that you want to remove from the Traffic Mirror session.

*

* When you remove a property from a Traffic Mirror session, the property is set to the default. * @return Returns a reference to this object so that method calls can be chained together. * @see TrafficMirrorSessionField */ public ModifyTrafficMirrorSessionRequest withRemoveFields(java.util.Collection removeFields) { setRemoveFields(removeFields); return this; } /** *

* The properties that you want to remove from the Traffic Mirror session. *

*

* When you remove a property from a Traffic Mirror session, the property is set to the default. *

* * @param removeFields * The properties that you want to remove from the Traffic Mirror session.

*

* When you remove a property from a Traffic Mirror session, the property is set to the default. * @return Returns a reference to this object so that method calls can be chained together. * @see TrafficMirrorSessionField */ public ModifyTrafficMirrorSessionRequest withRemoveFields(TrafficMirrorSessionField... removeFields) { com.amazonaws.internal.SdkInternalList removeFieldsCopy = new com.amazonaws.internal.SdkInternalList(removeFields.length); for (TrafficMirrorSessionField value : removeFields) { removeFieldsCopy.add(value.toString()); } if (getRemoveFields() == null) { setRemoveFields(removeFieldsCopy); } else { getRemoveFields().addAll(removeFieldsCopy); } return this; } /** * This method is intended for internal use only. Returns the marshaled request configured with additional * parameters to enable operation dry-run. */ @Override public Request getDryRunRequest() { Request request = new ModifyTrafficMirrorSessionRequestMarshaller().marshall(this); request.addParameter("DryRun", Boolean.toString(true)); return request; } /** * 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 (getTrafficMirrorSessionId() != null) sb.append("TrafficMirrorSessionId: ").append(getTrafficMirrorSessionId()).append(","); if (getTrafficMirrorTargetId() != null) sb.append("TrafficMirrorTargetId: ").append(getTrafficMirrorTargetId()).append(","); if (getTrafficMirrorFilterId() != null) sb.append("TrafficMirrorFilterId: ").append(getTrafficMirrorFilterId()).append(","); if (getPacketLength() != null) sb.append("PacketLength: ").append(getPacketLength()).append(","); if (getSessionNumber() != null) sb.append("SessionNumber: ").append(getSessionNumber()).append(","); if (getVirtualNetworkId() != null) sb.append("VirtualNetworkId: ").append(getVirtualNetworkId()).append(","); if (getDescription() != null) sb.append("Description: ").append(getDescription()).append(","); if (getRemoveFields() != null) sb.append("RemoveFields: ").append(getRemoveFields()); sb.append("}"); return sb.toString(); } @Override public boolean equals(Object obj) { if (this == obj) return true; if (obj == null) return false; if (obj instanceof ModifyTrafficMirrorSessionRequest == false) return false; ModifyTrafficMirrorSessionRequest other = (ModifyTrafficMirrorSessionRequest) obj; if (other.getTrafficMirrorSessionId() == null ^ this.getTrafficMirrorSessionId() == null) return false; if (other.getTrafficMirrorSessionId() != null && other.getTrafficMirrorSessionId().equals(this.getTrafficMirrorSessionId()) == false) return false; if (other.getTrafficMirrorTargetId() == null ^ this.getTrafficMirrorTargetId() == null) return false; if (other.getTrafficMirrorTargetId() != null && other.getTrafficMirrorTargetId().equals(this.getTrafficMirrorTargetId()) == false) return false; if (other.getTrafficMirrorFilterId() == null ^ this.getTrafficMirrorFilterId() == null) return false; if (other.getTrafficMirrorFilterId() != null && other.getTrafficMirrorFilterId().equals(this.getTrafficMirrorFilterId()) == false) return false; if (other.getPacketLength() == null ^ this.getPacketLength() == null) return false; if (other.getPacketLength() != null && other.getPacketLength().equals(this.getPacketLength()) == false) return false; if (other.getSessionNumber() == null ^ this.getSessionNumber() == null) return false; if (other.getSessionNumber() != null && other.getSessionNumber().equals(this.getSessionNumber()) == false) return false; if (other.getVirtualNetworkId() == null ^ this.getVirtualNetworkId() == null) return false; if (other.getVirtualNetworkId() != null && other.getVirtualNetworkId().equals(this.getVirtualNetworkId()) == 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.getRemoveFields() == null ^ this.getRemoveFields() == null) return false; if (other.getRemoveFields() != null && other.getRemoveFields().equals(this.getRemoveFields()) == false) return false; return true; } @Override public int hashCode() { final int prime = 31; int hashCode = 1; hashCode = prime * hashCode + ((getTrafficMirrorSessionId() == null) ? 0 : getTrafficMirrorSessionId().hashCode()); hashCode = prime * hashCode + ((getTrafficMirrorTargetId() == null) ? 0 : getTrafficMirrorTargetId().hashCode()); hashCode = prime * hashCode + ((getTrafficMirrorFilterId() == null) ? 0 : getTrafficMirrorFilterId().hashCode()); hashCode = prime * hashCode + ((getPacketLength() == null) ? 0 : getPacketLength().hashCode()); hashCode = prime * hashCode + ((getSessionNumber() == null) ? 0 : getSessionNumber().hashCode()); hashCode = prime * hashCode + ((getVirtualNetworkId() == null) ? 0 : getVirtualNetworkId().hashCode()); hashCode = prime * hashCode + ((getDescription() == null) ? 0 : getDescription().hashCode()); hashCode = prime * hashCode + ((getRemoveFields() == null) ? 0 : getRemoveFields().hashCode()); return hashCode; } @Override public ModifyTrafficMirrorSessionRequest clone() { return (ModifyTrafficMirrorSessionRequest) super.clone(); } }





© 2015 - 2024 Weber Informatics LLC | Privacy Policy