Skip to content
This repository has been archived by the owner on Oct 14, 2024. It is now read-only.

Commit

Permalink
NOISSUE - Fix SDK page metadata from email to identity. (#77)
Browse files Browse the repository at this point in the history
* fix sdk pgm from email to identity

Signed-off-by: ianmuchyri <[email protected]>

* fix linter error

Signed-off-by: ianmuchyri <[email protected]>

* fi linter error

Signed-off-by: ianmuchyri <[email protected]>

* update identity shortform

Signed-off-by: ianmuchyri <[email protected]>

---------

Signed-off-by: ianmuchyri <[email protected]>
  • Loading branch information
ianmuchyri authored Nov 27, 2023
1 parent ea0559d commit 98007ad
Show file tree
Hide file tree
Showing 5 changed files with 12 additions and 11 deletions.
2 changes: 1 addition & 1 deletion cli/users.go
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ var cmdUsers = []cobra.Command{
return
}
pageMetadata := mgxsdk.PageMetadata{
Email: Email,
Identity: Identity,
Offset: Offset,
Limit: Limit,
Metadata: metadata,
Expand Down
4 changes: 2 additions & 2 deletions cli/utils.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,8 @@ var (
Offset uint64 = 0
// Name query parameter.
Name string = ""
// Email query parameter.
Email string = ""
// Identity query parameter.
Identity string = ""
// Metadata query parameter.
Metadata string = ""
// Status query parameter.
Expand Down
8 changes: 4 additions & 4 deletions cmd/cli/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -203,11 +203,11 @@ func main() {
)

rootCmd.PersistentFlags().StringVarP(
&cli.Email,
"email",
"e",
&cli.Identity,
"identity",
"I",
"",
"User email query parameter",
"User identity query parameter",
)

rootCmd.PersistentFlags().StringVarP(
Expand Down
7 changes: 4 additions & 3 deletions pkg/sdk/go/sdk.go
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ type PageMetadata struct {
Offset uint64 `json:"offset"`
Limit uint64 `json:"limit"`
Level uint64 `json:"level,omitempty"`
Email string `json:"email,omitempty"`
Identity string `json:"identity,omitempty"`
Name string `json:"name,omitempty"`
Type string `json:"type,omitempty"`
Metadata Metadata `json:"metadata,omitempty"`
Expand All @@ -91,6 +91,7 @@ type PageMetadata struct {
Topic string `json:"topic,omitempty"`
Contact string `json:"contact,omitempty"`
State string `json:"state,omitempty"`
Order string `json:"order,omitempty"`
}

// Credentials represent client credentials: it contains
Expand Down Expand Up @@ -1186,8 +1187,8 @@ func (pm PageMetadata) query() (string, error) {
if pm.Level != 0 {
q.Add("level", strconv.FormatUint(pm.Level, 10))
}
if pm.Email != "" {
q.Add("email", pm.Email)
if pm.Identity != "" {
q.Add("identity", pm.Identity)
}
if pm.Name != "" {
q.Add("name", pm.Name)
Expand Down
2 changes: 1 addition & 1 deletion provision/service.go
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ func New(cfg Config, sdk sdk.SDK, logger mglog.Logger) Service {
// Mapping retrieves current configuration.
func (ps *provisionService) Mapping(token string) (map[string]interface{}, error) {
userFilter := sdk.PageMetadata{
Email: "",
Identity: "",
Offset: uint64(offset),
Limit: uint64(limit),
Metadata: make(map[string]interface{}),
Expand Down

0 comments on commit 98007ad

Please sign in to comment.