Repository navigation
enrollmenttokenapi:Add Region param and WithRegion - #137
Merged
marclop merged 1 commit intoJun 12, 2020
Merged
Conversation
This patch modifies all `enrollmenttokenapi` public functions to have a `Region string` required parameter which is then used to create a new `context.Context`: `api.WithRegion(context.Background(), params.Region)` and pass it as the API operation context. Additionally, all the unit tests have been modified to include a request assertion which ensures that the region path interpolation is used when the `/platform` APIs are being called. Furthermore, the single errors have been removed in favor of prefixed multi-errors. Last, the `token.go` and `params.go` file have been split into multiple files each containing a single API context and its parameters. Signed-off-by: Marc Lopez <marc5.12@outlook.com>
This was referenced Jun 11, 2020
karencfv
approved these changes
Jun 12, 2020
| } | ||
| for _, tt := range tests { | ||
| t.Run(tt.name, func(t *testing.T) { | ||
| if err := Delete(tt.args.params); !reflect.DeepEqual(err, tt.err) { |
Contributor
There was a problem hiding this comment.
Should we start using testify like the other PRs?
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
This patch modifies all
enrollmenttokenapipublic functions to have aRegion stringrequired parameter which is then used to create a newcontext.Context:api.WithRegion(context.Background(), params.Region)and pass it as the API operation context.
Additionally, all the unit tests have been modified to include a request
assertion which ensures that the region path interpolation is used when
the
/platformAPIs are being called.Furthermore, the single errors have been removed in favor of prefixed
multi-errors.
Last, the
token.goandparams.gofile have been split into multiplefiles each containing a single API context and its parameters.
Related Issues
Part of #129
How Has This Been Tested?
Unit and
make fake-sdkinecctlTypes of Changes