/* * Copyright 2010-2020 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.kinesisvideosignaling.model; import java.io.Serializable; import com.amazonaws.AmazonWebServiceRequest; /** *

* Gets the Interactive Connectivity Establishment (ICE) server configuration * information, including URIs, username, and password which can be used to * configure the WebRTC connection. The ICE component uses this configuration * information to setup the WebRTC connection, including authenticating with the * Traversal Using Relays around NAT (TURN) relay server. *

*

* TURN is a protocol that is used to improve the connectivity of peer-to-peer * applications. By providing a cloud-based relay service, TURN ensures that a * connection can be established even when one or more peers are incapable of a * direct peer-to-peer connection. For more information, see A REST * API For Access To TURN Services. *

*

* You can invoke this API to establish a fallback mechanism in case either of * the peers is unable to establish a direct peer-to-peer connection over a * signaling channel. You must specify either a signaling channel ARN or the * client ID in order to invoke this API. *

*/ public class GetIceServerConfigRequest extends AmazonWebServiceRequest implements Serializable { /** *

* The ARN of the signaling channel to be used for the peer-to-peer * connection between configured peers. *

*

* Constraints:
* Length: 1 - 1024
* Pattern: * arn:aws:kinesisvideo:[a-z0-9-]+:[0-9]+:[a-z]+/[a-zA-Z0-9_.-]+/[0-9]+ *
*/ private String channelARN; /** *

* Unique identifier for the viewer. Must be unique within the signaling * channel. *

*

* Constraints:
* Length: 1 - 256
* Pattern: [a-zA-Z0-9_.-]+
*/ private String clientId; /** *

* Specifies the desired service. Currently, TURN is the only * valid value. *

*

* Constraints:
* Allowed Values: TURN */ private String service; /** *

* An optional user ID to be associated with the credentials. *

*

* Constraints:
* Length: 1 - 256
* Pattern: [a-zA-Z0-9_.-]+
*/ private String username; /** *

* The ARN of the signaling channel to be used for the peer-to-peer * connection between configured peers. *

*

* Constraints:
* Length: 1 - 1024
* Pattern: * arn:aws:kinesisvideo:[a-z0-9-]+:[0-9]+:[a-z]+/[a-zA-Z0-9_.-]+/[0-9]+ *
* * @return

* The ARN of the signaling channel to be used for the peer-to-peer * connection between configured peers. *

*/ public String getChannelARN() { return channelARN; } /** *

* The ARN of the signaling channel to be used for the peer-to-peer * connection between configured peers. *

*

* Constraints:
* Length: 1 - 1024
* Pattern: * arn:aws:kinesisvideo:[a-z0-9-]+:[0-9]+:[a-z]+/[a-zA-Z0-9_.-]+/[0-9]+ *
* * @param channelARN

* The ARN of the signaling channel to be used for the * peer-to-peer connection between configured peers. *

*/ public void setChannelARN(String channelARN) { this.channelARN = channelARN; } /** *

* The ARN of the signaling channel to be used for the peer-to-peer * connection between configured peers. *

*

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

* Constraints:
* Length: 1 - 1024
* Pattern: * arn:aws:kinesisvideo:[a-z0-9-]+:[0-9]+:[a-z]+/[a-zA-Z0-9_.-]+/[0-9]+ *
* * @param channelARN

* The ARN of the signaling channel to be used for the * peer-to-peer connection between configured peers. *

* @return A reference to this updated object so that method calls can be * chained together. */ public GetIceServerConfigRequest withChannelARN(String channelARN) { this.channelARN = channelARN; return this; } /** *

* Unique identifier for the viewer. Must be unique within the signaling * channel. *

*

* Constraints:
* Length: 1 - 256
* Pattern: [a-zA-Z0-9_.-]+
* * @return

* Unique identifier for the viewer. Must be unique within the * signaling channel. *

*/ public String getClientId() { return clientId; } /** *

* Unique identifier for the viewer. Must be unique within the signaling * channel. *

*

* Constraints:
* Length: 1 - 256
* Pattern: [a-zA-Z0-9_.-]+
* * @param clientId

* Unique identifier for the viewer. Must be unique within the * signaling channel. *

*/ public void setClientId(String clientId) { this.clientId = clientId; } /** *

* Unique identifier for the viewer. Must be unique within the signaling * channel. *

*

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

* Constraints:
* Length: 1 - 256
* Pattern: [a-zA-Z0-9_.-]+
* * @param clientId

* Unique identifier for the viewer. Must be unique within the * signaling channel. *

* @return A reference to this updated object so that method calls can be * chained together. */ public GetIceServerConfigRequest withClientId(String clientId) { this.clientId = clientId; return this; } /** *

* Specifies the desired service. Currently, TURN is the only * valid value. *

*

* Constraints:
* Allowed Values: TURN * * @return

* Specifies the desired service. Currently, TURN is * the only valid value. *

* @see Service */ public String getService() { return service; } /** *

* Specifies the desired service. Currently, TURN is the only * valid value. *

*

* Constraints:
* Allowed Values: TURN * * @param service

* Specifies the desired service. Currently, TURN is * the only valid value. *

* @see Service */ public void setService(String service) { this.service = service; } /** *

* Specifies the desired service. Currently, TURN is the only * valid value. *

*

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

* Constraints:
* Allowed Values: TURN * * @param service

* Specifies the desired service. Currently, TURN is * the only valid value. *

* @return A reference to this updated object so that method calls can be * chained together. * @see Service */ public GetIceServerConfigRequest withService(String service) { this.service = service; return this; } /** *

* Specifies the desired service. Currently, TURN is the only * valid value. *

*

* Constraints:
* Allowed Values: TURN * * @param service

* Specifies the desired service. Currently, TURN is * the only valid value. *

* @see Service */ public void setService(Service service) { this.service = service.toString(); } /** *

* Specifies the desired service. Currently, TURN is the only * valid value. *

*

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

* Constraints:
* Allowed Values: TURN * * @param service

* Specifies the desired service. Currently, TURN is * the only valid value. *

* @return A reference to this updated object so that method calls can be * chained together. * @see Service */ public GetIceServerConfigRequest withService(Service service) { this.service = service.toString(); return this; } /** *

* An optional user ID to be associated with the credentials. *

*

* Constraints:
* Length: 1 - 256
* Pattern: [a-zA-Z0-9_.-]+
* * @return

* An optional user ID to be associated with the credentials. *

*/ public String getUsername() { return username; } /** *

* An optional user ID to be associated with the credentials. *

*

* Constraints:
* Length: 1 - 256
* Pattern: [a-zA-Z0-9_.-]+
* * @param username

* An optional user ID to be associated with the credentials. *

*/ public void setUsername(String username) { this.username = username; } /** *

* An optional user ID to be associated with the credentials. *

*

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

* Constraints:
* Length: 1 - 256
* Pattern: [a-zA-Z0-9_.-]+
* * @param username

* An optional user ID to be associated with the credentials. *

* @return A reference to this updated object so that method calls can be * chained together. */ public GetIceServerConfigRequest withUsername(String username) { this.username = username; return this; } /** * Returns a string representation of this object; useful for testing and * debugging. * * @return A string representation of this object. * @see java.lang.Object#toString() */ @Override public String toString() { StringBuilder sb = new StringBuilder(); sb.append("{"); if (getChannelARN() != null) sb.append("ChannelARN: " + getChannelARN() + ","); if (getClientId() != null) sb.append("ClientId: " + getClientId() + ","); if (getService() != null) sb.append("Service: " + getService() + ","); if (getUsername() != null) sb.append("Username: " + getUsername()); sb.append("}"); return sb.toString(); } @Override public int hashCode() { final int prime = 31; int hashCode = 1; hashCode = prime * hashCode + ((getChannelARN() == null) ? 0 : getChannelARN().hashCode()); hashCode = prime * hashCode + ((getClientId() == null) ? 0 : getClientId().hashCode()); hashCode = prime * hashCode + ((getService() == null) ? 0 : getService().hashCode()); hashCode = prime * hashCode + ((getUsername() == null) ? 0 : getUsername().hashCode()); return hashCode; } @Override public boolean equals(Object obj) { if (this == obj) return true; if (obj == null) return false; if (obj instanceof GetIceServerConfigRequest == false) return false; GetIceServerConfigRequest other = (GetIceServerConfigRequest) obj; if (other.getChannelARN() == null ^ this.getChannelARN() == null) return false; if (other.getChannelARN() != null && other.getChannelARN().equals(this.getChannelARN()) == false) return false; if (other.getClientId() == null ^ this.getClientId() == null) return false; if (other.getClientId() != null && other.getClientId().equals(this.getClientId()) == false) return false; if (other.getService() == null ^ this.getService() == null) return false; if (other.getService() != null && other.getService().equals(this.getService()) == false) return false; if (other.getUsername() == null ^ this.getUsername() == null) return false; if (other.getUsername() != null && other.getUsername().equals(this.getUsername()) == false) return false; return true; } }