com.amazonaws.services.appsync.model.FunctionConfiguration Maven / Gradle / Ivy
Show all versions of aws-java-sdk-appsync Show documentation
/*
* 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.appsync.model;
import java.io.Serializable;
import javax.annotation.Generated;
import com.amazonaws.protocol.StructuredPojo;
import com.amazonaws.protocol.ProtocolMarshaller;
/**
*
* A function is a reusable entity. You can use multiple functions to compose the resolver logic.
*
*
* @see AWS API
* Documentation
*/
@Generated("com.amazonaws:aws-java-sdk-code-generator")
public class FunctionConfiguration implements Serializable, Cloneable, StructuredPojo {
/**
*
* A unique ID representing the Function
object.
*
*/
private String functionId;
/**
*
* The Amazon Resource Name (ARN) of the Function
object.
*
*/
private String functionArn;
/**
*
* The name of the Function
object.
*
*/
private String name;
/**
*
* The Function
description.
*
*/
private String description;
/**
*
* The name of the DataSource
.
*
*/
private String dataSourceName;
/**
*
* The Function
request mapping template. Functions support only the 2018-05-29 version of the request
* mapping template.
*
*/
private String requestMappingTemplate;
/**
*
* The Function
response mapping template.
*
*/
private String responseMappingTemplate;
/**
*
* The version of the request mapping template. Currently, only the 2018-05-29 version of the template is supported.
*
*/
private String functionVersion;
private SyncConfig syncConfig;
/**
*
* The maximum batching size for a resolver.
*
*/
private Integer maxBatchSize;
private AppSyncRuntime runtime;
/**
*
* The function
code that contains the request and response functions. When code is used, the
* runtime
is required. The runtime
value must be APPSYNC_JS
.
*
*/
private String code;
/**
*
* A unique ID representing the Function
object.
*
*
* @param functionId
* A unique ID representing the Function
object.
*/
public void setFunctionId(String functionId) {
this.functionId = functionId;
}
/**
*
* A unique ID representing the Function
object.
*
*
* @return A unique ID representing the Function
object.
*/
public String getFunctionId() {
return this.functionId;
}
/**
*
* A unique ID representing the Function
object.
*
*
* @param functionId
* A unique ID representing the Function
object.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public FunctionConfiguration withFunctionId(String functionId) {
setFunctionId(functionId);
return this;
}
/**
*
* The Amazon Resource Name (ARN) of the Function
object.
*
*
* @param functionArn
* The Amazon Resource Name (ARN) of the Function
object.
*/
public void setFunctionArn(String functionArn) {
this.functionArn = functionArn;
}
/**
*
* The Amazon Resource Name (ARN) of the Function
object.
*
*
* @return The Amazon Resource Name (ARN) of the Function
object.
*/
public String getFunctionArn() {
return this.functionArn;
}
/**
*
* The Amazon Resource Name (ARN) of the Function
object.
*
*
* @param functionArn
* The Amazon Resource Name (ARN) of the Function
object.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public FunctionConfiguration withFunctionArn(String functionArn) {
setFunctionArn(functionArn);
return this;
}
/**
*
* The name of the Function
object.
*
*
* @param name
* The name of the Function
object.
*/
public void setName(String name) {
this.name = name;
}
/**
*
* The name of the Function
object.
*
*
* @return The name of the Function
object.
*/
public String getName() {
return this.name;
}
/**
*
* The name of the Function
object.
*
*
* @param name
* The name of the Function
object.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public FunctionConfiguration withName(String name) {
setName(name);
return this;
}
/**
*
* The Function
description.
*
*
* @param description
* The Function
description.
*/
public void setDescription(String description) {
this.description = description;
}
/**
*
* The Function
description.
*
*
* @return The Function
description.
*/
public String getDescription() {
return this.description;
}
/**
*
* The Function
description.
*
*
* @param description
* The Function
description.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public FunctionConfiguration withDescription(String description) {
setDescription(description);
return this;
}
/**
*
* The name of the DataSource
.
*
*
* @param dataSourceName
* The name of the DataSource
.
*/
public void setDataSourceName(String dataSourceName) {
this.dataSourceName = dataSourceName;
}
/**
*
* The name of the DataSource
.
*
*
* @return The name of the DataSource
.
*/
public String getDataSourceName() {
return this.dataSourceName;
}
/**
*
* The name of the DataSource
.
*
*
* @param dataSourceName
* The name of the DataSource
.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public FunctionConfiguration withDataSourceName(String dataSourceName) {
setDataSourceName(dataSourceName);
return this;
}
/**
*
* The Function
request mapping template. Functions support only the 2018-05-29 version of the request
* mapping template.
*
*
* @param requestMappingTemplate
* The Function
request mapping template. Functions support only the 2018-05-29 version of the
* request mapping template.
*/
public void setRequestMappingTemplate(String requestMappingTemplate) {
this.requestMappingTemplate = requestMappingTemplate;
}
/**
*
* The Function
request mapping template. Functions support only the 2018-05-29 version of the request
* mapping template.
*
*
* @return The Function
request mapping template. Functions support only the 2018-05-29 version of the
* request mapping template.
*/
public String getRequestMappingTemplate() {
return this.requestMappingTemplate;
}
/**
*
* The Function
request mapping template. Functions support only the 2018-05-29 version of the request
* mapping template.
*
*
* @param requestMappingTemplate
* The Function
request mapping template. Functions support only the 2018-05-29 version of the
* request mapping template.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public FunctionConfiguration withRequestMappingTemplate(String requestMappingTemplate) {
setRequestMappingTemplate(requestMappingTemplate);
return this;
}
/**
*
* The Function
response mapping template.
*
*
* @param responseMappingTemplate
* The Function
response mapping template.
*/
public void setResponseMappingTemplate(String responseMappingTemplate) {
this.responseMappingTemplate = responseMappingTemplate;
}
/**
*
* The Function
response mapping template.
*
*
* @return The Function
response mapping template.
*/
public String getResponseMappingTemplate() {
return this.responseMappingTemplate;
}
/**
*
* The Function
response mapping template.
*
*
* @param responseMappingTemplate
* The Function
response mapping template.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public FunctionConfiguration withResponseMappingTemplate(String responseMappingTemplate) {
setResponseMappingTemplate(responseMappingTemplate);
return this;
}
/**
*
* The version of the request mapping template. Currently, only the 2018-05-29 version of the template is supported.
*
*
* @param functionVersion
* The version of the request mapping template. Currently, only the 2018-05-29 version of the template is
* supported.
*/
public void setFunctionVersion(String functionVersion) {
this.functionVersion = functionVersion;
}
/**
*
* The version of the request mapping template. Currently, only the 2018-05-29 version of the template is supported.
*
*
* @return The version of the request mapping template. Currently, only the 2018-05-29 version of the template is
* supported.
*/
public String getFunctionVersion() {
return this.functionVersion;
}
/**
*
* The version of the request mapping template. Currently, only the 2018-05-29 version of the template is supported.
*
*
* @param functionVersion
* The version of the request mapping template. Currently, only the 2018-05-29 version of the template is
* supported.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public FunctionConfiguration withFunctionVersion(String functionVersion) {
setFunctionVersion(functionVersion);
return this;
}
/**
* @param syncConfig
*/
public void setSyncConfig(SyncConfig syncConfig) {
this.syncConfig = syncConfig;
}
/**
* @return
*/
public SyncConfig getSyncConfig() {
return this.syncConfig;
}
/**
* @param syncConfig
* @return Returns a reference to this object so that method calls can be chained together.
*/
public FunctionConfiguration withSyncConfig(SyncConfig syncConfig) {
setSyncConfig(syncConfig);
return this;
}
/**
*
* The maximum batching size for a resolver.
*
*
* @param maxBatchSize
* The maximum batching size for a resolver.
*/
public void setMaxBatchSize(Integer maxBatchSize) {
this.maxBatchSize = maxBatchSize;
}
/**
*
* The maximum batching size for a resolver.
*
*
* @return The maximum batching size for a resolver.
*/
public Integer getMaxBatchSize() {
return this.maxBatchSize;
}
/**
*
* The maximum batching size for a resolver.
*
*
* @param maxBatchSize
* The maximum batching size for a resolver.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public FunctionConfiguration withMaxBatchSize(Integer maxBatchSize) {
setMaxBatchSize(maxBatchSize);
return this;
}
/**
* @param runtime
*/
public void setRuntime(AppSyncRuntime runtime) {
this.runtime = runtime;
}
/**
* @return
*/
public AppSyncRuntime getRuntime() {
return this.runtime;
}
/**
* @param runtime
* @return Returns a reference to this object so that method calls can be chained together.
*/
public FunctionConfiguration withRuntime(AppSyncRuntime runtime) {
setRuntime(runtime);
return this;
}
/**
*
* The function
code that contains the request and response functions. When code is used, the
* runtime
is required. The runtime
value must be APPSYNC_JS
.
*
*
* @param code
* The function
code that contains the request and response functions. When code is used, the
* runtime
is required. The runtime
value must be APPSYNC_JS
.
*/
public void setCode(String code) {
this.code = code;
}
/**
*
* The function
code that contains the request and response functions. When code is used, the
* runtime
is required. The runtime
value must be APPSYNC_JS
.
*
*
* @return The function
code that contains the request and response functions. When code is used, the
* runtime
is required. The runtime
value must be APPSYNC_JS
.
*/
public String getCode() {
return this.code;
}
/**
*
* The function
code that contains the request and response functions. When code is used, the
* runtime
is required. The runtime
value must be APPSYNC_JS
.
*
*
* @param code
* The function
code that contains the request and response functions. When code is used, the
* runtime
is required. The runtime
value must be APPSYNC_JS
.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public FunctionConfiguration withCode(String code) {
setCode(code);
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 (getFunctionId() != null)
sb.append("FunctionId: ").append(getFunctionId()).append(",");
if (getFunctionArn() != null)
sb.append("FunctionArn: ").append(getFunctionArn()).append(",");
if (getName() != null)
sb.append("Name: ").append(getName()).append(",");
if (getDescription() != null)
sb.append("Description: ").append(getDescription()).append(",");
if (getDataSourceName() != null)
sb.append("DataSourceName: ").append(getDataSourceName()).append(",");
if (getRequestMappingTemplate() != null)
sb.append("RequestMappingTemplate: ").append(getRequestMappingTemplate()).append(",");
if (getResponseMappingTemplate() != null)
sb.append("ResponseMappingTemplate: ").append(getResponseMappingTemplate()).append(",");
if (getFunctionVersion() != null)
sb.append("FunctionVersion: ").append(getFunctionVersion()).append(",");
if (getSyncConfig() != null)
sb.append("SyncConfig: ").append(getSyncConfig()).append(",");
if (getMaxBatchSize() != null)
sb.append("MaxBatchSize: ").append(getMaxBatchSize()).append(",");
if (getRuntime() != null)
sb.append("Runtime: ").append(getRuntime()).append(",");
if (getCode() != null)
sb.append("Code: ").append(getCode());
sb.append("}");
return sb.toString();
}
@Override
public boolean equals(Object obj) {
if (this == obj)
return true;
if (obj == null)
return false;
if (obj instanceof FunctionConfiguration == false)
return false;
FunctionConfiguration other = (FunctionConfiguration) obj;
if (other.getFunctionId() == null ^ this.getFunctionId() == null)
return false;
if (other.getFunctionId() != null && other.getFunctionId().equals(this.getFunctionId()) == false)
return false;
if (other.getFunctionArn() == null ^ this.getFunctionArn() == null)
return false;
if (other.getFunctionArn() != null && other.getFunctionArn().equals(this.getFunctionArn()) == 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.getDescription() == null ^ this.getDescription() == null)
return false;
if (other.getDescription() != null && other.getDescription().equals(this.getDescription()) == false)
return false;
if (other.getDataSourceName() == null ^ this.getDataSourceName() == null)
return false;
if (other.getDataSourceName() != null && other.getDataSourceName().equals(this.getDataSourceName()) == false)
return false;
if (other.getRequestMappingTemplate() == null ^ this.getRequestMappingTemplate() == null)
return false;
if (other.getRequestMappingTemplate() != null && other.getRequestMappingTemplate().equals(this.getRequestMappingTemplate()) == false)
return false;
if (other.getResponseMappingTemplate() == null ^ this.getResponseMappingTemplate() == null)
return false;
if (other.getResponseMappingTemplate() != null && other.getResponseMappingTemplate().equals(this.getResponseMappingTemplate()) == false)
return false;
if (other.getFunctionVersion() == null ^ this.getFunctionVersion() == null)
return false;
if (other.getFunctionVersion() != null && other.getFunctionVersion().equals(this.getFunctionVersion()) == false)
return false;
if (other.getSyncConfig() == null ^ this.getSyncConfig() == null)
return false;
if (other.getSyncConfig() != null && other.getSyncConfig().equals(this.getSyncConfig()) == false)
return false;
if (other.getMaxBatchSize() == null ^ this.getMaxBatchSize() == null)
return false;
if (other.getMaxBatchSize() != null && other.getMaxBatchSize().equals(this.getMaxBatchSize()) == false)
return false;
if (other.getRuntime() == null ^ this.getRuntime() == null)
return false;
if (other.getRuntime() != null && other.getRuntime().equals(this.getRuntime()) == false)
return false;
if (other.getCode() == null ^ this.getCode() == null)
return false;
if (other.getCode() != null && other.getCode().equals(this.getCode()) == false)
return false;
return true;
}
@Override
public int hashCode() {
final int prime = 31;
int hashCode = 1;
hashCode = prime * hashCode + ((getFunctionId() == null) ? 0 : getFunctionId().hashCode());
hashCode = prime * hashCode + ((getFunctionArn() == null) ? 0 : getFunctionArn().hashCode());
hashCode = prime * hashCode + ((getName() == null) ? 0 : getName().hashCode());
hashCode = prime * hashCode + ((getDescription() == null) ? 0 : getDescription().hashCode());
hashCode = prime * hashCode + ((getDataSourceName() == null) ? 0 : getDataSourceName().hashCode());
hashCode = prime * hashCode + ((getRequestMappingTemplate() == null) ? 0 : getRequestMappingTemplate().hashCode());
hashCode = prime * hashCode + ((getResponseMappingTemplate() == null) ? 0 : getResponseMappingTemplate().hashCode());
hashCode = prime * hashCode + ((getFunctionVersion() == null) ? 0 : getFunctionVersion().hashCode());
hashCode = prime * hashCode + ((getSyncConfig() == null) ? 0 : getSyncConfig().hashCode());
hashCode = prime * hashCode + ((getMaxBatchSize() == null) ? 0 : getMaxBatchSize().hashCode());
hashCode = prime * hashCode + ((getRuntime() == null) ? 0 : getRuntime().hashCode());
hashCode = prime * hashCode + ((getCode() == null) ? 0 : getCode().hashCode());
return hashCode;
}
@Override
public FunctionConfiguration clone() {
try {
return (FunctionConfiguration) super.clone();
} catch (CloneNotSupportedException e) {
throw new IllegalStateException("Got a CloneNotSupportedException from Object.clone() " + "even though we're Cloneable!", e);
}
}
@com.amazonaws.annotation.SdkInternalApi
@Override
public void marshall(ProtocolMarshaller protocolMarshaller) {
com.amazonaws.services.appsync.model.transform.FunctionConfigurationMarshaller.getInstance().marshall(this, protocolMarshaller);
}
}