|
| 1 | +# Support code examples for the SDK for Swift |
| 2 | + |
| 3 | +## Overview |
| 4 | + |
| 5 | +Shows how to use the AWS SDK for Swift to work with AWS Support. |
| 6 | + |
| 7 | +<!--custom.overview.start--> |
| 8 | +<!--custom.overview.end--> |
| 9 | + |
| 10 | +_Support provides support for users of Amazon Web Services._ |
| 11 | + |
| 12 | +## ⚠ Important |
| 13 | + |
| 14 | +* Running this code might result in charges to your AWS account. For more details, see [AWS Pricing](https://aws.amazon.com/pricing/) and [Free Tier](https://aws.amazon.com/free/). |
| 15 | +* Running the tests might result in charges to your AWS account. |
| 16 | +* We recommend that you grant your code least privilege. At most, grant only the minimum permissions required to perform the task. For more information, see [Grant least privilege](https://docs.aws.amazon.com/IAM/latest/UserGuide/best-practices.html#grant-least-privilege). |
| 17 | +* This code is not tested in every AWS Region. For more information, see [AWS Regional Services](https://aws.amazon.com/about-aws/global-infrastructure/regional-product-services). |
| 18 | + |
| 19 | +<!--custom.important.start--> |
| 20 | +<!--custom.important.end--> |
| 21 | + |
| 22 | +## Code examples |
| 23 | + |
| 24 | +### Prerequisites |
| 25 | + |
| 26 | +For prerequisites, see the [README](../../README.md#Prerequisites) in the `swift` folder. |
| 27 | + |
| 28 | + |
| 29 | +<!--custom.prerequisites.start--> |
| 30 | +<!--custom.prerequisites.end--> |
| 31 | + |
| 32 | +### Get started |
| 33 | + |
| 34 | +- [Hello Support](hello/Package.swift#L8) (`DescribeServices`) |
| 35 | + |
| 36 | + |
| 37 | +### Basics |
| 38 | + |
| 39 | +Code examples that show you how to perform the essential operations within a service. |
| 40 | + |
| 41 | +- [Learn the basics](scenario/Package.swift) |
| 42 | + |
| 43 | + |
| 44 | +### Single actions |
| 45 | + |
| 46 | +Code excerpts that show you how to call individual service functions. |
| 47 | + |
| 48 | +- [AddAttachmentsToSet](scenario/Sources/Scenario.swift#L463) |
| 49 | +- [AddCommunicationToCase](scenario/Sources/Scenario.swift#L512) |
| 50 | +- [CreateCase](scenario/Sources/Scenario.swift#L361) |
| 51 | +- [DescribeAttachment](scenario/Sources/Scenario.swift#L600) |
| 52 | +- [DescribeCases](scenario/Sources/Scenario.swift#L410) |
| 53 | +- [DescribeCommunications](scenario/Sources/Scenario.swift#L562) |
| 54 | +- [DescribeServices](scenario/Sources/Scenario.swift#L286) |
| 55 | +- [DescribeSeverityLevels](scenario/Sources/Scenario.swift#L322) |
| 56 | +- [ResolveCase](scenario/Sources/Scenario.swift#L640) |
| 57 | + |
| 58 | + |
| 59 | +<!--custom.examples.start--> |
| 60 | +<!--custom.examples.end--> |
| 61 | + |
| 62 | +## Run the examples |
| 63 | + |
| 64 | +### Instructions |
| 65 | + |
| 66 | +To build any of these examples from a terminal window, navigate into its |
| 67 | +directory, then use the following command: |
| 68 | + |
| 69 | +``` |
| 70 | +$ swift build |
| 71 | +``` |
| 72 | + |
| 73 | +To build one of these examples in Xcode, navigate to the example's directory |
| 74 | +(such as the `ListUsers` directory, to build that example). Then type `xed.` |
| 75 | +to open the example directory in Xcode. You can then use standard Xcode build |
| 76 | +and run commands. |
| 77 | + |
| 78 | +<!--custom.instructions.start--> |
| 79 | +<!--custom.instructions.end--> |
| 80 | + |
| 81 | +#### Hello Support |
| 82 | + |
| 83 | +This example shows you how to get started using Support. |
| 84 | + |
| 85 | + |
| 86 | +#### Learn the basics |
| 87 | + |
| 88 | +This example shows you how to do the following: |
| 89 | + |
| 90 | +- Get and display available services and severity levels for cases. |
| 91 | +- Create a support case using a selected service, category, and severity level. |
| 92 | +- Get and display a list of open cases for the current day. |
| 93 | +- Add an attachment set and a communication to the new case. |
| 94 | +- Describe the new attachment and communication for the case. |
| 95 | +- Resolve the case. |
| 96 | +- Get and display a list of resolved cases for the current day. |
| 97 | + |
| 98 | +<!--custom.basic_prereqs.support_Scenario_GetStartedSupportCases.start--> |
| 99 | +<!--custom.basic_prereqs.support_Scenario_GetStartedSupportCases.end--> |
| 100 | + |
| 101 | + |
| 102 | +<!--custom.basics.support_Scenario_GetStartedSupportCases.start--> |
| 103 | +<!--custom.basics.support_Scenario_GetStartedSupportCases.end--> |
| 104 | + |
| 105 | + |
| 106 | +### Tests |
| 107 | + |
| 108 | +⚠ Running tests might result in charges to your AWS account. |
| 109 | + |
| 110 | + |
| 111 | +To find instructions for running these tests, see the [README](../../README.md#Tests) |
| 112 | +in the `swift` folder. |
| 113 | + |
| 114 | + |
| 115 | + |
| 116 | +<!--custom.tests.start--> |
| 117 | +<!--custom.tests.end--> |
| 118 | + |
| 119 | +## Additional resources |
| 120 | + |
| 121 | +- [Support User Guide](https://docs.aws.amazon.com/awssupport/latest/user/getting-started.html) |
| 122 | +- [Support API Reference](https://docs.aws.amazon.com/awssupport/latest/APIReference/welcome.html) |
| 123 | +- [SDK for Swift Support reference](https://sdk.amazonaws.com/swift/api/awssupport/latest/documentation/awssupport) |
| 124 | + |
| 125 | +<!--custom.resources.start--> |
| 126 | +<!--custom.resources.end--> |
| 127 | + |
| 128 | +--- |
| 129 | + |
| 130 | +Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. |
| 131 | + |
| 132 | +SPDX-License-Identifier: Apache-2.0 |
0 commit comments