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

fix: Support custom error format for Route53 ChangeResourceRecordSets operation #791

Merged
merged 14 commits into from
Jan 5, 2023

Conversation

epau
Copy link
Contributor

@epau epau commented Dec 29, 2022

This PR adds support for a custom error format that is sometimes returned by the ChangeResourceRecordSets operation in the Route53 service.

The custom error looks something like the following:

<?xml version="1.0" encoding="UTF-8"?>
<InvalidChangeBatch xmlns="https://route53.amazonaws.com/doc/2013-04-01/">
  <Messages>
    <Message>Tried to create resource record set duplicate.example.com. type A, but it already exists</Message>
  </Messages>
  <RequestId>b25f48e8-84fd-11e6-80d9-574e0c4664cb</RequestId>
</InvalidChangeBatch>

Issue #

#214

New/existing dependencies impact assessment, if applicable

Conventional Commits

By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.

@epau
Copy link
Contributor Author

epau commented Dec 29, 2022

This PR is targeting the epau/feat/support-crt-0.5.0 branch since it depends on changes made there. The target branch will be updated to main once epau/feat/support-crt-0.5.0 merges.

@epau epau marked this pull request as ready for review December 30, 2022 13:35
@epau epau requested review from ganeshnj and jbelkins December 30, 2022 13:36
Comment on lines +46 to +47
renderCustomInvalidBatchError(writer)
renderInvalidChangeBatch(writer)
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It would be awesome to have a way to just write this in swift, since it isn't dependent on the smithy model.
I filed this issue to investigate some mechanism that would allow us to write service specific swift code. I imagine the solution here will be related (if not the same) as solving the service specific integration test problem.

}

private fun renderCustomInvalidBatchError(writer: SwiftWriter) {
writer.openBlock("struct CustomInvalidBatchError: Decodable {", "}") {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

public APIs/structs must have docs.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This isn't public. This is just internal as it's just used for decoding and then it's transformed into a InvalidChangeBatch instance.

@ganeshnj
Copy link
Contributor

LGTM, just small comment on docs.

Base automatically changed from epau/feat/support-crt-0.5.0 to main January 4, 2023 17:48
@epau epau merged commit 73358bb into main Jan 5, 2023
@epau epau deleted the epau/fix/route53-error branch January 5, 2023 19:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants