/* * 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.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.
*
* The Amazon Resource Name (ARN) of the Function
object.
*
* The name of the Function
object.
*
* The Function
description.
*
* The name of the DataSource
.
*
* The Function
request mapping template. Functions support only the 2018-05-29 version of the request
* mapping template.
*
* The Function
response mapping template.
*
* 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
.
*
* A unique ID representing the Function
object.
*
Function
object.
*/
public void setFunctionId(String functionId) {
this.functionId = functionId;
}
/**
*
* A unique ID representing the Function
object.
*
Function
object.
*/
public String getFunctionId() {
return this.functionId;
}
/**
*
* A unique ID representing the Function
object.
*
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.
*
Function
object.
*/
public void setFunctionArn(String functionArn) {
this.functionArn = functionArn;
}
/**
*
* The Amazon Resource Name (ARN) of the Function
object.
*
Function
object.
*/
public String getFunctionArn() {
return this.functionArn;
}
/**
*
* The Amazon Resource Name (ARN) of the Function
object.
*
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.
*
Function
object.
*/
public void setName(String name) {
this.name = name;
}
/**
*
* The name of the Function
object.
*
Function
object.
*/
public String getName() {
return this.name;
}
/**
*
* The name of the Function
object.
*
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.
*
Function
description.
*/
public void setDescription(String description) {
this.description = description;
}
/**
*
* The Function
description.
*
Function
description.
*/
public String getDescription() {
return this.description;
}
/**
*
* The Function
description.
*
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
.
*
DataSource
.
*/
public void setDataSourceName(String dataSourceName) {
this.dataSourceName = dataSourceName;
}
/**
*
* The name of the DataSource
.
*
DataSource
.
*/
public String getDataSourceName() {
return this.dataSourceName;
}
/**
*
* The name of the DataSource
.
*
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.
*
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.
*
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.
*
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.
*
Function
response mapping template.
*/
public void setResponseMappingTemplate(String responseMappingTemplate) {
this.responseMappingTemplate = responseMappingTemplate;
}
/**
*
* The Function
response mapping template.
*
Function
response mapping template.
*/
public String getResponseMappingTemplate() {
return this.responseMappingTemplate;
}
/**
*
* The Function
response mapping template.
*
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
.
*
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
.
*
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
.
*
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);
}
}