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

C++: Legacy cleanup for SES #5590

Merged
merged 10 commits into from
Nov 1, 2023
Merged
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
128 changes: 128 additions & 0 deletions .doc_gen/metadata/ses_metadata.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,14 @@ ses_SendEmail:
- description:
snippet_tags:
- ses.JavaScript.email.sendEmailV3
C++:
versions:
- sdk_version: 1
github: cpp/example_code/ses
excerpts:
- description:
snippet_tags:
- cpp.example_code.ses.SendEmail
services:
ses: {SendEmail}
ses_SendBulkTemplatedEmail:
Expand Down Expand Up @@ -123,6 +131,14 @@ ses_SendTemplatedEmail:
- description:
snippet_tags:
- ses.JavaScript.email.sendTemplatedEmailV3
C++:
versions:
- sdk_version: 1
github: cpp/example_code/ses
excerpts:
- description:
snippet_tags:
- cpp.example_code.ses.SendTemplatedEmail
services:
ses: {SendTemplatedEmail}
ses_VerifyDomainIdentity:
Expand Down Expand Up @@ -186,6 +202,14 @@ ses_VerifyEmailIdentity:
- description:
snippet_tags:
- ses.JavaScript.identities.verifyEmailIdentityV3
C++:
versions:
- sdk_version: 1
github: cpp/example_code/ses
excerpts:
- description:
snippet_tags:
- cpp.example_code.ses.VerifyEmailIdentity
services:
ses: {VerifyEmailIdentity}
ses_GetIdentityVerificationAttributes:
Expand Down Expand Up @@ -249,6 +273,14 @@ ses_DeleteIdentity:
- description:
snippet_tags:
- ses.JavaScript.identities.deleteIdentityV3
C++:
versions:
- sdk_version: 1
github: cpp/example_code/ses
excerpts:
- description:
snippet_tags:
- cpp.example_code.ses.DeleteIdentity
services:
ses: {DeleteIdentity}
ses_ListIdentities:
Expand Down Expand Up @@ -294,6 +326,14 @@ ses_ListIdentities:
snippet_tags:
- python.example_code.ses.SesIdentity
- python.example_code.ses.ListIdentities
C++:
versions:
- sdk_version: 1
github: cpp/example_code/ses
excerpts:
- description:
snippet_tags:
- cpp.example_code.ses.ListIdentities
services:
ses: {ListIdentities}
ses_CreateReceiptFilter:
Expand Down Expand Up @@ -322,6 +362,14 @@ ses_CreateReceiptFilter:
- description:
snippet_tags:
- ses.JavaScript.filters.createReceiptFilterV3
C++:
versions:
- sdk_version: 1
github: cpp/example_code/ses
excerpts:
- description:
snippet_tags:
- cpp.example_code.ses.CreateReceiptFilter
services:
ses: {CreateReceiptFilter}
ses_ListReceiptFilters:
Expand Down Expand Up @@ -349,6 +397,14 @@ ses_ListReceiptFilters:
- description:
snippet_tags:
- ses.JavaScript.filters.listReceiptFiltersV3
C++:
versions:
- sdk_version: 1
github: cpp/example_code/ses
excerpts:
- description:
snippet_tags:
- cpp.example_code.ses.ListReceiptFilters
services:
ses: {ListReceiptFilters}
ses_DeleteReceiptFilter:
Expand Down Expand Up @@ -376,6 +432,14 @@ ses_DeleteReceiptFilter:
- description:
snippet_tags:
- ses.JavaScript.filters.deleteReceiptFilterV3
C++:
versions:
- sdk_version: 1
github: cpp/example_code/ses
excerpts:
- description:
snippet_tags:
- cpp.example_code.ses.DeleteReceiptFilter
services:
ses: {DeleteReceiptFilter}
ses_CreateReceiptRuleSet:
Expand Down Expand Up @@ -404,6 +468,14 @@ ses_CreateReceiptRuleSet:
- description:
snippet_tags:
- ses.JavaScript.rules.createReceiptRuleSetV3
C++:
versions:
- sdk_version: 1
github: cpp/example_code/ses
excerpts:
- description:
snippet_tags:
- cpp.example_code.ses.CreateReceiptRuleSet
services:
ses: {CreateReceiptRuleSet}
ses_CreateReceiptRule:
Expand Down Expand Up @@ -434,6 +506,14 @@ ses_CreateReceiptRule:
- description:
snippet_tags:
- ses.JavaScript.rules.createReceiptRuleV3
C++:
versions:
- sdk_version: 1
github: cpp/example_code/ses
excerpts:
- description:
snippet_tags:
- cpp.example_code.ses.CreateReceiptRule
services:
ses: {CreateReceiptRule}
ses_DescribeReceiptRuleSet:
Expand Down Expand Up @@ -479,6 +559,14 @@ ses_DeleteReceiptRule:
- description:
snippet_tags:
- ses.JavaScript.rules.deleteReceiptRuleV3
C++:
versions:
- sdk_version: 1
github: cpp/example_code/ses
excerpts:
- description:
snippet_tags:
- cpp.example_code.ses.DeleteReceiptRule
services:
ses: {DeleteReceiptRule}
ses_DeleteReceiptRuleSet:
Expand Down Expand Up @@ -506,6 +594,14 @@ ses_DeleteReceiptRuleSet:
- description:
snippet_tags:
- ses.JavaScript.rules.deleteReceiptRuleSetV3
C++:
versions:
- sdk_version: 1
github: cpp/example_code/ses
excerpts:
- description:
snippet_tags:
- cpp.example_code.ses.DeleteReceiptRuleSet
services:
ses: {DeleteReceiptRuleSet}
ses_CreateTemplate:
Expand Down Expand Up @@ -542,6 +638,14 @@ ses_CreateTemplate:
- description:
snippet_tags:
- ses.JavaScript.templates.createTemplateV3
C++:
versions:
- sdk_version: 1
github: cpp/example_code/ses
excerpts:
- description:
snippet_tags:
- cpp.example_code.ses.CreateTemplate
services:
ses: {CreateTemplate}
ses_DeleteTemplate:
Expand Down Expand Up @@ -578,6 +682,14 @@ ses_DeleteTemplate:
- description:
snippet_tags:
- ses.JavaScript.templates.deleteTemplateV3
C++:
versions:
- sdk_version: 1
github: cpp/example_code/ses
excerpts:
- description:
snippet_tags:
- cpp.example_code.ses.DeleteTemplate
services:
ses: {DeleteTemplate}
ses_GetTemplate:
Expand Down Expand Up @@ -605,6 +717,14 @@ ses_GetTemplate:
- description:
snippet_tags:
- ses.JavaScript.templates.getTemplateV3
C++:
versions:
- sdk_version: 1
github: cpp/example_code/ses
excerpts:
- description:
snippet_tags:
- cpp.example_code.ses.GetTemplate
services:
ses: {GetTemplate}
ses_ListTemplates:
Expand Down Expand Up @@ -677,6 +797,14 @@ ses_UpdateTemplate:
- description:
snippet_tags:
- ses.JavaScript.templates.updateTemplateV3
C++:
versions:
- sdk_version: 1
github: cpp/example_code/ses
excerpts:
- description:
snippet_tags:
- cpp.example_code.ses.UpdateTemplate
services:
ses: {UpdateTemplate}
ses_GetSendQuota:
Expand Down
2 changes: 1 addition & 1 deletion .tools/readmes/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ authored for the SOS project. After you have authored metadata and snippet tags
for your examples, run the following command in the root folder of the repo:

```
python .doc_gen/readmes/writeme.py <language> <version> <service>
python .tools/readmes/writeme.py <language> <version> <service>
```

WRITME reads metadata and config data and generates a README in the service
Expand Down
12 changes: 12 additions & 0 deletions .tools/readmes/includes/run_instructions.jinja2
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,18 @@ dotnet run

Alternatively, you can run the example from within your IDE.

{% endif %}

{% if lang_config['name'] == 'C++' %}
An executable is built for each source file. These executables are located in the build folder and have
"run_" prepended to the source file name, minus the suffix. See the "main" function in the source file for further instructions.

For example, to run the action in the source file "my_action.cpp", execute the following command from within the build folder. The command
will display any required arguments.

```
./run_my_action
```
{% endif %}
<!--custom.instructions.start-->
{{ customs['instructions'] -}}
Expand Down
104 changes: 65 additions & 39 deletions cpp/example_code/ses/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,41 +1,67 @@
# Copyright 2010-2018 Amazon.com, Inc. or its affiliates. All Rights Reserved.
# This file is 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/
# 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.

cmake_minimum_required(VERSION 3.13)
project(ses-examples)
set (CMAKE_CXX_STANDARD 11)

# Locate the aws sdk for c++ package.
find_package(AWSSDK REQUIRED COMPONENTS email)

set(EXAMPLES "")
list(APPEND EXAMPLES "create_receipt_filter")
list(APPEND EXAMPLES "create_receipt_rule")
list(APPEND EXAMPLES "create_receipt_rule_set")
list(APPEND EXAMPLES "create_template")
list(APPEND EXAMPLES "delete_identity")
list(APPEND EXAMPLES "delete_receipt_filter")
list(APPEND EXAMPLES "delete_receipt_rule")
list(APPEND EXAMPLES "delete_receipt_rule_set")
list(APPEND EXAMPLES "delete_template")
list(APPEND EXAMPLES "get_template")
list(APPEND EXAMPLES "list_identities")
list(APPEND EXAMPLES "list_receipt_filters")
list(APPEND EXAMPLES "send_email")
list(APPEND EXAMPLES "send_templated_email")
list(APPEND EXAMPLES "update_template")
list(APPEND EXAMPLES "verify_email_identity")


# The executables to build.
foreach(EXAMPLE IN LISTS EXAMPLES)
add_executable(${EXAMPLE} ${EXAMPLE}.cpp)
target_link_libraries(${EXAMPLE} aws-cpp-sdk-email aws-cpp-sdk-core)
# Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
# SPDX-License-Identifier: Apache-2.0

# Set the minimum required version of CMake for this project.
cmake_minimum_required(VERSION 3.8)

set(SERVICE_NAME ses)
set(SERVICE_COMPONENTS email)

# Set this project's name.
project("${SERVICE_NAME}-examples")

# Build shared libraries by default.
set(BUILD_SHARED_LIBS ON)

# Set the C++ standard to use to build this target.
set(CMAKE_CXX_STANDARD 11)

# Use the MSVC variable to determine if this is a Windows build.
set(WINDOWS_BUILD ${MSVC})

# Set the location of where Windows can find the installed libraries of the SDK.
if(WINDOWS_BUILD)
string(REPLACE ";" "/aws-cpp-sdk-all;" SYSTEM_MODULE_PATH "${CMAKE_SYSTEM_PREFIX_PATH}/aws-cpp-sdk-all")
list(APPEND CMAKE_PREFIX_PATH ${SYSTEM_MODULE_PATH})
endif()

# Find the AWS SDK for C++ package.
find_package(AWSSDK REQUIRED COMPONENTS ${SERVICE_COMPONENTS})


if(WINDOWS_BUILD)
# Copy relevant AWS SDK for C++ libraries into the current binary directory for running and debugging.

# set(BIN_SUB_DIR "/Debug") # If you are building from the command line, you may need to uncomment this
# and set the proper subdirectory to the executables' location.

AWSSDK_CPY_DYN_LIBS(SERVICE_COMPONENTS "" ${CMAKE_CURRENT_BINARY_DIR}${BIN_SUB_DIR})
endif()


# AWSDOC_SOURCE can be defined in the command line to limit the files in a build. For example,
# you can limit files to one action.
if(NOT DEFINED AWSDOC_SOURCE)
file(GLOB AWSDOC_SOURCE
"*.cpp"
)
endif()

foreach(file ${AWSDOC_SOURCE})
get_filename_component(EXAMPLE ${file} NAME_WE)

# Build the code example executables.
set(EXAMPLE_EXE run_${EXAMPLE})

add_executable(${EXAMPLE_EXE} ${file})

target_link_libraries(${EXAMPLE_EXE} ${AWSSDK_LINK_LIBRARIES}
${AWSSDK_PLATFORM_DEPS})

endforeach()


if(BUILD_TESTS)
add_subdirectory(tests)
endif()

Loading