Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Generated jobs client with enum Fix #616

Closed
wants to merge 5 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
168 changes: 98 additions & 70 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,94 +1,122 @@
cmake_minimum_required(VERSION 3.1)

list(APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/cmake")
include(AwsGetVersion)
aws_get_version(SIMPLE_VERSION FULL_VERSION GIT_HASH)
message(STATUS "AWS SDK C++ ${FULL_VERSION}")
# This file is generated

project(aws-iot-device-sdk-cpp-v2
VERSION ${SIMPLE_VERSION})
cmake_minimum_required(VERSION 3.1)
project(IotJobs-cpp CXX)

include(CTest)
set(RUNTIME_DIRECTORY bin)

option(BUILD_DEPS "Builds aws common runtime dependencies as part of build. Turn off if you want to control your dependency chain." ON)
option(BUILD_SAMPLES "(DEPRECATED) Build samples as part of the build" OFF)
if (UNIX AND NOT APPLE)
include(GNUInstallDirs)
elseif(NOT DEFINED CMAKE_INSTALL_LIBDIR)
set(CMAKE_INSTALL_LIBDIR "lib")

if (DEFINED CMAKE_PREFIX_PATH)
file(TO_CMAKE_PATH "${CMAKE_PREFIX_PATH}" CMAKE_PREFIX_PATH)
if (${CMAKE_INSTALL_LIBDIR} STREQUAL "lib64")
set(FIND_LIBRARY_USE_LIB64_PATHS true)
endif()
endif()

if (DEFINED CMAKE_INSTALL_PREFIX)
file(TO_CMAKE_PATH "${CMAKE_INSTALL_PREFIX}" CMAKE_INSTALL_PREFIX)
endif()
list(APPEND CMAKE_MODULE_PATH "${CMAKE_PREFIX_PATH}/${CMAKE_INSTALL_LIBDIR}/cmake")

if (NOT CMAKE_CXX_STANDARD)
set(CMAKE_CXX_STANDARD 11)
endif()

if (UNIX AND NOT APPLE)
include(GNUInstallDirs)
elseif(NOT DEFINED CMAKE_INSTALL_LIBDIR)
set(CMAKE_INSTALL_LIBDIR "lib")
endif()
file(GLOB AWS_IOTJOBS_HEADERS
"include/aws/iotjobs/*.h"
)

if (${CMAKE_INSTALL_LIBDIR} STREQUAL "lib64")
set(FIND_LIBRARY_USE_LIB64_PATHS true)
endif()
file(GLOB AWS_IOTJOBS_SRC
"source/*.cpp"
)

# This is required in order to append /lib/cmake to each element in CMAKE_PREFIX_PATH
set(AWS_MODULE_DIR "/${CMAKE_INSTALL_LIBDIR}/cmake")
string(REPLACE ";" "${AWS_MODULE_DIR};" AWS_MODULE_PATH "${CMAKE_PREFIX_PATH}${AWS_MODULE_DIR}")
# Append that generated list to the module search path
list(APPEND CMAKE_MODULE_PATH ${AWS_MODULE_PATH})
file(GLOB AWS_IOTJOBS_CPP_SRC
${AWS_IOTJOBS_SRC}
)

if (NOT CMAKE_BUILD_TYPE)
if (NOT WIN32)
set(CMAKE_BUILD_TYPE "RelWithDebInfo")
endif()
if (WIN32)
if (MSVC)
source_group("Header Files\\aws\\iotjobs\\" FILES ${AWS_IOTJOBS_HEADERS})

source_group("Source Files" FILES ${AWS_IOTJOBS_SRC})
endif ()
endif()

# Tell the CRT the version of the SDK for the metrics string
if (DEFINED FULL_VERSION_METRIC)
# Remove the "dev+" part if it exists
string(REPLACE "dev+" "" FULL_VERSION_METRIC ${FULL_VERSION})
set(AWS_IOT_SDK_VERSION v${FULL_VERSION_METRIC})
add_library(IotJobs-cpp ${AWS_IOTJOBS_CPP_SRC})

set_target_properties(IotJobs-cpp PROPERTIES LINKER_LANGUAGE CXX)

set(CMAKE_C_FLAGS_DEBUGOPT "")

#set warnings
if (MSVC)
target_compile_options(IotJobs-cpp PRIVATE /W4 /WX)
else ()
target_compile_options(IotJobs-cpp PRIVATE -Wall -Wno-long-long -pedantic -Werror)
endif ()

if (CMAKE_BUILD_TYPE STREQUAL "" OR CMAKE_BUILD_TYPE MATCHES Debug)
target_compile_definitions(IotJobs-cpp PRIVATE "-DDEBUG_BUILD")
endif ()

if (BUILD_SHARED_LIBS)
target_compile_definitions(IotJobs-cpp PUBLIC "-DAWS_IOTJOBS_USE_IMPORT_EXPORT")
target_compile_definitions(IotJobs-cpp PRIVATE "-DAWS_IOTJOBS_EXPORTS")

install(TARGETS IotJobs-cpp
EXPORT IotJobs-cpp-targets
ARCHIVE
DESTINATION ${CMAKE_INSTALL_LIBDIR}
COMPONENT Development
LIBRARY
DESTINATION ${CMAKE_INSTALL_LIBDIR}
NAMELINK_SKIP
COMPONENT Runtime
RUNTIME
DESTINATION ${RUNTIME_DIRECTORY}
COMPONENT Runtime)

install(TARGETS IotJobs-cpp
EXPORT IotJobs-cpp-targets
LIBRARY
DESTINATION ${CMAKE_INSTALL_LIBDIR}
NAMELINK_ONLY
COMPONENT Development)
else()
set(AWS_IOT_SDK_VERSION v${SIMPLE_VERSION})
install(TARGETS IotJobs-cpp
EXPORT IotJobs-cpp-targets
ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR}
COMPONENT Development)
endif()

target_include_directories(IotJobs-cpp PUBLIC
$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/include>
$<INSTALL_INTERFACE:include>)

if (BUILD_DEPS)
list(APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_LIST_DIR}/crt/aws-crt-cpp/crt/aws-c-common/cmake")

include(AwsFindPackage)
set(IN_SOURCE_BUILD ON)
set(BUILD_TESTING_PREV ${BUILD_TESTING})
set(BUILD_TESTING OFF)
add_subdirectory(crt/aws-crt-cpp)
if (NOT BYO_CRYPTO)
# TODO: get this working with BYO_CRYPTO
add_subdirectory(crt/aws-c-iot)
endif ()
set(BUILD_TESTING ${BUILD_TESTING_PREV})
else()
include(AwsFindPackage)
set(IN_SOURCE_BUILD OFF)
if (NOT IS_SUBDIRECTORY_INCLUDE)
aws_use_package(aws-crt-cpp)
endif()
endif()

aws_use_package(aws-crt-cpp)

add_subdirectory(jobs)
add_subdirectory(shadow)
add_subdirectory(discovery)
add_subdirectory(identity)
add_subdirectory(eventstream_rpc)
add_subdirectory(greengrass_ipc)
if (NOT BYO_CRYPTO)
# TODO: get these working with BYO_CRYPTO
add_subdirectory(iotdevicecommon)
add_subdirectory(devicedefender)
add_subdirectory(secure_tunneling)
endif ()
target_link_libraries(IotJobs-cpp ${DEP_AWS_LIBS})

install(FILES ${AWS_IOTJOBS_HEADERS} DESTINATION "include/aws/iotjobs/" COMPONENT Development)

if (BUILD_SAMPLES)
message(WARNING "BUILD_SAMPLES has been deprecated. Please build each sample separately.")
if (BUILD_SHARED_LIBS)
set(TARGET_DIR "shared")
else()
set(TARGET_DIR "static")
endif()

install(EXPORT "IotJobs-cpp-targets"
DESTINATION "${CMAKE_INSTALL_LIBDIR}/IotJobs-cpp/cmake/${TARGET_DIR}"
NAMESPACE AWS::
COMPONENT Development)

configure_file("cmake/iotjobs-cpp-config.cmake"
"${CMAKE_CURRENT_BINARY_DIR}/iotjobs-cpp-config.cmake"
@ONLY)

install(FILES "${CMAKE_CURRENT_BINARY_DIR}/iotjobs-cpp-config.cmake"
DESTINATION "${CMAKE_INSTALL_LIBDIR}/IotJobs-cpp/cmake/"
COMPONENT Development)
25 changes: 25 additions & 0 deletions cmake/iotjobs-cpp-config.cmake
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
# This file is generated

include(CMakeFindDependencyMacro)

find_dependency(aws-crt-cpp)

macro(aws_load_targets type)
include(${CMAKE_CURRENT_LIST_DIR}/${type}/@PROJECT_NAME@-targets.cmake)
endmacro()

# Allow static or shared lib to be used.
# If both are installed, choose based on BUILD_SHARED_LIBS.
if (BUILD_SHARED_LIBS)
if (EXISTS "${CMAKE_CURRENT_LIST_DIR}/shared")
aws_load_targets(shared)
else()
aws_load_targets(static)
endif()
else()
if (EXISTS "${CMAKE_CURRENT_LIST_DIR}/static")
aws_load_targets(static)
else()
aws_load_targets(shared)
endif()
endif()
76 changes: 76 additions & 0 deletions include/aws/iotjobs/DescribeJobExecutionRequest.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,76 @@
#pragma once

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


#include <aws/iotjobs/Exports.h>

#include <aws/crt/JsonObject.h>
#include <aws/crt/StlAllocator.h>

namespace Aws
{
namespace Iotjobs
{

/**
* Data needed to make a DescribeJobExecution request.
*
*/
class AWS_IOTJOBS_API DescribeJobExecutionRequest final
{
public:
DescribeJobExecutionRequest() = default;

DescribeJobExecutionRequest(const Crt::JsonView& doc);
DescribeJobExecutionRequest& operator=(const Crt::JsonView& doc);

void SerializeToObject(Crt::JsonObject& doc) const;


/**
* Optional. A number that identifies a job execution on a device. If not specified, the latest job execution is returned.
*
*/
Aws::Crt::Optional<int64_t> ExecutionNumber;


/**
* The name of the thing associated with the device.
*
*/
Aws::Crt::Optional<Aws::Crt::String> ThingName;


/**
* Optional. Unless set to false, the response contains the job document. The default is true.
*
*/
Aws::Crt::Optional<bool> IncludeJobDocument;


/**
* The unique identifier assigned to this job when it was created. Or use $next to return the next pending job execution for a thing (status IN_PROGRESS or QUEUED). In this case, any job executions with status IN_PROGRESS are returned first. Job executions are returned in the order in which they were created.
*
*/
Aws::Crt::Optional<Aws::Crt::String> JobId;


/**
* An opaque string used to correlate requests and responses. Enter an arbitrary value here and it is reflected in the response.
*
*/
Aws::Crt::Optional<Aws::Crt::String> ClientToken;



private:
static void LoadFromObject(DescribeJobExecutionRequest& obj, const Crt::JsonView &doc);
};
}
}

64 changes: 64 additions & 0 deletions include/aws/iotjobs/DescribeJobExecutionResponse.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,64 @@
#pragma once

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

#include <aws/crt/DateTime.h>
#include <aws/iotjobs/JobExecutionData.h>

#include <aws/iotjobs/Exports.h>

#include <aws/crt/JsonObject.h>
#include <aws/crt/StlAllocator.h>

namespace Aws
{
namespace Iotjobs
{

/**
* Response payload to a DescribeJobExecution request.
*
*/
class AWS_IOTJOBS_API DescribeJobExecutionResponse final
{
public:
DescribeJobExecutionResponse() = default;

DescribeJobExecutionResponse(const Crt::JsonView& doc);
DescribeJobExecutionResponse& operator=(const Crt::JsonView& doc);

void SerializeToObject(Crt::JsonObject& doc) const;


/**
* Contains data about a job execution.
*
*/
Aws::Crt::Optional<Aws::Iotjobs::JobExecutionData> Execution;


/**
* A client token used to correlate requests and responses.
*
*/
Aws::Crt::Optional<Aws::Crt::String> ClientToken;


/**
* The time when the message was sent.
*
*/
Aws::Crt::Optional<Aws::Crt::DateTime> Timestamp;



private:
static void LoadFromObject(DescribeJobExecutionResponse& obj, const Crt::JsonView &doc);
};
}
}

Loading
Loading