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

com.amazonaws.services.ivsrealtime.model.CreateParticipantTokenRequest Maven / Gradle / Ivy

/*
 * 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.ivsrealtime.model;

import java.io.Serializable;
import javax.annotation.Generated;

import com.amazonaws.AmazonWebServiceRequest;

/**
 * 
 * @see AWS API Documentation
 */
@Generated("com.amazonaws:aws-java-sdk-code-generator")
public class CreateParticipantTokenRequest extends com.amazonaws.AmazonWebServiceRequest implements Serializable, Cloneable {

    /**
     * 

* Application-provided attributes to encode into the token and attach to a stage. Map keys and values can contain * UTF-8 encoded text. The maximum length of this field is 1 KB total. This field is exposed to all stage * participants and should not be used for personally identifying, confidential, or sensitive information. *

*/ private java.util.Map attributes; /** *

* Set of capabilities that the user is allowed to perform in the stage. Default: PUBLISH, SUBSCRIBE. *

*/ private java.util.List capabilities; /** *

* Duration (in minutes), after which the token expires. Default: 720 (12 hours). *

*/ private Integer duration; /** *

* ARN of the stage to which this token is scoped. *

*/ private String stageArn; /** *

* Name that can be specified to help identify the token. This can be any UTF-8 encoded text. This field is * exposed to all stage participants and should not be used for personally identifying, confidential, or sensitive * information. *

*/ private String userId; /** *

* Application-provided attributes to encode into the token and attach to a stage. Map keys and values can contain * UTF-8 encoded text. The maximum length of this field is 1 KB total. This field is exposed to all stage * participants and should not be used for personally identifying, confidential, or sensitive information. *

* * @return Application-provided attributes to encode into the token and attach to a stage. Map keys and values can * contain UTF-8 encoded text. The maximum length of this field is 1 KB total. This field is exposed to * all stage participants and should not be used for personally identifying, confidential, or sensitive * information. */ public java.util.Map getAttributes() { return attributes; } /** *

* Application-provided attributes to encode into the token and attach to a stage. Map keys and values can contain * UTF-8 encoded text. The maximum length of this field is 1 KB total. This field is exposed to all stage * participants and should not be used for personally identifying, confidential, or sensitive information. *

* * @param attributes * Application-provided attributes to encode into the token and attach to a stage. Map keys and values can * contain UTF-8 encoded text. The maximum length of this field is 1 KB total. This field is exposed to * all stage participants and should not be used for personally identifying, confidential, or sensitive * information. */ public void setAttributes(java.util.Map attributes) { this.attributes = attributes; } /** *

* Application-provided attributes to encode into the token and attach to a stage. Map keys and values can contain * UTF-8 encoded text. The maximum length of this field is 1 KB total. This field is exposed to all stage * participants and should not be used for personally identifying, confidential, or sensitive information. *

* * @param attributes * Application-provided attributes to encode into the token and attach to a stage. Map keys and values can * contain UTF-8 encoded text. The maximum length of this field is 1 KB total. This field is exposed to * all stage participants and should not be used for personally identifying, confidential, or sensitive * information. * @return Returns a reference to this object so that method calls can be chained together. */ public CreateParticipantTokenRequest withAttributes(java.util.Map attributes) { setAttributes(attributes); return this; } /** * Add a single Attributes entry * * @see CreateParticipantTokenRequest#withAttributes * @returns a reference to this object so that method calls can be chained together. */ public CreateParticipantTokenRequest addAttributesEntry(String key, String value) { if (null == this.attributes) { this.attributes = new java.util.HashMap(); } if (this.attributes.containsKey(key)) throw new IllegalArgumentException("Duplicated keys (" + key.toString() + ") are provided."); this.attributes.put(key, value); return this; } /** * Removes all the entries added into Attributes. * * @return Returns a reference to this object so that method calls can be chained together. */ public CreateParticipantTokenRequest clearAttributesEntries() { this.attributes = null; return this; } /** *

* Set of capabilities that the user is allowed to perform in the stage. Default: PUBLISH, SUBSCRIBE. *

* * @return Set of capabilities that the user is allowed to perform in the stage. Default: * PUBLISH, SUBSCRIBE. * @see ParticipantTokenCapability */ public java.util.List getCapabilities() { return capabilities; } /** *

* Set of capabilities that the user is allowed to perform in the stage. Default: PUBLISH, SUBSCRIBE. *

* * @param capabilities * Set of capabilities that the user is allowed to perform in the stage. Default: * PUBLISH, SUBSCRIBE. * @see ParticipantTokenCapability */ public void setCapabilities(java.util.Collection capabilities) { if (capabilities == null) { this.capabilities = null; return; } this.capabilities = new java.util.ArrayList(capabilities); } /** *

* Set of capabilities that the user is allowed to perform in the stage. Default: PUBLISH, SUBSCRIBE. *

*

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

* * @param capabilities * Set of capabilities that the user is allowed to perform in the stage. Default: * PUBLISH, SUBSCRIBE. * @return Returns a reference to this object so that method calls can be chained together. * @see ParticipantTokenCapability */ public CreateParticipantTokenRequest withCapabilities(String... capabilities) { if (this.capabilities == null) { setCapabilities(new java.util.ArrayList(capabilities.length)); } for (String ele : capabilities) { this.capabilities.add(ele); } return this; } /** *

* Set of capabilities that the user is allowed to perform in the stage. Default: PUBLISH, SUBSCRIBE. *

* * @param capabilities * Set of capabilities that the user is allowed to perform in the stage. Default: * PUBLISH, SUBSCRIBE. * @return Returns a reference to this object so that method calls can be chained together. * @see ParticipantTokenCapability */ public CreateParticipantTokenRequest withCapabilities(java.util.Collection capabilities) { setCapabilities(capabilities); return this; } /** *

* Set of capabilities that the user is allowed to perform in the stage. Default: PUBLISH, SUBSCRIBE. *

* * @param capabilities * Set of capabilities that the user is allowed to perform in the stage. Default: * PUBLISH, SUBSCRIBE. * @return Returns a reference to this object so that method calls can be chained together. * @see ParticipantTokenCapability */ public CreateParticipantTokenRequest withCapabilities(ParticipantTokenCapability... capabilities) { java.util.ArrayList capabilitiesCopy = new java.util.ArrayList(capabilities.length); for (ParticipantTokenCapability value : capabilities) { capabilitiesCopy.add(value.toString()); } if (getCapabilities() == null) { setCapabilities(capabilitiesCopy); } else { getCapabilities().addAll(capabilitiesCopy); } return this; } /** *

* Duration (in minutes), after which the token expires. Default: 720 (12 hours). *

* * @param duration * Duration (in minutes), after which the token expires. Default: 720 (12 hours). */ public void setDuration(Integer duration) { this.duration = duration; } /** *

* Duration (in minutes), after which the token expires. Default: 720 (12 hours). *

* * @return Duration (in minutes), after which the token expires. Default: 720 (12 hours). */ public Integer getDuration() { return this.duration; } /** *

* Duration (in minutes), after which the token expires. Default: 720 (12 hours). *

* * @param duration * Duration (in minutes), after which the token expires. Default: 720 (12 hours). * @return Returns a reference to this object so that method calls can be chained together. */ public CreateParticipantTokenRequest withDuration(Integer duration) { setDuration(duration); return this; } /** *

* ARN of the stage to which this token is scoped. *

* * @param stageArn * ARN of the stage to which this token is scoped. */ public void setStageArn(String stageArn) { this.stageArn = stageArn; } /** *

* ARN of the stage to which this token is scoped. *

* * @return ARN of the stage to which this token is scoped. */ public String getStageArn() { return this.stageArn; } /** *

* ARN of the stage to which this token is scoped. *

* * @param stageArn * ARN of the stage to which this token is scoped. * @return Returns a reference to this object so that method calls can be chained together. */ public CreateParticipantTokenRequest withStageArn(String stageArn) { setStageArn(stageArn); return this; } /** *

* Name that can be specified to help identify the token. This can be any UTF-8 encoded text. This field is * exposed to all stage participants and should not be used for personally identifying, confidential, or sensitive * information. *

* * @param userId * Name that can be specified to help identify the token. This can be any UTF-8 encoded text. This field * is exposed to all stage participants and should not be used for personally identifying, confidential, or * sensitive information. */ public void setUserId(String userId) { this.userId = userId; } /** *

* Name that can be specified to help identify the token. This can be any UTF-8 encoded text. This field is * exposed to all stage participants and should not be used for personally identifying, confidential, or sensitive * information. *

* * @return Name that can be specified to help identify the token. This can be any UTF-8 encoded text. This field * is exposed to all stage participants and should not be used for personally identifying, confidential, or * sensitive information. */ public String getUserId() { return this.userId; } /** *

* Name that can be specified to help identify the token. This can be any UTF-8 encoded text. This field is * exposed to all stage participants and should not be used for personally identifying, confidential, or sensitive * information. *

* * @param userId * Name that can be specified to help identify the token. This can be any UTF-8 encoded text. This field * is exposed to all stage participants and should not be used for personally identifying, confidential, or * sensitive information. * @return Returns a reference to this object so that method calls can be chained together. */ public CreateParticipantTokenRequest withUserId(String userId) { setUserId(userId); return this; } /** * 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 (getAttributes() != null) sb.append("Attributes: ").append(getAttributes()).append(","); if (getCapabilities() != null) sb.append("Capabilities: ").append(getCapabilities()).append(","); if (getDuration() != null) sb.append("Duration: ").append(getDuration()).append(","); if (getStageArn() != null) sb.append("StageArn: ").append(getStageArn()).append(","); if (getUserId() != null) sb.append("UserId: ").append(getUserId()); sb.append("}"); return sb.toString(); } @Override public boolean equals(Object obj) { if (this == obj) return true; if (obj == null) return false; if (obj instanceof CreateParticipantTokenRequest == false) return false; CreateParticipantTokenRequest other = (CreateParticipantTokenRequest) obj; if (other.getAttributes() == null ^ this.getAttributes() == null) return false; if (other.getAttributes() != null && other.getAttributes().equals(this.getAttributes()) == false) return false; if (other.getCapabilities() == null ^ this.getCapabilities() == null) return false; if (other.getCapabilities() != null && other.getCapabilities().equals(this.getCapabilities()) == false) return false; if (other.getDuration() == null ^ this.getDuration() == null) return false; if (other.getDuration() != null && other.getDuration().equals(this.getDuration()) == false) return false; if (other.getStageArn() == null ^ this.getStageArn() == null) return false; if (other.getStageArn() != null && other.getStageArn().equals(this.getStageArn()) == false) return false; if (other.getUserId() == null ^ this.getUserId() == null) return false; if (other.getUserId() != null && other.getUserId().equals(this.getUserId()) == false) return false; return true; } @Override public int hashCode() { final int prime = 31; int hashCode = 1; hashCode = prime * hashCode + ((getAttributes() == null) ? 0 : getAttributes().hashCode()); hashCode = prime * hashCode + ((getCapabilities() == null) ? 0 : getCapabilities().hashCode()); hashCode = prime * hashCode + ((getDuration() == null) ? 0 : getDuration().hashCode()); hashCode = prime * hashCode + ((getStageArn() == null) ? 0 : getStageArn().hashCode()); hashCode = prime * hashCode + ((getUserId() == null) ? 0 : getUserId().hashCode()); return hashCode; } @Override public CreateParticipantTokenRequest clone() { return (CreateParticipantTokenRequest) super.clone(); } }




© 2015 - 2025 Weber Informatics LLC | Privacy Policy