-
Notifications
You must be signed in to change notification settings - Fork 0
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
Conversation
There was a problem hiding this 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 :)
pkg/service/account/model.go
Outdated
// Application represents an API Application | ||
type Application struct { | ||
ID string `json:"id"` | ||
AppName string `json:"name"` |
There was a problem hiding this comment.
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"`
pkg/service/account/model.go
Outdated
ID string `json:"id"` | ||
AppName string `json:"name"` | ||
Description string `json:"description"` | ||
CreatedDate string `json:"created_at"` |
There was a problem hiding this comment.
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"`
pkg/service/account/model.go
Outdated
} | ||
|
||
type ApplicationRestriction struct { | ||
RestrictionType string `json:"ip_restriction_type"` |
There was a problem hiding this comment.
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"`
pkg/service/account/request.go
Outdated
|
||
type CreateApplicationRequest struct { | ||
Name string `json:"name"` | ||
AppDescription string `json:"description"` |
There was a problem hiding this comment.
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"`
pkg/service/account/request.go
Outdated
} | ||
|
||
type SetRestrictionRequest struct { | ||
RestrictionType string `json:"ip_restriction_type"` |
There was a problem hiding this comment.
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]{} |
There was a problem hiding this comment.
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
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
Added implementation and testing for the Account application API endpoint