/* * Copyright 2018-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.quicksight.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 CreateTemplateRequest extends com.amazonaws.AmazonWebServiceRequest implements Serializable, Cloneable { /** *
* The ID for the Amazon Web Services account that the group is in. You use the ID for the Amazon Web Services * account that contains your Amazon QuickSight account. *
*/ private String awsAccountId; /** ** An ID for the template that you want to create. This template is unique per Amazon Web Services Region; in each * Amazon Web Services account. *
*/ private String templateId; /** ** A display name for the template. *
*/ private String name; /** ** A list of resource permissions to be set on the template. *
*/ private java.util.List
* The entity that you are using as a source when you create the template. In SourceEntity
, you specify
* the type of object you're using as source: SourceTemplate
for a template or
* SourceAnalysis
for an analysis. Both of these require an Amazon Resource Name (ARN). For
* SourceTemplate
, specify the ARN of the source template. For SourceAnalysis
, specify the
* ARN of the source analysis. The SourceTemplate
ARN can contain any Amazon Web Services account and
* any Amazon QuickSight-supported Amazon Web Services Region.
*
* Use the DataSetReferences
entity within SourceTemplate
or SourceAnalysis
* to list the replacement datasets for the placeholders listed in the original. The schema in each dataset must
* match its placeholder.
*
* Either a SourceEntity
or a Definition
must be provided in order for the request to be
* valid.
*
* Contains a map of the key-value pairs for the resource tag or tags assigned to the resource. *
*/ private java.util.List
* A description of the current template version being created. This API operation creates the first version of the
* template. Every time UpdateTemplate
is called, a new version is created. Each version of the
* template maintains a description of the version in the VersionDescription
field.
*
* The definition of a template. *
** A definition is the data model of all features in a Dashboard, Template, or Analysis. *
*
* Either a SourceEntity
or a Definition
must be provided in order for the request to be
* valid.
*
* The ID for the Amazon Web Services account that the group is in. You use the ID for the Amazon Web Services * account that contains your Amazon QuickSight account. *
* * @param awsAccountId * The ID for the Amazon Web Services account that the group is in. You use the ID for the Amazon Web * Services account that contains your Amazon QuickSight account. */ public void setAwsAccountId(String awsAccountId) { this.awsAccountId = awsAccountId; } /** ** The ID for the Amazon Web Services account that the group is in. You use the ID for the Amazon Web Services * account that contains your Amazon QuickSight account. *
* * @return The ID for the Amazon Web Services account that the group is in. You use the ID for the Amazon Web * Services account that contains your Amazon QuickSight account. */ public String getAwsAccountId() { return this.awsAccountId; } /** ** The ID for the Amazon Web Services account that the group is in. You use the ID for the Amazon Web Services * account that contains your Amazon QuickSight account. *
* * @param awsAccountId * The ID for the Amazon Web Services account that the group is in. You use the ID for the Amazon Web * Services account that contains your Amazon QuickSight account. * @return Returns a reference to this object so that method calls can be chained together. */ public CreateTemplateRequest withAwsAccountId(String awsAccountId) { setAwsAccountId(awsAccountId); return this; } /** ** An ID for the template that you want to create. This template is unique per Amazon Web Services Region; in each * Amazon Web Services account. *
* * @param templateId * An ID for the template that you want to create. This template is unique per Amazon Web Services Region; in * each Amazon Web Services account. */ public void setTemplateId(String templateId) { this.templateId = templateId; } /** ** An ID for the template that you want to create. This template is unique per Amazon Web Services Region; in each * Amazon Web Services account. *
* * @return An ID for the template that you want to create. This template is unique per Amazon Web Services Region; * in each Amazon Web Services account. */ public String getTemplateId() { return this.templateId; } /** ** An ID for the template that you want to create. This template is unique per Amazon Web Services Region; in each * Amazon Web Services account. *
* * @param templateId * An ID for the template that you want to create. This template is unique per Amazon Web Services Region; in * each Amazon Web Services account. * @return Returns a reference to this object so that method calls can be chained together. */ public CreateTemplateRequest withTemplateId(String templateId) { setTemplateId(templateId); return this; } /** ** A display name for the template. *
* * @param name * A display name for the template. */ public void setName(String name) { this.name = name; } /** ** A display name for the template. *
* * @return A display name for the template. */ public String getName() { return this.name; } /** ** A display name for the template. *
* * @param name * A display name for the template. * @return Returns a reference to this object so that method calls can be chained together. */ public CreateTemplateRequest withName(String name) { setName(name); return this; } /** ** A list of resource permissions to be set on the template. *
* * @return A list of resource permissions to be set on the template. */ public java.util.List* A list of resource permissions to be set on the template. *
* * @param permissions * A list of resource permissions to be set on the template. */ public void setPermissions(java.util.Collection* A list of resource permissions to be set on the template. *
** NOTE: This method appends the values to the existing list (if any). Use * {@link #setPermissions(java.util.Collection)} or {@link #withPermissions(java.util.Collection)} if you want to * override the existing values. *
* * @param permissions * A list of resource permissions to be set on the template. * @return Returns a reference to this object so that method calls can be chained together. */ public CreateTemplateRequest withPermissions(ResourcePermission... permissions) { if (this.permissions == null) { setPermissions(new java.util.ArrayList* A list of resource permissions to be set on the template. *
* * @param permissions * A list of resource permissions to be set on the template. * @return Returns a reference to this object so that method calls can be chained together. */ public CreateTemplateRequest withPermissions(java.util.Collection
* The entity that you are using as a source when you create the template. In SourceEntity
, you specify
* the type of object you're using as source: SourceTemplate
for a template or
* SourceAnalysis
for an analysis. Both of these require an Amazon Resource Name (ARN). For
* SourceTemplate
, specify the ARN of the source template. For SourceAnalysis
, specify the
* ARN of the source analysis. The SourceTemplate
ARN can contain any Amazon Web Services account and
* any Amazon QuickSight-supported Amazon Web Services Region.
*
* Use the DataSetReferences
entity within SourceTemplate
or SourceAnalysis
* to list the replacement datasets for the placeholders listed in the original. The schema in each dataset must
* match its placeholder.
*
* Either a SourceEntity
or a Definition
must be provided in order for the request to be
* valid.
*
SourceEntity
, you
* specify the type of object you're using as source: SourceTemplate
for a template or
* SourceAnalysis
for an analysis. Both of these require an Amazon Resource Name (ARN). For
* SourceTemplate
, specify the ARN of the source template. For SourceAnalysis
,
* specify the ARN of the source analysis. The SourceTemplate
ARN can contain any Amazon Web
* Services account and any Amazon QuickSight-supported Amazon Web Services Region.
*
* Use the DataSetReferences
entity within SourceTemplate
or
* SourceAnalysis
to list the replacement datasets for the placeholders listed in the original.
* The schema in each dataset must match its placeholder.
*
* Either a SourceEntity
or a Definition
must be provided in order for the request
* to be valid.
*/
public void setSourceEntity(TemplateSourceEntity sourceEntity) {
this.sourceEntity = sourceEntity;
}
/**
*
* The entity that you are using as a source when you create the template. In SourceEntity
, you specify
* the type of object you're using as source: SourceTemplate
for a template or
* SourceAnalysis
for an analysis. Both of these require an Amazon Resource Name (ARN). For
* SourceTemplate
, specify the ARN of the source template. For SourceAnalysis
, specify the
* ARN of the source analysis. The SourceTemplate
ARN can contain any Amazon Web Services account and
* any Amazon QuickSight-supported Amazon Web Services Region.
*
* Use the DataSetReferences
entity within SourceTemplate
or SourceAnalysis
* to list the replacement datasets for the placeholders listed in the original. The schema in each dataset must
* match its placeholder.
*
* Either a SourceEntity
or a Definition
must be provided in order for the request to be
* valid.
*
SourceEntity
, you
* specify the type of object you're using as source: SourceTemplate
for a template or
* SourceAnalysis
for an analysis. Both of these require an Amazon Resource Name (ARN). For
* SourceTemplate
, specify the ARN of the source template. For SourceAnalysis
,
* specify the ARN of the source analysis. The SourceTemplate
ARN can contain any Amazon Web
* Services account and any Amazon QuickSight-supported Amazon Web Services Region.
*
* Use the DataSetReferences
entity within SourceTemplate
or
* SourceAnalysis
to list the replacement datasets for the placeholders listed in the original.
* The schema in each dataset must match its placeholder.
*
* Either a SourceEntity
or a Definition
must be provided in order for the request
* to be valid.
*/
public TemplateSourceEntity getSourceEntity() {
return this.sourceEntity;
}
/**
*
* The entity that you are using as a source when you create the template. In SourceEntity
, you specify
* the type of object you're using as source: SourceTemplate
for a template or
* SourceAnalysis
for an analysis. Both of these require an Amazon Resource Name (ARN). For
* SourceTemplate
, specify the ARN of the source template. For SourceAnalysis
, specify the
* ARN of the source analysis. The SourceTemplate
ARN can contain any Amazon Web Services account and
* any Amazon QuickSight-supported Amazon Web Services Region.
*
* Use the DataSetReferences
entity within SourceTemplate
or SourceAnalysis
* to list the replacement datasets for the placeholders listed in the original. The schema in each dataset must
* match its placeholder.
*
* Either a SourceEntity
or a Definition
must be provided in order for the request to be
* valid.
*
SourceEntity
, you
* specify the type of object you're using as source: SourceTemplate
for a template or
* SourceAnalysis
for an analysis. Both of these require an Amazon Resource Name (ARN). For
* SourceTemplate
, specify the ARN of the source template. For SourceAnalysis
,
* specify the ARN of the source analysis. The SourceTemplate
ARN can contain any Amazon Web
* Services account and any Amazon QuickSight-supported Amazon Web Services Region.
*
* Use the DataSetReferences
entity within SourceTemplate
or
* SourceAnalysis
to list the replacement datasets for the placeholders listed in the original.
* The schema in each dataset must match its placeholder.
*
* Either a SourceEntity
or a Definition
must be provided in order for the request
* to be valid.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public CreateTemplateRequest withSourceEntity(TemplateSourceEntity sourceEntity) {
setSourceEntity(sourceEntity);
return this;
}
/**
*
* Contains a map of the key-value pairs for the resource tag or tags assigned to the resource. *
* * @return Contains a map of the key-value pairs for the resource tag or tags assigned to the resource. */ public java.util.List* Contains a map of the key-value pairs for the resource tag or tags assigned to the resource. *
* * @param tags * Contains a map of the key-value pairs for the resource tag or tags assigned to the resource. */ public void setTags(java.util.Collection* Contains a map of the key-value pairs for the resource tag or tags assigned to the resource. *
** NOTE: This method appends the values to the existing list (if any). Use * {@link #setTags(java.util.Collection)} or {@link #withTags(java.util.Collection)} if you want to override the * existing values. *
* * @param tags * Contains a map of the key-value pairs for the resource tag or tags assigned to the resource. * @return Returns a reference to this object so that method calls can be chained together. */ public CreateTemplateRequest withTags(Tag... tags) { if (this.tags == null) { setTags(new java.util.ArrayList* Contains a map of the key-value pairs for the resource tag or tags assigned to the resource. *
* * @param tags * Contains a map of the key-value pairs for the resource tag or tags assigned to the resource. * @return Returns a reference to this object so that method calls can be chained together. */ public CreateTemplateRequest withTags(java.util.Collection
* A description of the current template version being created. This API operation creates the first version of the
* template. Every time UpdateTemplate
is called, a new version is created. Each version of the
* template maintains a description of the version in the VersionDescription
field.
*
UpdateTemplate
is called, a new version is created. Each version
* of the template maintains a description of the version in the VersionDescription
field.
*/
public void setVersionDescription(String versionDescription) {
this.versionDescription = versionDescription;
}
/**
*
* A description of the current template version being created. This API operation creates the first version of the
* template. Every time UpdateTemplate
is called, a new version is created. Each version of the
* template maintains a description of the version in the VersionDescription
field.
*
UpdateTemplate
is called, a new version is created. Each version
* of the template maintains a description of the version in the VersionDescription
field.
*/
public String getVersionDescription() {
return this.versionDescription;
}
/**
*
* A description of the current template version being created. This API operation creates the first version of the
* template. Every time UpdateTemplate
is called, a new version is created. Each version of the
* template maintains a description of the version in the VersionDescription
field.
*
UpdateTemplate
is called, a new version is created. Each version
* of the template maintains a description of the version in the VersionDescription
field.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public CreateTemplateRequest withVersionDescription(String versionDescription) {
setVersionDescription(versionDescription);
return this;
}
/**
* * The definition of a template. *
** A definition is the data model of all features in a Dashboard, Template, or Analysis. *
*
* Either a SourceEntity
or a Definition
must be provided in order for the request to be
* valid.
*
* A definition is the data model of all features in a Dashboard, Template, or Analysis. *
*
* Either a SourceEntity
or a Definition
must be provided in order for the request
* to be valid.
*/
public void setDefinition(TemplateVersionDefinition definition) {
this.definition = definition;
}
/**
*
* The definition of a template. *
** A definition is the data model of all features in a Dashboard, Template, or Analysis. *
*
* Either a SourceEntity
or a Definition
must be provided in order for the request to be
* valid.
*
* A definition is the data model of all features in a Dashboard, Template, or Analysis. *
*
* Either a SourceEntity
or a Definition
must be provided in order for the request
* to be valid.
*/
public TemplateVersionDefinition getDefinition() {
return this.definition;
}
/**
*
* The definition of a template. *
** A definition is the data model of all features in a Dashboard, Template, or Analysis. *
*
* Either a SourceEntity
or a Definition
must be provided in order for the request to be
* valid.
*
* A definition is the data model of all features in a Dashboard, Template, or Analysis. *
*
* Either a SourceEntity
or a Definition
must be provided in order for the request
* to be valid.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public CreateTemplateRequest withDefinition(TemplateVersionDefinition definition) {
setDefinition(definition);
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 (getAwsAccountId() != null)
sb.append("AwsAccountId: ").append(getAwsAccountId()).append(",");
if (getTemplateId() != null)
sb.append("TemplateId: ").append(getTemplateId()).append(",");
if (getName() != null)
sb.append("Name: ").append(getName()).append(",");
if (getPermissions() != null)
sb.append("Permissions: ").append(getPermissions()).append(",");
if (getSourceEntity() != null)
sb.append("SourceEntity: ").append(getSourceEntity()).append(",");
if (getTags() != null)
sb.append("Tags: ").append(getTags()).append(",");
if (getVersionDescription() != null)
sb.append("VersionDescription: ").append(getVersionDescription()).append(",");
if (getDefinition() != null)
sb.append("Definition: ").append(getDefinition());
sb.append("}");
return sb.toString();
}
@Override
public boolean equals(Object obj) {
if (this == obj)
return true;
if (obj == null)
return false;
if (obj instanceof CreateTemplateRequest == false)
return false;
CreateTemplateRequest other = (CreateTemplateRequest) obj;
if (other.getAwsAccountId() == null ^ this.getAwsAccountId() == null)
return false;
if (other.getAwsAccountId() != null && other.getAwsAccountId().equals(this.getAwsAccountId()) == false)
return false;
if (other.getTemplateId() == null ^ this.getTemplateId() == null)
return false;
if (other.getTemplateId() != null && other.getTemplateId().equals(this.getTemplateId()) == false)
return false;
if (other.getName() == null ^ this.getName() == null)
return false;
if (other.getName() != null && other.getName().equals(this.getName()) == false)
return false;
if (other.getPermissions() == null ^ this.getPermissions() == null)
return false;
if (other.getPermissions() != null && other.getPermissions().equals(this.getPermissions()) == false)
return false;
if (other.getSourceEntity() == null ^ this.getSourceEntity() == null)
return false;
if (other.getSourceEntity() != null && other.getSourceEntity().equals(this.getSourceEntity()) == false)
return false;
if (other.getTags() == null ^ this.getTags() == null)
return false;
if (other.getTags() != null && other.getTags().equals(this.getTags()) == false)
return false;
if (other.getVersionDescription() == null ^ this.getVersionDescription() == null)
return false;
if (other.getVersionDescription() != null && other.getVersionDescription().equals(this.getVersionDescription()) == false)
return false;
if (other.getDefinition() == null ^ this.getDefinition() == null)
return false;
if (other.getDefinition() != null && other.getDefinition().equals(this.getDefinition()) == false)
return false;
return true;
}
@Override
public int hashCode() {
final int prime = 31;
int hashCode = 1;
hashCode = prime * hashCode + ((getAwsAccountId() == null) ? 0 : getAwsAccountId().hashCode());
hashCode = prime * hashCode + ((getTemplateId() == null) ? 0 : getTemplateId().hashCode());
hashCode = prime * hashCode + ((getName() == null) ? 0 : getName().hashCode());
hashCode = prime * hashCode + ((getPermissions() == null) ? 0 : getPermissions().hashCode());
hashCode = prime * hashCode + ((getSourceEntity() == null) ? 0 : getSourceEntity().hashCode());
hashCode = prime * hashCode + ((getTags() == null) ? 0 : getTags().hashCode());
hashCode = prime * hashCode + ((getVersionDescription() == null) ? 0 : getVersionDescription().hashCode());
hashCode = prime * hashCode + ((getDefinition() == null) ? 0 : getDefinition().hashCode());
return hashCode;
}
@Override
public CreateTemplateRequest clone() {
return (CreateTemplateRequest) super.clone();
}
}