@@ -317,6 +317,8 @@ enum GroupsCommand {
317317enum MembersCommand {
318318 Get ( GetMember ) ,
319319 List ( ListMembers ) ,
320+ Update ( UpdateMember ) ,
321+ Delete ( DeleteMember ) ,
320322}
321323
322324#[ derive( StructOpt , Debug ) ]
@@ -336,6 +338,34 @@ struct ListMembers {
336338 org_id : OrgId ,
337339}
338340
341+ #[ derive( StructOpt , Debug ) ]
342+ #[ structopt( about = "Update a member" ) ]
343+ struct UpdateMember {
344+ #[ structopt( long, short, parse( try_from_str = parse_member_id) , help = "The member id" ) ]
345+ id : MemberId ,
346+
347+ #[ structopt( long, short, parse( try_from_str = parse_org_id) , default_value = "" , help = "The organization id the member will relate to" ) ]
348+ org_id : OrgId ,
349+
350+ #[ structopt(
351+ long,
352+ short,
353+ parse( try_from_str) ,
354+ help = "Specifies whether the member is active."
355+ ) ]
356+ active : bool ,
357+ }
358+
359+ #[ derive( StructOpt , Debug ) ]
360+ #[ structopt( about = "Deletes a Member" ) ]
361+ struct DeleteMember {
362+ #[ structopt( long, short, parse( try_from_str = parse_member_id) ) ]
363+ id : MemberId ,
364+
365+ #[ structopt( long, short, parse( try_from_str = parse_org_id) , default_value = "" ) ]
366+ org_id : OrgId ,
367+ }
368+
339369#[ derive( StructOpt , Debug ) ]
340370enum UserCommand {
341371 List ,
@@ -749,6 +779,7 @@ enum OrganizationsCommand {
749779 Get ( GetOrganization ) ,
750780 Delete ( DeleteOrganization ) ,
751781 List ( ListOrganizations ) ,
782+ GetMfaStatus ( GetOrganizationMfaStatus ) ,
752783}
753784
754785#[ derive( Debug , StructOpt ) ]
@@ -775,6 +806,13 @@ struct GetOrganization {
775806 id : OrgId ,
776807}
777808
809+ #[ derive( Debug , StructOpt ) ]
810+ #[ structopt( about = "read an organization's MFA status" ) ]
811+ struct GetOrganizationMfaStatus {
812+ #[ structopt( short, long, parse( try_from_str = parse_org_id) , default_value = "" , help = "The id of the organization you want to read MFA status of" ) ]
813+ id : OrgId ,
814+ }
815+
778816#[ derive( Debug , StructOpt ) ]
779817#[ structopt( about = "Delete an organization" ) ]
780818struct DeleteOrganization {
@@ -1953,6 +1991,24 @@ async fn call_api<'a, 'b>(
19531991 esc_api:: access:: get_member ( & client, params. org_id , params. id ) . await ?;
19541992 printer. print ( resp) ?;
19551993 }
1994+
1995+ MembersCommand :: Update ( params) => {
1996+ let client = client_builder. create ( ) . await ?;
1997+ esc_api:: access:: update_member (
1998+ & client,
1999+ params. org_id ,
2000+ params. id ,
2001+ esc_api:: access:: UpdateMemberRequest {
2002+ active : params. active ,
2003+ } ,
2004+ )
2005+ . await ?;
2006+ }
2007+
2008+ MembersCommand :: Delete ( params) => {
2009+ let client = client_builder. create ( ) . await ?;
2010+ esc_api:: access:: delete_member ( & client, params. org_id , params. id ) . await ?;
2011+ }
19562012 } ,
19572013 } ,
19582014
@@ -2339,6 +2395,12 @@ async fn call_api<'a, 'b>(
23392395 let resp = esc_api:: resources:: list_organizations ( & client) . await ?;
23402396 printer. print ( resp) ?;
23412397 }
2398+
2399+ OrganizationsCommand :: GetMfaStatus ( params) => {
2400+ let client = client_builder. create ( ) . await ?;
2401+ let resp = esc_api:: resources:: get_mfa_status ( & client, params. id ) . await ?;
2402+ printer. print ( resp) ?;
2403+ }
23422404 } ,
23432405
23442406 ResourcesCommand :: Projects ( projs) => match projs. projects_command {
0 commit comments