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

Account application implementation #154

Merged
merged 5 commits into from
Aug 8, 2024

Conversation

PCloughster
Copy link
Contributor

Added implementation and testing for the Account application API endpoint

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, just a few changes :)

// Application represents an API Application
type Application struct {
ID string `json:"id"`
AppName string `json:"name"`
Copy link
Member

Choose a reason for hiding this comment

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

Property should match the json representation

- AppName     string `json:"name"`
+ Name     string `json:"name"`

ID string `json:"id"`
AppName string `json:"name"`
Description string `json:"description"`
CreatedDate string `json:"created_at"`
Copy link
Member

Choose a reason for hiding this comment

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

Property should match the json representation

- CreatedDate string `json:"created_at"`
+ CreatedAt string `json:"created_at"`

}

type ApplicationRestriction struct {
RestrictionType string `json:"ip_restriction_type"`
Copy link
Member

Choose a reason for hiding this comment

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

Property should match the json representation

- RestrictionType string   `json:"ip_restriction_type"`
+ IPRestrictionType string   `json:"ip_restriction_type"`


type CreateApplicationRequest struct {
Name string `json:"name"`
AppDescription string `json:"description"`
Copy link
Member

Choose a reason for hiding this comment

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

Property should match the json representation

- AppDescription string `json:"description"`
+ Description string `json:"description"`

}

type SetRestrictionRequest struct {
RestrictionType string `json:"ip_restriction_type"`
Copy link
Member

Choose a reason for hiding this comment

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

Property should match the json representation

- RestrictionType string   `json:"ip_restriction_type"`
+ IPRestrictionType string   `json:"ip_restriction_type"`

}

func (s *Service) getApplicationResponseBody(appID string) (*connection.APIResponseBodyData[Application], error) {
body := &connection.APIResponseBodyData[Application]{}
Copy link
Member

Choose a reason for hiding this comment

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

Just a suggestion - there's helpers available in the connection package which will help remove a lot of the boiler plate. See the PSS GetCase method here for an example:

https://github.com/ans-group/sdk-go/blob/master/pkg/service/pss/service_case.go#L32-L38

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 b0684d8 into master Aug 8, 2024
@PCloughster PCloughster deleted the account-application-implementation branch August 8, 2024 16:17
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