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

Create application now returns the key value in a struct with the ID #156

Merged
merged 6 commits into from
Aug 16, 2024

Conversation

PCloughster
Copy link
Contributor

Create application wasn't previously returning the key for the API key created, needed for terraform provider

@PCloughster PCloughster requested a review from 0x4c6565 August 16, 2024 13:23
@PCloughster
Copy link
Contributor Author

Added UpdateApplication function to allow updating of application name and description

return body.Data.ID, err
}

func (s *Service) createApplicationResponseBody(req CreateApplicationRequest) (*connection.APIResponseBodyData[Application], error) {
return connection.Post[Application](s.connection, "/account/v1/applications", &req)
func (s *Service) updateApplicationResponseBody(req CreateApplicationRequest) (*connection.APIResponseBodyData[Application], error) {
Copy link
Member

Choose a reason for hiding this comment

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

You're accepting req CreateApplicationRequest for update here

body, err := s.createApplicationResponseBody(req)

response := CreateApplicationResponse{
Copy link
Member

Choose a reason for hiding this comment

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

Rather than create a new response here, you can just return body.Data

Copy link
Member

@0x4c6565 0x4c6565 left a comment

Choose a reason for hiding this comment

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

LGTM

@PCloughster PCloughster merged commit 60cec46 into master Aug 16, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

2 participants