/**
 * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
 * SPDX-License-Identifier: Apache-2.0.
 */

#pragma once
#include <aws/appsync/AppSyncRequest.h>
#include <aws/appsync/AppSync_EXPORTS.h>
#include <aws/appsync/model/AppSyncRuntime.h>
#include <aws/appsync/model/SyncConfig.h>
#include <aws/core/utils/memory/stl/AWSString.h>

#include <utility>

namespace Aws {
namespace AppSync {
namespace Model {

/**
 */
class UpdateFunctionRequest : public AppSyncRequest {
 public:
  AWS_APPSYNC_API UpdateFunctionRequest() = default;

  // Service request name is the Operation name which will send this request out,
  // each operation should has unique request name, so that we can get operation's name from this request.
  // Note: this is not true for response, multiple operations may have the same response name,
  // so we can not get operation's name from response.
  inline virtual const char* GetServiceRequestName() const override { return "UpdateFunction"; }

  AWS_APPSYNC_API Aws::String SerializePayload() const override;

  ///@{
  /**
   * <p>The GraphQL API ID.</p>
   */
  inline const Aws::String& GetApiId() const { return m_apiId; }
  inline bool ApiIdHasBeenSet() const { return m_apiIdHasBeenSet; }
  template <typename ApiIdT = Aws::String>
  void SetApiId(ApiIdT&& value) {
    m_apiIdHasBeenSet = true;
    m_apiId = std::forward<ApiIdT>(value);
  }
  template <typename ApiIdT = Aws::String>
  UpdateFunctionRequest& WithApiId(ApiIdT&& value) {
    SetApiId(std::forward<ApiIdT>(value));
    return *this;
  }
  ///@}

  ///@{
  /**
   * <p>The <code>Function</code> name.</p>
   */
  inline const Aws::String& GetName() const { return m_name; }
  inline bool NameHasBeenSet() const { return m_nameHasBeenSet; }
  template <typename NameT = Aws::String>
  void SetName(NameT&& value) {
    m_nameHasBeenSet = true;
    m_name = std::forward<NameT>(value);
  }
  template <typename NameT = Aws::String>
  UpdateFunctionRequest& WithName(NameT&& value) {
    SetName(std::forward<NameT>(value));
    return *this;
  }
  ///@}

  ///@{
  /**
   * <p>The <code>Function</code> description.</p>
   */
  inline const Aws::String& GetDescription() const { return m_description; }
  inline bool DescriptionHasBeenSet() const { return m_descriptionHasBeenSet; }
  template <typename DescriptionT = Aws::String>
  void SetDescription(DescriptionT&& value) {
    m_descriptionHasBeenSet = true;
    m_description = std::forward<DescriptionT>(value);
  }
  template <typename DescriptionT = Aws::String>
  UpdateFunctionRequest& WithDescription(DescriptionT&& value) {
    SetDescription(std::forward<DescriptionT>(value));
    return *this;
  }
  ///@}

  ///@{
  /**
   * <p>The function ID.</p>
   */
  inline const Aws::String& GetFunctionId() const { return m_functionId; }
  inline bool FunctionIdHasBeenSet() const { return m_functionIdHasBeenSet; }
  template <typename FunctionIdT = Aws::String>
  void SetFunctionId(FunctionIdT&& value) {
    m_functionIdHasBeenSet = true;
    m_functionId = std::forward<FunctionIdT>(value);
  }
  template <typename FunctionIdT = Aws::String>
  UpdateFunctionRequest& WithFunctionId(FunctionIdT&& value) {
    SetFunctionId(std::forward<FunctionIdT>(value));
    return *this;
  }
  ///@}

  ///@{
  /**
   * <p>The <code>Function</code> <code>DataSource</code> name.</p>
   */
  inline const Aws::String& GetDataSourceName() const { return m_dataSourceName; }
  inline bool DataSourceNameHasBeenSet() const { return m_dataSourceNameHasBeenSet; }
  template <typename DataSourceNameT = Aws::String>
  void SetDataSourceName(DataSourceNameT&& value) {
    m_dataSourceNameHasBeenSet = true;
    m_dataSourceName = std::forward<DataSourceNameT>(value);
  }
  template <typename DataSourceNameT = Aws::String>
  UpdateFunctionRequest& WithDataSourceName(DataSourceNameT&& value) {
    SetDataSourceName(std::forward<DataSourceNameT>(value));
    return *this;
  }
  ///@}

  ///@{
  /**
   * <p>The <code>Function</code> request mapping template. Functions support only
   * the 2018-05-29 version of the request mapping template.</p>
   */
  inline const Aws::String& GetRequestMappingTemplate() const { return m_requestMappingTemplate; }
  inline bool RequestMappingTemplateHasBeenSet() const { return m_requestMappingTemplateHasBeenSet; }
  template <typename RequestMappingTemplateT = Aws::String>
  void SetRequestMappingTemplate(RequestMappingTemplateT&& value) {
    m_requestMappingTemplateHasBeenSet = true;
    m_requestMappingTemplate = std::forward<RequestMappingTemplateT>(value);
  }
  template <typename RequestMappingTemplateT = Aws::String>
  UpdateFunctionRequest& WithRequestMappingTemplate(RequestMappingTemplateT&& value) {
    SetRequestMappingTemplate(std::forward<RequestMappingTemplateT>(value));
    return *this;
  }
  ///@}

  ///@{
  /**
   * <p>The <code>Function</code> request mapping template.</p>
   */
  inline const Aws::String& GetResponseMappingTemplate() const { return m_responseMappingTemplate; }
  inline bool ResponseMappingTemplateHasBeenSet() const { return m_responseMappingTemplateHasBeenSet; }
  template <typename ResponseMappingTemplateT = Aws::String>
  void SetResponseMappingTemplate(ResponseMappingTemplateT&& value) {
    m_responseMappingTemplateHasBeenSet = true;
    m_responseMappingTemplate = std::forward<ResponseMappingTemplateT>(value);
  }
  template <typename ResponseMappingTemplateT = Aws::String>
  UpdateFunctionRequest& WithResponseMappingTemplate(ResponseMappingTemplateT&& value) {
    SetResponseMappingTemplate(std::forward<ResponseMappingTemplateT>(value));
    return *this;
  }
  ///@}

  ///@{
  /**
   * <p>The <code>version</code> of the request mapping template. Currently, the
   * supported value is 2018-05-29. Note that when using VTL and mapping templates,
   * the <code>functionVersion</code> is required.</p>
   */
  inline const Aws::String& GetFunctionVersion() const { return m_functionVersion; }
  inline bool FunctionVersionHasBeenSet() const { return m_functionVersionHasBeenSet; }
  template <typename FunctionVersionT = Aws::String>
  void SetFunctionVersion(FunctionVersionT&& value) {
    m_functionVersionHasBeenSet = true;
    m_functionVersion = std::forward<FunctionVersionT>(value);
  }
  template <typename FunctionVersionT = Aws::String>
  UpdateFunctionRequest& WithFunctionVersion(FunctionVersionT&& value) {
    SetFunctionVersion(std::forward<FunctionVersionT>(value));
    return *this;
  }
  ///@}

  ///@{

  inline const SyncConfig& GetSyncConfig() const { return m_syncConfig; }
  inline bool SyncConfigHasBeenSet() const { return m_syncConfigHasBeenSet; }
  template <typename SyncConfigT = SyncConfig>
  void SetSyncConfig(SyncConfigT&& value) {
    m_syncConfigHasBeenSet = true;
    m_syncConfig = std::forward<SyncConfigT>(value);
  }
  template <typename SyncConfigT = SyncConfig>
  UpdateFunctionRequest& WithSyncConfig(SyncConfigT&& value) {
    SetSyncConfig(std::forward<SyncConfigT>(value));
    return *this;
  }
  ///@}

  ///@{
  /**
   * <p>The maximum batching size for a resolver.</p>
   */
  inline int GetMaxBatchSize() const { return m_maxBatchSize; }
  inline bool MaxBatchSizeHasBeenSet() const { return m_maxBatchSizeHasBeenSet; }
  inline void SetMaxBatchSize(int value) {
    m_maxBatchSizeHasBeenSet = true;
    m_maxBatchSize = value;
  }
  inline UpdateFunctionRequest& WithMaxBatchSize(int value) {
    SetMaxBatchSize(value);
    return *this;
  }
  ///@}

  ///@{

  inline const AppSyncRuntime& GetRuntime() const { return m_runtime; }
  inline bool RuntimeHasBeenSet() const { return m_runtimeHasBeenSet; }
  template <typename RuntimeT = AppSyncRuntime>
  void SetRuntime(RuntimeT&& value) {
    m_runtimeHasBeenSet = true;
    m_runtime = std::forward<RuntimeT>(value);
  }
  template <typename RuntimeT = AppSyncRuntime>
  UpdateFunctionRequest& WithRuntime(RuntimeT&& value) {
    SetRuntime(std::forward<RuntimeT>(value));
    return *this;
  }
  ///@}

  ///@{
  /**
   * <p>The <code>function</code> code that contains the request and response
   * functions. When code is used, the <code>runtime</code> is required. The
   * <code>runtime</code> value must be <code>APPSYNC_JS</code>.</p>
   */
  inline const Aws::String& GetCode() const { return m_code; }
  inline bool CodeHasBeenSet() const { return m_codeHasBeenSet; }
  template <typename CodeT = Aws::String>
  void SetCode(CodeT&& value) {
    m_codeHasBeenSet = true;
    m_code = std::forward<CodeT>(value);
  }
  template <typename CodeT = Aws::String>
  UpdateFunctionRequest& WithCode(CodeT&& value) {
    SetCode(std::forward<CodeT>(value));
    return *this;
  }
  ///@}
 private:
  Aws::String m_apiId;
  bool m_apiIdHasBeenSet = false;

  Aws::String m_name;
  bool m_nameHasBeenSet = false;

  Aws::String m_description;
  bool m_descriptionHasBeenSet = false;

  Aws::String m_functionId;
  bool m_functionIdHasBeenSet = false;

  Aws::String m_dataSourceName;
  bool m_dataSourceNameHasBeenSet = false;

  Aws::String m_requestMappingTemplate;
  bool m_requestMappingTemplateHasBeenSet = false;

  Aws::String m_responseMappingTemplate;
  bool m_responseMappingTemplateHasBeenSet = false;

  Aws::String m_functionVersion;
  bool m_functionVersionHasBeenSet = false;

  SyncConfig m_syncConfig;
  bool m_syncConfigHasBeenSet = false;

  int m_maxBatchSize{0};
  bool m_maxBatchSizeHasBeenSet = false;

  AppSyncRuntime m_runtime;
  bool m_runtimeHasBeenSet = false;

  Aws::String m_code;
  bool m_codeHasBeenSet = false;
};

}  // namespace Model
}  // namespace AppSync
}  // namespace Aws
