Пример #1
0
        public void CreateSandbox(SandboxInfo info)
        {
            var response       = Client.Post(SANDBOX_INFO_ENDPOINT, info.ToJSON());
            var stringResponse = response.Content.ReadAsStringAsync().Result;

            Console.WriteLine("\n:: Sandbox created :: \n" + stringResponse);
        }
Пример #2
0
        public void RefreshSandbox(SandboxInfo info)
        {
            var response       = Client.Get(QUERY_SANDBOX_INFO.Replace("{name}", info.SandboxName));
            var stringResponse = response.Content.ReadAsStringAsync().Result;

            Console.WriteLine("\n:: Queried Sandbox :: \n" + stringResponse);

            dynamic queriedSandbox = JObject.Parse(stringResponse);
            string  id             = queriedSandbox.records[0].Id; // FIXME: Verify that the array is not empty.

            response       = Client.Patch(SANDBOX_INFO_ENDPOINT + $"{id}/", info.ToJSON());
            stringResponse = response.Content.ReadAsStringAsync().Result;

            Console.WriteLine("\n:: Refreshed Sandbox :: \n" + stringResponse);
        }