Cli-microsoft365: new command: return yammer user list

Created on 13 Sep 2019  路  9Comments  路  Source: pnp/cli-microsoft365

This command is used to enumerate users in a Yammer network. While #1107 is intended to search for an individual user. This will traverse the Yammer network.

yammer users list --letter [letter] --sortBy [sortBy] --reverse --limit [limit] --groupId [groupId]

Options:
-- letter (optional) - Return users with usernames beginning with the given character.
-- sort_by [messages | followers] (optional) - Results will be returned sorted by a number of messages or followers, instead of the default behavior of sorting alphabetically.
-- reverse (flag optional) - Returns results in reverse order.
-- limit (optional) - allows you to limit the number of retrieved results to the specified value
-- groupId (optional) - searches the users in a specific group

For this implementation, I am going to use the endpoint https://developer.yammer.com/docs/usersjson

For the in_group option, I am going to use the endpoint https://developer.yammer.com/docs/usersin_groupidjson

br,
Patrick

new feature work in progress

All 9 comments

Nice suggestion. Thank you! Here are some comments:

  • --page how would the user of the CLI know how many pages there are? Why not allow retrieving all users instead? What is the default behavior when no page is specified?
  • --letter is it only possible to specify a letter or could we also support something like 'begins with' or wildcards that could make it easier to narrow down the results to the specific group of people?
  • --sort_by, let's rename it to --sortBy to follow the naming of options in other commands. Why isn't it possible to sort the list of users alphabetically by their name or email? While sorting by messages or followers might be useful in some cases, we should also allow to sort by name
  • --limit I believe you miss a piece of spec here
  • --in_group, let's rename it to --group. What value is expected here? Group name, id, something else?

--page how would the user of the CLI know how many pages there are? Why not allow retrieving all users instead? What is the default behavior when no page is specified?

Let us kill this one. Does not make sense. Let us return all users by default and allow the CLI user to limit the results with the --limit command (e.g. --limit 50 returns the first 50 users)

--letter is it only possible to specify a letter or could we also support something like 'begins with' or wildcards that could make it easier to narrow down the results to the specific group of people?

Only a specific letter. I am using what Yammer provides to me

--sort_by, let's rename it to --sortBy to follow the naming of options in other commands. Why isn't it possible to sort the list of users alphabetically by their name or email? While sorting by messages or followers might be useful in some cases, we should also allow to sort by name

Not sure if the API provides this option. I am just using what Yammer does. I can explore it further and let you know

--limit I believe you miss a piece of spec here

Limit the number of records returned. --limit 50 returns max 50 records.

--in_group, let's rename it to --group. What value is expected here? Group name, id, something else?

Yammer works with the id. I am planning to provide Yammer group API endpoints too.

Thanks for the clarification. I'm ok with your suggestions. Let's rename --in_group to --groupId so that it's clear for the users what value to specify. Could you please update the spec?

Done, just assign it to me

@waldekmastykarz I would like to continue with this request if you do not mind. #1107 is covered with #1146

I am following this sequence

network listing: #1115
user retrieval: #1107
full user retrieval: #1113
yammer message list: #1104
yammer message retrieval: #1105
yammer message posting: #1105
yammer message delete: #1106
Then I would go and implement the group commands. Afterward, we should try to look at what is left and improve the current commands further.

@waldekmastykarz @VelinGeorgiev
I have a command that performs recursive calls. It is similar to the GraphItemsListCommand.ts but is dedicated to Yammer user retrieval. Unfortunately, I am not sure how to test the recursive calls of a web service with success and failure within the recursive call. I am not able to provide 100% coverage due to this. I haven't found any examples in the codebase that might provide me some hints on how to do this.

Thank you for the feedback

Have a look at tests for handling throttling where we do something similar: https://github.com/pnp/office365-cli/blob/cd657ed0fbdd5bec319d846f2dce906390f28dc2/src/request.spec.ts#L356

@waldekmastykarz I would like to continue with this request if you do not mind. #1107 is covered with #1146

Awesome! Please proceed! 馃憦

I've updated the spec to clearly designate optional values

Was this page helpful?
0 / 5 - 0 ratings