mhoppa commented on a change in pull request #3930: Rewrite profile import to Go
URL: https://github.com/apache/trafficcontrol/pull/3930#discussion_r331269471
 
 

 ##########
 File path: lib/go-tc/profiles.go
 ##########
 @@ -89,30 +101,127 @@ type ProfileTrimmed struct {
        Name string `json:"name"`
 }
 
-type ProfileExportedNullable struct {
-       // The Profile name
-       //
-       Name *string `json:"name"`
-
-       // The Profile Description
-       //
+// ProfileExportImportNullable is an object of the form used by Traffic Ops
+// to represent exported and imported profiles.
+type ProfileExportImportNullable struct {
+       Name        *string `json:"name"`
        Description *string `json:"description"`
+       CDNName     *string `json:"cdn"`
+       Type        *string `json:"type"`
+}
 
-       // The CDN name associated with the Profile
+// ProfileExportResponse is an object of the form used by Traffic Ops
+// to represent exported profile response
+type ProfileExportResponse struct {
+       // Parameters associated to the profile
        //
-       CDNName *string `json:"cdn"`
+       Profile ProfileExportImportNullable `json:"profile"`
 
-       // The Type name associated with the Profile
+       // Parameters associated to the profile
        //
-       Type *string `json:"type"`
+       Parameters []ProfileExportImportParameterNullable `json:"parameters"`
 }
 
-type ProfileExportedResponse struct {
+// ProfileImportRequest is an object of the form used by Traffic Ops
+// to represent a request to import a profile
+type ProfileImportRequest struct {
        // Parameters associated to the profile
        //
-       Profile ProfileExportedNullable `json:"profile"`
+       Profile ProfileExportImportNullable `json:"profile"`
 
        // Parameters associated to the profile
        //
-       Parameters []ProfileExportedParameterNullable `json:"parameters"`
+       Parameters []ProfileExportImportParameterNullable `json:"parameters"`
+}
+
+// ProfileImportResponse is an object of the form used by Traffic Ops
+// to represent a response from importing a profile
+type ProfileImportResponse struct {
+       Response ProfileImportResponseObj `json:"response"`
+       Alerts
+}
+
+type ProfileImportResponseObj struct {
+       ProfileExportImportNullable
+       ID *int64 `json:"id"`
 
 Review comment:
   Thinking about this more I think I should match what we do for profile IDs 
already which is *int 
(https://github.com/apache/trafficcontrol/blob/master/lib/go-tc/profiles.go#L53)
 if we want to change to uint64 I say we do it across all our objs 

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
[email protected]


With regards,
Apache Git Services

Reply via email to