/* * Copyright 2010-2023 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.kinesisvideo.model; import java.io.Serializable; /** *

* An object that contains the endpoint configuration for the * SINGLE_MASTER channel type. *

*/ public class SingleMasterChannelEndpointConfiguration implements Serializable { /** *

* This property is used to determine the nature of communication over this * SINGLE_MASTER signaling channel. If WSS is * specified, this API returns a websocket endpoint. If HTTPS * is specified, this API returns an HTTPS endpoint. *

*/ private java.util.List protocols = new java.util.ArrayList(); /** *

* This property is used to determine messaging permissions in this * SINGLE_MASTER signaling channel. If MASTER is * specified, this API returns an endpoint that a client can use to receive * offers from and send answers to any of the viewers on this signaling * channel. If VIEWER is specified, this API returns an * endpoint that a client can use only to send offers to another * MASTER client on this signaling channel. *

*

* Constraints:
* Allowed Values: MASTER, VIEWER */ private String role; /** *

* This property is used to determine the nature of communication over this * SINGLE_MASTER signaling channel. If WSS is * specified, this API returns a websocket endpoint. If HTTPS * is specified, this API returns an HTTPS endpoint. *

* * @return

* This property is used to determine the nature of communication * over this SINGLE_MASTER signaling channel. If * WSS is specified, this API returns a websocket * endpoint. If HTTPS is specified, this API returns an * HTTPS endpoint. *

*/ public java.util.List getProtocols() { return protocols; } /** *

* This property is used to determine the nature of communication over this * SINGLE_MASTER signaling channel. If WSS is * specified, this API returns a websocket endpoint. If HTTPS * is specified, this API returns an HTTPS endpoint. *

* * @param protocols

* This property is used to determine the nature of communication * over this SINGLE_MASTER signaling channel. If * WSS is specified, this API returns a websocket * endpoint. If HTTPS is specified, this API returns * an HTTPS endpoint. *

*/ public void setProtocols(java.util.Collection protocols) { if (protocols == null) { this.protocols = null; return; } this.protocols = new java.util.ArrayList(protocols); } /** *

* This property is used to determine the nature of communication over this * SINGLE_MASTER signaling channel. If WSS is * specified, this API returns a websocket endpoint. If HTTPS * is specified, this API returns an HTTPS endpoint. *

*

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

* This property is used to determine the nature of communication * over this SINGLE_MASTER signaling channel. If * WSS is specified, this API returns a websocket * endpoint. If HTTPS is specified, this API returns * an HTTPS endpoint. *

* @return A reference to this updated object so that method calls can be * chained together. */ public SingleMasterChannelEndpointConfiguration withProtocols(String... protocols) { if (getProtocols() == null) { this.protocols = new java.util.ArrayList(protocols.length); } for (String value : protocols) { this.protocols.add(value); } return this; } /** *

* This property is used to determine the nature of communication over this * SINGLE_MASTER signaling channel. If WSS is * specified, this API returns a websocket endpoint. If HTTPS * is specified, this API returns an HTTPS endpoint. *

*

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

* This property is used to determine the nature of communication * over this SINGLE_MASTER signaling channel. If * WSS is specified, this API returns a websocket * endpoint. If HTTPS is specified, this API returns * an HTTPS endpoint. *

* @return A reference to this updated object so that method calls can be * chained together. */ public SingleMasterChannelEndpointConfiguration withProtocols( java.util.Collection protocols) { setProtocols(protocols); return this; } /** *

* This property is used to determine messaging permissions in this * SINGLE_MASTER signaling channel. If MASTER is * specified, this API returns an endpoint that a client can use to receive * offers from and send answers to any of the viewers on this signaling * channel. If VIEWER is specified, this API returns an * endpoint that a client can use only to send offers to another * MASTER client on this signaling channel. *

*

* Constraints:
* Allowed Values: MASTER, VIEWER * * @return

* This property is used to determine messaging permissions in this * SINGLE_MASTER signaling channel. If * MASTER is specified, this API returns an endpoint * that a client can use to receive offers from and send answers to * any of the viewers on this signaling channel. If * VIEWER is specified, this API returns an endpoint * that a client can use only to send offers to another * MASTER client on this signaling channel. *

* @see ChannelRole */ public String getRole() { return role; } /** *

* This property is used to determine messaging permissions in this * SINGLE_MASTER signaling channel. If MASTER is * specified, this API returns an endpoint that a client can use to receive * offers from and send answers to any of the viewers on this signaling * channel. If VIEWER is specified, this API returns an * endpoint that a client can use only to send offers to another * MASTER client on this signaling channel. *

*

* Constraints:
* Allowed Values: MASTER, VIEWER * * @param role

* This property is used to determine messaging permissions in * this SINGLE_MASTER signaling channel. If * MASTER is specified, this API returns an endpoint * that a client can use to receive offers from and send answers * to any of the viewers on this signaling channel. If * VIEWER is specified, this API returns an endpoint * that a client can use only to send offers to another * MASTER client on this signaling channel. *

* @see ChannelRole */ public void setRole(String role) { this.role = role; } /** *

* This property is used to determine messaging permissions in this * SINGLE_MASTER signaling channel. If MASTER is * specified, this API returns an endpoint that a client can use to receive * offers from and send answers to any of the viewers on this signaling * channel. If VIEWER is specified, this API returns an * endpoint that a client can use only to send offers to another * MASTER client on this signaling channel. *

*

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

* Constraints:
* Allowed Values: MASTER, VIEWER * * @param role

* This property is used to determine messaging permissions in * this SINGLE_MASTER signaling channel. If * MASTER is specified, this API returns an endpoint * that a client can use to receive offers from and send answers * to any of the viewers on this signaling channel. If * VIEWER is specified, this API returns an endpoint * that a client can use only to send offers to another * MASTER client on this signaling channel. *

* @return A reference to this updated object so that method calls can be * chained together. * @see ChannelRole */ public SingleMasterChannelEndpointConfiguration withRole(String role) { this.role = role; return this; } /** *

* This property is used to determine messaging permissions in this * SINGLE_MASTER signaling channel. If MASTER is * specified, this API returns an endpoint that a client can use to receive * offers from and send answers to any of the viewers on this signaling * channel. If VIEWER is specified, this API returns an * endpoint that a client can use only to send offers to another * MASTER client on this signaling channel. *

*

* Constraints:
* Allowed Values: MASTER, VIEWER * * @param role

* This property is used to determine messaging permissions in * this SINGLE_MASTER signaling channel. If * MASTER is specified, this API returns an endpoint * that a client can use to receive offers from and send answers * to any of the viewers on this signaling channel. If * VIEWER is specified, this API returns an endpoint * that a client can use only to send offers to another * MASTER client on this signaling channel. *

* @see ChannelRole */ public void setRole(ChannelRole role) { this.role = role.toString(); } /** *

* This property is used to determine messaging permissions in this * SINGLE_MASTER signaling channel. If MASTER is * specified, this API returns an endpoint that a client can use to receive * offers from and send answers to any of the viewers on this signaling * channel. If VIEWER is specified, this API returns an * endpoint that a client can use only to send offers to another * MASTER client on this signaling channel. *

*

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

* Constraints:
* Allowed Values: MASTER, VIEWER * * @param role

* This property is used to determine messaging permissions in * this SINGLE_MASTER signaling channel. If * MASTER is specified, this API returns an endpoint * that a client can use to receive offers from and send answers * to any of the viewers on this signaling channel. If * VIEWER is specified, this API returns an endpoint * that a client can use only to send offers to another * MASTER client on this signaling channel. *

* @return A reference to this updated object so that method calls can be * chained together. * @see ChannelRole */ public SingleMasterChannelEndpointConfiguration withRole(ChannelRole role) { this.role = role.toString(); 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 (getProtocols() != null) sb.append("Protocols: " + getProtocols() + ","); if (getRole() != null) sb.append("Role: " + getRole()); sb.append("}"); return sb.toString(); } @Override public int hashCode() { final int prime = 31; int hashCode = 1; hashCode = prime * hashCode + ((getProtocols() == null) ? 0 : getProtocols().hashCode()); hashCode = prime * hashCode + ((getRole() == null) ? 0 : getRole().hashCode()); return hashCode; } @Override public boolean equals(Object obj) { if (this == obj) return true; if (obj == null) return false; if (obj instanceof SingleMasterChannelEndpointConfiguration == false) return false; SingleMasterChannelEndpointConfiguration other = (SingleMasterChannelEndpointConfiguration) obj; if (other.getProtocols() == null ^ this.getProtocols() == null) return false; if (other.getProtocols() != null && other.getProtocols().equals(this.getProtocols()) == false) return false; if (other.getRole() == null ^ this.getRole() == null) return false; if (other.getRole() != null && other.getRole().equals(this.getRole()) == false) return false; return true; } }