public UmbrellaAdminUiSteps(IWebDriver driver, TestConfig config, ScenarioContext scenarioContext, DefaultApi api)
 {
     this.driver  = driver;
     this.config  = config;
     this.context = scenarioContext;
     this.api     = api;
 }
Exemplo n.º 2
0
        private void InitializeData()
        {
            // String url = "https://smartflowspreview.xpertdoc.com/api/v1";
            var url = "https://localhost:8080";

            _api = new DefaultApi(url);

            var login = new Login("USERNAME", "PASSWORD");
            var auth  = _api.AuthenticateLoginPost(login);

            var token = auth.Tokens[0].Token;

            _api.Configuration.AccessToken = token;

            var flows = _api.GetFlows();

            Console.WriteLine(flows.Count);
            flowSelect.DisplayMember = "displayName";
            flowSelect.DataSource    = flows;

            _data = new ExecutionData();
            result.DataBindings.Add("Text", _data, "Result");

            _weather = new Weahter("Gent");
            cityName.DataBindings.Add("Text", _weather, "City");
        }
        private async Task ShouldQueryDisputes()
        {
            var request = new DisputesQueryFilter();

            var response = await DefaultApi.DisputesClient().Query(request);

            response.ShouldNotBeNull();
            response.Limit.ShouldNotBeNull();
            response.Skip.ShouldNotBeNull();
            response.TotalCount.ShouldNotBeNull();
            if (response.TotalCount > 0)
            {
                var dispute        = response.Data[0];
                var disputeDetails = await DefaultApi.DisputesClient().GetDisputeDetails(dispute.Id);

                disputeDetails.ShouldNotBeNull();
                disputeDetails.Id.ShouldBe(dispute.Id);
                disputeDetails.Category.ShouldBe(dispute.Category);
                disputeDetails.Status.ShouldBe(dispute.Status);
                disputeDetails.Amount.ShouldBe(dispute.Amount);
                disputeDetails.ReasonCode.ShouldBe(dispute.ReasonCode);
                disputeDetails.Payment.ShouldNotBeNull();
                disputeDetails.Payment.Id.ShouldBe(dispute.PaymentId);
            }
        }
Exemplo n.º 4
0
        public static bool InviteUserToChat(int chatId, string username)
        {
            AccountManager lm  = AccountManager.GetInstance();
            DefaultApi     api = new DefaultApi("http://localhost:8080/api/");

            return(api.InviteUserToChat(chatId, username, lm.Token).Value);
        }
Exemplo n.º 5
0
        public Dictionary <string, string> InvokeApiService()
        {
            if (ExtractedFields == null)
            {
                ExtractedFields = new Dictionary <string, string>();
            }

            var apiInstance      = new DefaultApi();
            var imageBytes       = Convert.ToBase64String(ImageData); // string | The image file that you wish to analyze encoded in base64
            var secretKey        = ApiKey;                            // string | The secret key used to authenticate your account.  You can view your  secret key by visiting  https://cloud.openalpr.com/
            var country          = "us";                              // string | Defines the training data used by OpenALPR.  \"us\" analyzes  North-American style plates.  \"eu\" analyzes European-style plates.  This field is required if using the \"plate\" task  You may use multiple datasets by using commas between the country  codes.  For example, 'au,auwide' would analyze using both the  Australian plate styles.  A full list of supported country codes  can be found here https://github.com/openalpr/openalpr/tree/master/runtime_data/config
            var recognizeVehicle = 56;                                // int? | If set to 1, the vehicle will also be recognized in the image This requires an additional credit per request  (optional)  (default to 0)
            var state            = "";                                // string | Corresponds to a US state or EU country code used by OpenALPR pattern  recognition.  For example, using \"md\" matches US plates against the  Maryland plate patterns.  Using \"fr\" matches European plates against  the French plate patterns.  (optional)  (default to )
            var returnImage      = 56;                                // int? | If set to 1, the image you uploaded will be encoded in base64 and  sent back along with the response  (optional)  (default to 0)
            var topn             = 56;                                // int? | The number of results you would like to be returned for plate  candidates and vehicle classifications  (optional)  (default to 10)
            var prewarp          = "";                                // string | Prewarp configuration is used to calibrate the analyses for the  angle of a particular camera.  More information is available here http://doc.openalpr.com/accuracy_improvements.html#calibration  (optional)  (default to )

            try
            {
                InlineResponse200 result = apiInstance.RecognizeBytes(imageBytes, secretKey.ToString(), country, recognizeVehicle, state, returnImage, topn, prewarp);
                Debug.WriteLine(result);

                foreach (var plate in result.Results)
                {
                    ExtractedFields.Add("Region", plate.Region);
                    ExtractedFields.Add("Plate", plate.Plate);
                }
                return(ExtractedFields);
            }
            catch (Exception e)
            {
                Debug.Print("Exception when calling DefaultApi.RecognizeBytes: " + e.Message);
            }
            return(null);
        }
 public DashApi(IBitmovinApiClientFactory apiClientFactory)
 {
     _apiClient = apiClientFactory.CreateClient <IDashApiClient>();
     Default    = new DefaultApi(apiClientFactory);
     Customdata = new CustomdataApi(apiClientFactory);
     Periods    = new PeriodsApi(apiClientFactory);
 }
        private async Task ShouldFullVoidCardPayment()
        {
            var paymentResponse = await MakeCardPayment();

            var voidRequest = new VoidRequest {
                Reference = Guid.NewGuid().ToString()
            };

            var response = await DefaultApi.PaymentsClient().VoidPayment(paymentResponse.Id, voidRequest);

            response.ShouldNotBeNull();
            response.ActionId.ShouldNotBeNullOrEmpty();
            response.Reference.ShouldNotBeNullOrEmpty();
            response.GetLink("payment").ShouldNotBeNull();

            var payment = await Retriable(async() =>
                                          await DefaultApi.PaymentsClient().GetPaymentDetails(paymentResponse.Id), TotalVoidedIs10);

            payment.Balances.TotalAuthorized.ShouldBe(paymentResponse.Amount);
            payment.Balances.TotalCaptured.ShouldBe(0);
            payment.Balances.TotalRefunded.ShouldBe(0);
            payment.Balances.TotalVoided.ShouldBe(paymentResponse.Amount);
            payment.Balances.AvailableToCapture.ShouldBe(0);
            payment.Balances.AvailableToRefund.ShouldBe(0);
            payment.Balances.AvailableToVoid.ShouldBe(0);
        }
        public AlertMediaClient(string clientId = null, string clientSecretKey = null, string server = null)
        {
            System.Net.ServicePointManager.SecurityProtocol = System.Net.SecurityProtocolType.Tls12;
            var username = clientId ?? Environment.GetEnvironmentVariable("AM_CLIENT_ID");

            if (username == null)
            {
                throw new ArgumentNullException(nameof(clientId), "You must specify an AlertMedia API clientId and clientSecretKey.");
            }

            var password = clientSecretKey ?? Environment.GetEnvironmentVariable("AM_CLIENT_SECRET_KEY");

            if (password == null)
            {
                throw new ArgumentNullException(nameof(clientSecretKey), "You must specify an AlertMedia API clientId and clientSecretKey.");
            }

            Configuration = new Configuration {
                ApiClient = GetApiClient(server),
                Username  = username,
                Password  = password,
            };
            var info = new DefaultApi(Configuration).LoginInfo();

            ApiCustomer = info.Customer;
            ApiUser     = info.User;
        }
Exemplo n.º 9
0
        public static IO.Swagger.Model.Message SendChatMessage(int chatId, string message)
        {
            AccountManager lm  = AccountManager.GetInstance();
            DefaultApi     api = new DefaultApi("http://localhost:8080/api/");

            return(api.SendChatMessage(chatId, message, lm.Token));
        }
Exemplo n.º 10
0
        private void BlockchainMetadataLive()
        {
            var apiInstance = new DefaultApi(nodeAddress);
            var result      = JsonConvert.DeserializeObject <BlockchainMetadata>(apiInstance.BlockchainMetadata().ToString());

            Assert.NotEqual(0, result.Head.Seq);
        }
Exemplo n.º 11
0
        public static List <IO.Swagger.Model.Chat> GetChatList()
        {
            AccountManager lm  = AccountManager.GetInstance();
            DefaultApi     api = new DefaultApi("http://localhost:8080/api/");

            return(api.GetChats(lm.Token));
        }
Exemplo n.º 12
0
        public static List <IO.Swagger.Model.Message> GetChatMessages(int chatId)
        {
            AccountManager lm  = AccountManager.GetInstance();
            DefaultApi     api = new DefaultApi("http://localhost:8080/api/");

            return(api.GetChatMessages(chatId, lm.Token));
        }
Exemplo n.º 13
0
        public static IO.Swagger.Model.Friend AddFriend(string username)
        {
            AccountManager lm  = AccountManager.GetInstance();
            DefaultApi     api = new DefaultApi("http://localhost:8080/api/");

            return(api.AddFriend(username, lm.Token));
        }
Exemplo n.º 14
0
        public static IO.Swagger.Model.UserProfile GetProfileById(int userId)
        {
            AccountManager lm  = AccountManager.GetInstance();
            DefaultApi     api = new DefaultApi("http://localhost:8080/api/");

            return(api.GetProfileById(userId, lm.Token));
        }
Exemplo n.º 15
0
        public static bool RegisterUser(string username, string password, string email = null, string displayName = null)
        {
            DefaultApi api    = new DefaultApi("http://localhost:8080/api/");
            var        result = api.RegisterUserWithHttpInfo(username, password, email, displayName);

            return(result.Data == "true");
        }
Exemplo n.º 16
0
        internal static bool SetChatTitle(int chatId, string chatTitle)
        {
            DefaultApi     api = new DefaultApi("http://localhost:8080/api/");
            AccountManager lm  = AccountManager.GetInstance();

            return(api.UpdateChat(lm.Token, chatId, chatTitle).Value);
        }
Exemplo n.º 17
0
        public void main()
        {
            // Configure API key authorization: app_id
            Configuration.Default.ApiKey.Add("X-AYLIEN-NewsAPI-Application-ID", "{{current_app_id}}");

            // Configure API key authorization: app_key
            Configuration.Default.ApiKey.Add("X-AYLIEN-NewsAPI-Application-Key", "{{current_app_key}}");

            var apiInstance = new DefaultApi();

            var type     = "dbpedia_resources";
            var term     = "obam";
            var language = "en";
            var perPage  = 7;

            try
            {
                // List autocompletes
                Autocompletes result = apiInstance.ListAutocompletes(
                    type: type,
                    term: term,
                    language: language,
                    perPage: perPage
                    );
                Debug.WriteLine(result);
            }
            catch (Exception e)
            {
                Debug.Print("Exception when calling DefaultApi.ListAutocompletes: " + e.Message);
            }
        }
Exemplo n.º 18
0
        public void TestAuth()
        {
            var conf = new Client.Configuration(
                new Dictionary <string, string>(),
                new Dictionary <string, string>(),
                new Dictionary <string, string>(),
                "https://dev.contraxsuite.com");
            var proxy   = new DefaultApi(conf);
            var usrData = new InlineObject70("Administrator",                 // user
                                             "*****@*****.**", // email
                                             "Administrator");                // password
            var resp         = proxy.RestAuthLoginPOST(usrData) as JObject;
            var authResponse = resp.ToObject <Dictionary <string, object> >();

            Assert.IsNotNull(resp);
            var apiKey   = (string)authResponse["key"];
            var apiToken = $"Token {apiKey}";

            //proxy.Configuration.AccessToken = apiToken;
            proxy.Configuration.ApiKey["Authorization"] = apiToken;

            var projects = proxy.ProjectProjectsRecentGET();

            Assert.IsNotNull(projects);
        }
        private async Task ShouldIncrementPaymentAuthorization()
        {
            PaymentResponse paymentResponse = await MakeAuthorizationEstimatedPayment();

            AuthorizationRequest authorizationRequest = new AuthorizationRequest
            {
                Amount = 10, Reference = "payment_reference"
            };

            AuthorizationResponse authorizationResponse = await DefaultApi.PaymentsClient()
                                                          .IncrementPaymentAuthorization(paymentResponse.Id, authorizationRequest);

            authorizationResponse.ShouldNotBeNull();
            authorizationResponse.Amount.ShouldNotBeNull();
            authorizationResponse.ActionId.ShouldNotBeNull();
            authorizationResponse.Currency.ShouldNotBeNull();
            authorizationResponse.Approved.ShouldNotBeNull();
            authorizationResponse.ResponseCode.ShouldNotBeNull();
            authorizationResponse.ResponseSummary.ShouldNotBeNull();
            authorizationResponse.ExpiresOn.ShouldNotBeNull();
            authorizationResponse.ProcessedOn.ShouldNotBeNull();
            authorizationResponse.Balances.ShouldNotBeNull();
            authorizationResponse.Links.ShouldNotBeNull();
            authorizationResponse.Risk.ShouldNotBeNull();
        }
Exemplo n.º 20
0
        private void BlockchainMetadataStable()
        {
            var apiInstance = new DefaultApi(nodeAddress);
            var result      = apiInstance.BlockchainMetadata();

            CheckGoldenFile("blockchain-metadata.golden", result);
        }
Exemplo n.º 21
0
        private void PerformSave()
        {
            ErrorMessage = "";

            var am = AccountManager.GetInstance();

            bool usernameChanged    = Username != am.Username;
            bool passwordChanged    = Password != "" && Password == PasswordConfirm && Password == am.Password;
            bool emailChanged       = Email != am.Email;
            bool displayNameChanged = DisplayName != am.DisplayName;

            try
            {
                // Continue with registration process
                DefaultApi api = new DefaultApi("http://localhost:8080/api/");

                bool ret = false;
                ret = AccountManager.UpdateUser(AccountManager.GetInstance().Token,
                                                usernameChanged ? Username : null,
                                                passwordChanged ? Password : null,
                                                emailChanged ? Email : null,
                                                displayNameChanged ? DisplayName : null);

                if (ret)
                {
                    // Get out of registration screen now that we're registered
                    ViewPresenter.PopView();
                }
            }
            catch (ApiException e)
            {
                var error = ErrorCodes.TranslateError(e.ErrorContent);
                ErrorMessage = error.Message;
            }
        }
Exemplo n.º 22
0
        private void BlockLive()
        {
            var apiInstance = new DefaultApi(nodeAddress);

            BlockStable();
            var knownBadBlockSeqs = new int[]
            {
                // coinhour fee calculation mistake, related to distribution addresses:
                297,
                741,
                743,
                749,
                796,
                4956,
                10125,
                // coinhour overflow related:
                11685,
                11707,
                11710,
                11709,
                11705,
                11708,
                11711,
                11706,
                11699,
                13277
            };

            foreach (var seq in knownBadBlockSeqs)
            {
                var b = apiInstance.Block(seq: seq);
                Assert.Equal(seq, b.Header.Seq);
            }
        }
Exemplo n.º 23
0
        private void AddressCountStable()
        {
            var apiInstance = new DefaultApi(nodeAddress);
            var result      = apiInstance.AddressCount();

            Assert.Equal(155, result.Count);
        }
Exemplo n.º 24
0
        private void AddressCountLive()
        {
            var apiInstance = new DefaultApi(nodeAddress);
            var result      = apiInstance.AddressCount();

            // 5296 addresses as of 2018-03-06, the count could decrease but is unlikely to
            Assert.True(result.Count > 5000);
        }
Exemplo n.º 25
0
        private void NetworkConnectionExchangeStable()
        {
            var apiInstance = new DefaultApi(nodeAddress);
            var conenctions = apiInstance.NetworkConnectionsExchange();

            CheckGoldenFile("network-exchanged-peers.golden",
                            JsonConvert.SerializeObject(conenctions, Formatting.Indented));
        }
Exemplo n.º 26
0
 public SmoothApi(IBitmovinApiClientFactory apiClientFactory)
 {
     _apiClient        = apiClientFactory.CreateClient <ISmoothApiClient>();
     Default           = new DefaultApi(apiClientFactory);
     Customdata        = new CustomdataApi(apiClientFactory);
     Representations   = new RepresentationsApi(apiClientFactory);
     Contentprotection = new ContentprotectionApi(apiClientFactory);
 }
Exemplo n.º 27
0
 public HlsApi(IBitmovinApiClientFactory apiClientFactory)
 {
     _apiClient = apiClientFactory.CreateClient <IHlsApiClient>();
     Default    = new DefaultApi(apiClientFactory);
     Customdata = new CustomdataApi(apiClientFactory);
     Streams    = new StreamsApi(apiClientFactory);
     Media      = new MediaApi(apiClientFactory);
 }
        private async Task ShouldUpdateCardInstrument()
        {
            var tokenInstrument = await CreateTokenInstrument();

            tokenInstrument.ShouldNotBeNull();

            var updateCardInstrument = new UpdateCardInstrumentRequest
            {
                ExpiryMonth = 12,
                ExpiryYear  = 2024,
                Name        = "John Doe",
                Customer    = new UpdateCustomerRequest {
                    Id = tokenInstrument.Customer.Id, Default = true
                },
                AccountHolder = new AccountHolder
                {
                    FirstName = "John",
                    LastName  = "Doe",
                    Phone     = new Phone {
                        CountryCode = "+1", Number = "415 555 2671"
                    },
                    BillingAddress = new Address
                    {
                        AddressLine1 = "CheckoutSdk.com",
                        AddressLine2 = "90 Tottenham Court Road",
                        City         = "London",
                        State        = "London",
                        Zip          = "W1T 4TJ",
                        Country      = CountryCode.GB
                    }
                }
            };

            var updateInstrumentResponse =
                await DefaultApi.InstrumentsClient().Update(tokenInstrument.Id, updateCardInstrument);

            updateInstrumentResponse.ShouldNotBeNull();
            var updateCardInstrumentResponse = (UpdateCardInstrumentResponse)updateInstrumentResponse;

            updateCardInstrumentResponse.Fingerprint.ShouldNotBeNullOrEmpty();

            var getResponse = await DefaultApi.InstrumentsClient().Get(tokenInstrument.Id);

            getResponse.ShouldNotBeNull();

            var cardResponse = (GetCardInstrumentResponse)getResponse;

            cardResponse.ShouldNotBeNull();
            cardResponse.Id.ShouldNotBeNull();
            cardResponse.Fingerprint.ShouldNotBeNull();
            cardResponse.ExpiryMonth.ShouldBe(12);
            cardResponse.ExpiryYear.ShouldBe(2024);
            cardResponse.Customer.Default.ShouldBeTrue();
            cardResponse.AccountHolder.FirstName.ShouldBe("John");
            cardResponse.AccountHolder.LastName.ShouldBe("Doe");
            cardResponse.CardType.ShouldNotBeNull();
            cardResponse.CardCategory.ShouldNotBeNull();
        }
Exemplo n.º 29
0
        public void Init()
        {
            instance = new DefaultApi();

            // ToDo Replace me!!
            const string apiKey = "your api key here";

            instance.Configuration.DefaultHeader.Add("Authorization", $"U4-API-KEY {apiKey}");
        }
Exemplo n.º 30
0
        public AutolockGetlockinfoRes AutolockGetlockinfoPost(string docId, DefaultApi apiInstance)
        {
            AutolockGetlockinfoReq lockReq = new AutolockGetlockinfoReq()
            {
                Docid = docId
            };

            return(apiInstance.AutolockGetlockinfoPost(lockReq));
        }