From de5fff1e7563ca377189336e908cf80092309802 Mon Sep 17 00:00:00 2001 From: Vernon Keenan Date: Sun, 14 May 2023 21:32:28 +0000 Subject: [PATCH] favorites --- .../favorites/get_favorites_parameters.go | 27 +++++++++++++++++++ api/members/members_models/favorite.go | 3 +++ api/sfgate/sfgate_models/favorite.go | 3 +++ swagger/defs/favorite.yaml | 3 +++ swagger/external/members-vernonkeenan.yaml | 7 +++++ swagger/members-vernonkeenan.yaml | 7 +++++ 6 files changed, 50 insertions(+) diff --git a/api/members/members_client/favorites/get_favorites_parameters.go b/api/members/members_client/favorites/get_favorites_parameters.go index 6d9a77a..30fecf5 100644 --- a/api/members/members_client/favorites/get_favorites_parameters.go +++ b/api/members/members_client/favorites/get_favorites_parameters.go @@ -88,6 +88,12 @@ type GetFavoritesParams struct { */ Offset *int64 + /* UserID. + + Internal User ID + */ + UserID string + timeout time.Duration Context context.Context HTTPClient *http.Client @@ -174,6 +180,17 @@ func (o *GetFavoritesParams) SetOffset(offset *int64) { o.Offset = offset } +// WithUserID adds the userID to the get favorites params +func (o *GetFavoritesParams) WithUserID(userID string) *GetFavoritesParams { + o.SetUserID(userID) + return o +} + +// SetUserID adds the userId to the get favorites params +func (o *GetFavoritesParams) SetUserID(userID string) { + o.UserID = userID +} + // WriteToRequest writes these params to a swagger request func (o *GetFavoritesParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { @@ -233,6 +250,16 @@ func (o *GetFavoritesParams) WriteToRequest(r runtime.ClientRequest, reg strfmt. } } + // query param userId + qrUserID := o.UserID + qUserID := qrUserID + if qUserID != "" { + + if err := r.SetQueryParam("userId", qUserID); err != nil { + return err + } + } + if len(res) > 0 { return errors.CompositeValidationError(res...) } diff --git a/api/members/members_models/favorite.go b/api/members/members_models/favorite.go index d1287eb..ed66e6b 100644 --- a/api/members/members_models/favorite.go +++ b/api/members/members_models/favorite.go @@ -45,6 +45,9 @@ type Favorite struct { // name Name *string `json:"Name,omitempty"` + // order + Order *int64 `json:"Order,omitempty"` + // path Path *string `json:"Path,omitempty"` diff --git a/api/sfgate/sfgate_models/favorite.go b/api/sfgate/sfgate_models/favorite.go index 6da4742..24f0653 100644 --- a/api/sfgate/sfgate_models/favorite.go +++ b/api/sfgate/sfgate_models/favorite.go @@ -45,6 +45,9 @@ type Favorite struct { // name Name *string `json:"Name,omitempty"` + // order + Order *int64 `json:"Order,omitempty"` + // path Path *string `json:"Path,omitempty"` diff --git a/swagger/defs/favorite.yaml b/swagger/defs/favorite.yaml index ec644d9..44ab4b4 100644 --- a/swagger/defs/favorite.yaml +++ b/swagger/defs/favorite.yaml @@ -23,6 +23,9 @@ Favorite: Name: type: string x-nullable: true + Order: + type: integer + x-nullable: true Path: type: string x-nullable: true diff --git a/swagger/external/members-vernonkeenan.yaml b/swagger/external/members-vernonkeenan.yaml index 9851c79..52b8e13 100644 --- a/swagger/external/members-vernonkeenan.yaml +++ b/swagger/external/members-vernonkeenan.yaml @@ -246,6 +246,12 @@ parameters: name: userId required: false type: string + userIdQueryRequired: + description: Internal User ID + in: query + name: userId + required: true + type: string contactIdQuery: description: Internal Contact ID (links to Account) in: query @@ -1209,6 +1215,7 @@ paths: operationId: getFavorites parameters: - $ref: "#/parameters/idQuery" + - $ref: "#/parameters/userIdQueryRequired" - $ref: "#/parameters/limitQuery" - $ref: "#/parameters/offsetQuery" responses: diff --git a/swagger/members-vernonkeenan.yaml b/swagger/members-vernonkeenan.yaml index 298ccca..f58c3ce 100644 --- a/swagger/members-vernonkeenan.yaml +++ b/swagger/members-vernonkeenan.yaml @@ -246,6 +246,12 @@ parameters: name: userId required: false type: string + userIdQueryRequired: + description: Internal User ID + in: query + name: userId + required: true + type: string contactIdQuery: description: Internal Contact ID (links to Account) in: query @@ -1209,6 +1215,7 @@ paths: operationId: getFavorites parameters: - $ref: "#/parameters/idQuery" + - $ref: "#/parameters/userIdQueryRequired" - $ref: "#/parameters/limitQuery" - $ref: "#/parameters/offsetQuery" responses: