Ejemplo n.º 1
0
        private static Command Create(IMaskedEmailsApi client, Actions action)
        {
            switch (action)
            {
            case Actions.GetProfile:
                return(new GetProfileCommand(client));

            case Actions.CreateMaskedEmail:
                return(new CreateMaskedEmailAddressCommand(client));

            case Actions.UpdateMaskedEmail:
                return(new UpdateMaskedEmailAddressCommand(client));

            case Actions.DeleteMaskedEmail:
                return(new DeleteMaskedEmailCommand(client));

            case Actions.GetMaskedEmailAddresses:
                return(new GetMaskedEmailAddressesCommand(client));

            case Actions.GetMaskedEmailAddress:
                return(new GetMaskedEmailAddressCommand(client));

            case Actions.ToggleMaskedEmailAddressForwarding:
                return(new ToggleMaskedEmailForwardingCommand(client));
            }

            System.Diagnostics.Debug.Assert(false);
            throw new NotSupportedException();
        }
Ejemplo n.º 2
0
        public ReadEvalPrintLoop(IMaskedEmailsApi client)
        {
            const string commandLinePattern = @"^(?<action>[^\ ]+)(?<args>.*)?$";

            client_           = client;
            commandLineRegex_ = new Regex(commandLinePattern, RegexOptions.Compiled | RegexOptions.Singleline);
        }
Ejemplo n.º 3
0
        public MaskedEmailsClient(Endpoints endpoints, NetworkCredential credentials)
        {
            var handler = new AuthenticatedHttpClientHandler(endpoints, credentials);

            client_ = RestService.For <IMaskedEmailsApi>(new HttpClient(handler)
            {
                BaseAddress = new Uri(endpoints?.Api ?? Endpoint),
            });
        }
 public CreateMaskedEmailAddressCommand(IMaskedEmailsApi client)
     : base(client)
 {
 }
Ejemplo n.º 5
0
 public GetProfileCommand(IMaskedEmailsApi client)
     : base(client)
 {
 }
 public GetMaskedEmailAddressesCommand(IMaskedEmailsApi client)
     : base(client)
 {
 }
Ejemplo n.º 7
0
 public ToggleMaskedEmailForwardingCommand(IMaskedEmailsApi client)
     : base(client)
 {
 }
 public DeleteMaskedEmailCommand(IMaskedEmailsApi client)
     : base(client)
 {
 }
Ejemplo n.º 9
0
 protected Command(IMaskedEmailsApi client)
 {
     Client = client;
 }
Ejemplo n.º 10
0
 public static Task ExecuteAsync(IMaskedEmailsApi client, Actions action, string[] args)
 {
     return(Create(client, action).ExecuteAsync(args));
 }
Ejemplo n.º 11
0
 public static void Execute(IMaskedEmailsApi client, Actions action, string[] args)
 {
     Create(client, action).Execute(args);
 }