'use strict';

const awsCommon = require('../../lib/aws-common');

/**
 * AWS Lambda version 2014-11-11
 *
 * --- TODO REMOVE WHEN IMPLEMENTED ---
 * AUTOGENERATED BY build-api.py
 */

// Setup input and output to use AWS protocol rest-json
require('../../lib/aws-common/shape_http')('rest-json', module.exports, null);
// -----------------------------------
module.exports.UpdateFunctionConfiguration = awsCommon.as(
  'PUT',
  '/2014-11-13/functions/:FunctionName/configuration',
  function UpdateFunctionConfiguration(aws) {
    var functionName = aws.reqParams.FunctionName;
    var role = aws.params.Role;
    var description = aws.params.Description;
    var memorySize = aws.params.MemorySize /* Type integer */;
    var timeout = aws.params.Timeout /* Type integer */;
    var handler = aws.params.Handler;
    if (!functionName) {
      return [400, 'Sender', 'MissingParameter', 'Did not specify parameter FunctionName'];
    }


    // TODO implement code

    var ret = /*Se*/{
      LastModified: awsCommon.timestamp(),
      FunctionName: '',
      Role: '',
      ConfigurationId: '',
      CodeSize: 0 /*Long*/,
      Runtime: '',
      Mode: '',
      Description: '',
      MemorySize: 0,
      FunctionARN: '',
      Timeout: 0,
      Handler: '',
    };
    return [200, ret];
  });
// -----------------------------------
module.exports.ListFunctions = awsCommon.as(
  'GET',
  '/2014-11-13/functions/',
  function ListFunctions(aws) {
    var marker = aws.params.Marker;
    var maxItems = aws.params.MaxItems /* Type integer */;


    // TODO implement code

    var ret = {
      NextMarker: '',
      Functions: [ /*Se*/{
        LastModified: awsCommon.timestamp(),
        FunctionName: '',
        Role: '',
        ConfigurationId: '',
        CodeSize: 0 /*Long*/,
        Runtime: '',
        Mode: '',
        Description: '',
        MemorySize: 0,
        FunctionARN: '',
        Timeout: 0,
        Handler: '',
      }, /* ...*/ ],
    };
    return [200, ret];
  });
// -----------------------------------
module.exports.DeleteFunction = awsCommon.as(
  'DELETE',
  '/2014-11-13/functions/:FunctionName',
  function DeleteFunction(aws) {
    var functionName = aws.reqParams.FunctionName;
    if (!functionName) {
      return [400, 'Sender', 'MissingParameter', 'Did not specify parameter FunctionName'];
    }


    // TODO implement code

    var ret = {};
    return [204, ret];
  });
// -----------------------------------
module.exports.GetFunctionConfiguration = awsCommon.as(
  'GET',
  '/2014-11-13/functions/:FunctionName/configuration',
  function GetFunctionConfiguration(aws) {
    var functionName = aws.reqParams.FunctionName;
    if (!functionName) {
      return [400, 'Sender', 'MissingParameter', 'Did not specify parameter FunctionName'];
    }


    // TODO implement code

    var ret = /*Se*/{
      LastModified: awsCommon.timestamp(),
      FunctionName: '',
      Role: '',
      ConfigurationId: '',
      CodeSize: 0 /*Long*/,
      Runtime: '',
      Mode: '',
      Description: '',
      MemorySize: 0,
      FunctionARN: '',
      Timeout: 0,
      Handler: '',
    };
    return [200, ret];
  });
// -----------------------------------
module.exports.InvokeAsync = awsCommon.as(
  '/2014-11-13/functions/:FunctionName/invoke-async/',
  function InvokeAsync(aws) {
    var functionName = aws.reqParams.FunctionName;
    var invokeArgs = aws.params.InvokeArgs;
    if (!functionName) {
      return [400, 'Sender', 'MissingParameter', 'Did not specify parameter FunctionName'];
    }
    if (!invokeArgs) {
      return [400, 'Sender', 'MissingParameter', 'Did not specify parameter InvokeArgs'];
    }


    // TODO implement code

    var ret = {
      Status: 0,
    };
    return [202, ret];
  });
// -----------------------------------
module.exports.AddEventSource = awsCommon.as(
  '/2014-11-13/event-source-mappings/',
  function AddEventSource(aws) {
    var functionName = aws.params.FunctionName;
    var batchSize = aws.params.BatchSize /* Type integer */;
    var role = aws.params.Role;
    var eventSource = aws.params.EventSource;
    var parameters = aws.params.Parameters;
    if (!eventSource) {
      return [400, 'Sender', 'MissingParameter', 'Did not specify parameter EventSource'];
    }
    if (!functionName) {
      return [400, 'Sender', 'MissingParameter', 'Did not specify parameter FunctionName'];
    }
    if (!role) {
      return [400, 'Sender', 'MissingParameter', 'Did not specify parameter Role'];
    }


    // TODO implement code

    var ret = /*S7*/{
      LastModified: awsCommon.timestamp(),
      IsActive: false,
      FunctionName: '',
      BatchSize: 0,
      Role: '',
      EventSource: '',
      Status: '',
      UUID: '',
      Parameters: /*S6*/{} /*Map*/,
    };
    return [200, ret];
  });
// -----------------------------------
module.exports.GetFunction = awsCommon.as(
  'GET',
  '/2014-11-13/functions/:FunctionName',
  function GetFunction(aws) {
    var functionName = aws.reqParams.FunctionName;
    if (!functionName) {
      return [400, 'Sender', 'MissingParameter', 'Did not specify parameter FunctionName'];
    }


    // TODO implement code

    var ret = {
      Code: {
        RepositoryType: '',
        Location: '',
      },
      Configuration: /*Se*/{
        LastModified: awsCommon.timestamp(),
        FunctionName: '',
        Role: '',
        ConfigurationId: '',
        CodeSize: 0 /*Long*/,
        Runtime: '',
        Mode: '',
        Description: '',
        MemorySize: 0,
        FunctionARN: '',
        Timeout: 0,
        Handler: '',
      },
    };
    return [200, ret];
  });
// -----------------------------------
module.exports.RemoveEventSource = awsCommon.as(
  'DELETE',
  '/2014-11-13/event-source-mappings/:UUID',
  function RemoveEventSource(aws) {
    var uUID = aws.reqParams.UUID;
    if (!uUID) {
      return [400, 'Sender', 'MissingParameter', 'Did not specify parameter UUID'];
    }


    // TODO implement code

    var ret = {};
    return [204, ret];
  });
// -----------------------------------
module.exports.GetEventSource = awsCommon.as(
  'GET',
  '/2014-11-13/event-source-mappings/:UUID',
  function GetEventSource(aws) {
    var uUID = aws.reqParams.UUID;
    if (!uUID) {
      return [400, 'Sender', 'MissingParameter', 'Did not specify parameter UUID'];
    }


    // TODO implement code

    var ret = /*S7*/{
      LastModified: awsCommon.timestamp(),
      IsActive: false,
      FunctionName: '',
      BatchSize: 0,
      Role: '',
      EventSource: '',
      Status: '',
      UUID: '',
      Parameters: /*S6*/{} /*Map*/,
    };
    return [200, ret];
  });
// -----------------------------------
module.exports.UploadFunction = awsCommon.as(
  'PUT',
  '/2014-11-13/functions/:FunctionName',
  function UploadFunction(aws) {
    var functionName = aws.reqParams.FunctionName;
    var role = aws.params.Role;
    var runtime = aws.params.Runtime;
    var memorySize = aws.params.MemorySize /* Type integer */;
    var mode = aws.params.Mode;
    var description = aws.params.Description;
    var functionZip = aws.params.FunctionZip;
    var timeout = aws.params.Timeout /* Type integer */;
    var handler = aws.params.Handler;
    if (!functionName) {
      return [400, 'Sender', 'MissingParameter', 'Did not specify parameter FunctionName'];
    }
    if (!functionZip) {
      return [400, 'Sender', 'MissingParameter', 'Did not specify parameter FunctionZip'];
    }
    if (!runtime) {
      return [400, 'Sender', 'MissingParameter', 'Did not specify parameter Runtime'];
    }
    if (!role) {
      return [400, 'Sender', 'MissingParameter', 'Did not specify parameter Role'];
    }
    if (!handler) {
      return [400, 'Sender', 'MissingParameter', 'Did not specify parameter Handler'];
    }
    if (!mode) {
      return [400, 'Sender', 'MissingParameter', 'Did not specify parameter Mode'];
    }


    // TODO implement code

    var ret = /*Se*/{
      LastModified: awsCommon.timestamp(),
      FunctionName: '',
      Role: '',
      ConfigurationId: '',
      CodeSize: 0 /*Long*/,
      Runtime: '',
      Mode: '',
      Description: '',
      MemorySize: 0,
      FunctionARN: '',
      Timeout: 0,
      Handler: '',
    };
    return [201, ret];
  });
// -----------------------------------
module.exports.ListEventSources = awsCommon.as(
  'GET',
  '/2014-11-13/event-source-mappings/',
  function ListEventSources(aws) {
    var marker = aws.params.Marker;
    var eventSourceArn = aws.params.EventSourceArn;
    var functionName = aws.params.FunctionName;
    var maxItems = aws.params.MaxItems /* Type integer */;


    // TODO implement code

    var ret = {
      NextMarker: '',
      EventSources: [ /*S7*/{
        LastModified: awsCommon.timestamp(),
        IsActive: false,
        FunctionName: '',
        BatchSize: 0,
        Role: '',
        EventSource: '',
        Status: '',
        UUID: '',
        Parameters: /*S6*/{} /*Map*/,
      }, /* ...*/ ],
    };
    return [200, ret];
  });
