Пример #1
0
 public void NullWindowsIntegratedFQDNException()
 {
     V1Connector connector = V1Connector
                             .WithInstanceUrl("http://localhost/VersionOne.Web")
                             .WithUserAgentHeader("MyApp", "1.0")
                             .WithWindowsIntegrated(null, "password")
                             .Build();
 }
Пример #2
0
 public void EmptyWindowsIntegratedPasswordException()
 {
     V1Connector connector = V1Connector
                             .WithInstanceUrl("http://localhost/VersionOne.Web")
                             .WithUserAgentHeader("MyApp", "1.0")
                             .WithUsernameAndPassword("fqdn", "")
                             .Build();
 }
Пример #3
0
 public void EmptyUsernameException()
 {
     V1Connector connector = V1Connector
                             .WithInstanceUrl("http://localhost/VersionOne.Web")
                             .WithUserAgentHeader("MyApp", "1.0")
                             .WithUsernameAndPassword("    ", "password")
                             .Build();
 }
Пример #4
0
 public void NullUrlException()
 {
     V1Connector connector = V1Connector
                             .WithInstanceUrl(null)
                             .WithUserAgentHeader("MyApp", "1.0")
                             .WithAccessToken("accesstoken")
                             .Build();
 }
Пример #5
0
 public void NullProxyException()
 {
     V1Connector connector = V1Connector
                             .WithInstanceUrl("http://localhost/VersionOne/")
                             .WithUserAgentHeader("MyApp", "1.0")
                             .WithUsernameAndPassword("username", "password")
                             .WithProxy(null)
                             .Build();
 }
        public void Execute()
        {
            var v1 = V1Connector
                     .WithInstanceUrl(instanceUrl)
                     .WithUserAgentHeader("Examples", "0.1")
                     .WithAccessToken(accessToken);


            dynamic epic = v1.Create(Attributes(
                                         ("AssetType", "Epic"),
                                         ("Scope", "Scope:0"),
                                         ("Name", "Epic made from a Tuple"),
                                         ("Subs", Assets(
                                              Asset(
                                                  "Story",
                                                  ("Name", "Story 1 from a Tuple"),
                                                  ("Children", Assets(
                                                       Asset("Test", ("Name", "Test 1 from a Tuple")),
                                                       Asset("Task", ("Name", "Task 1 from a Tuple"))
                                                       ))
                                                  ),
                                              Asset(
                                                  "Story",
                                                  ("Name", "Story 2 from a Tuple"),
                                                  ("Children", Assets(
                                                       Asset("Test", ("Name", "Test 2 from a Tuple")),
                                                       Asset("Task", ("Name", "Task 2 from a Tuple"))
                                                       ))
                                                  )
                                              ))
                                         ));

            WriteLine("Epic returned from .Create (which does not requery the system, but fills in Oids linearly from server response):");
            PrintEpic(epic);

            epic = v1
                   .Query(epic.Oid)
                   .Select(
                "Name",
                "Scope",
                From("Subs")
                .Select(
                    "AssetType",
                    "Name",
                    From("Children")
                    .Select(
                        "AssetType",
                        "Name"
                        )
                    )
                )
                   .RetrieveFirst();

            WriteLine();
            WriteLine("Epic returned from .Query, requerying the system with subselect syntax to pull in nested relationships:");
            PrintEpic(epic);
        }
        static V1Connector BasicAuthentication()
        {
            V1Connector connector = V1Connector
                                    .WithInstanceUrl(Program.baseURL)
                                    .WithUserAgentHeader("AppName", "1.0")
                                    .WithUsernameAndPassword("admin", "admin")
                                    .Build();

            return(connector);
        }
        static V1Connector windowsIntegratedAuthentication()
        {
            // windows Integrated Authentication
            V1Connector connector = V1Connector
                                    .WithInstanceUrl(Program.baseURL)
                                    .WithUserAgentHeader("AppName", "1.0")
                                    .WithWindowsIntegrated()
                                    .Build();

            return(connector);
        }
Пример #9
0
        public void Execute()
        {
            var v1 = V1Connector
                     .WithInstanceUrl(instanceUrl)
                     .WithUserAgentHeader("Examples", "0.1")
                     .WithAccessToken(accessToken);

            dynamic newStory = v1.Create(new {
                AssetType = "Story",
                Scope     = "Scope:1015",
                Name      = $"Test Story Scope:1015 Create new Story with scalar attribute"
            });

            WriteLine("Created: " + newStory.Oid);
        }
        public void Execute()
        {
            var v1 = V1Connector
                     .WithInstanceUrl(instanceUrl)
                     .WithUserAgentHeader("Examples", "0.1")
                     .WithAccessToken(accessToken);

            dynamic story = new VersionOne.Assets.Asset("Story");

            story.Scope = "Scope:1015";
            story.Name  = "Story created from newed up Asset instance";

            dynamic createdStory = v1.Create(story);

            WriteLine("Created: " + createdStory.Oid);
        }
Пример #11
0
    private void Execute()
    {
        var connector = V1Connector
                        .WithInstanceUrl(instanceUrl)
                        .WithUserAgentHeader("Examples", "0.1")
                        .WithUsernameAndPassword(username, password)
                        .Build();

        var services = new Services(connector);

        var storyType = services.Meta.GetAssetType("Story");

        var query = new Query(storyType);

        var nameAttribute       = storyType.GetAttributeDefinition("Name");
        var idAttribute         = storyType.GetAttributeDefinition("ID");
        var taggedWithAttribute = storyType.GetAttributeDefinition("TaggedWith");

        query.Selection.Add(nameAttribute);
        query.Selection.Add(taggedWithAttribute);

        var term = new FilterTerm(idAttribute);

        term.Equal("Story:1004");
        query.Filter = term;

        var result = services.Retrieve(query);

        foreach (var story in result.Assets)
        {
            WriteLine(story.Oid.Token);
            WriteLine(story.GetAttribute(nameAttribute).Value);
            WriteLine(string.Join(",", story.GetAttribute(taggedWithAttribute).Values.Cast <string>()));

            // Itentional duplicate calls here, server will handle de-dedupe on query
            story.AddAttributeValue(taggedWithAttribute, "FIRST TAG");
            story.AddAttributeValue(taggedWithAttribute, "FIRST TAG");
            story.AddAttributeValue(taggedWithAttribute, "SECOND TAG");
            story.RemoveAttributeValue(taggedWithAttribute, "SECOND TAG");

            services.Save(story);
            story.AcceptChanges();

            WriteLine(string.Join(",", story.GetAttribute(taggedWithAttribute).Values.Cast <string>()));
        }
    }
Пример #12
0
        public void Execute()
        {
            var assets = V1Connector
                         .WithInstanceUrl(instanceUrl)
                         .WithUserAgentHeader("Examples", "0.1")
                         .WithAccessToken(accessToken)
                         .Query("Story")
                         .Where("Number", "S-01001")
                         .Select("Name", "Number")
                         .Retrieve();

            foreach (dynamic story in assets)
            {
                WriteLine(story.Oid);
                WriteLine(story.Name);
                WriteLine(story.Number);
            }
        }
Пример #13
0
        public void Execute()
        {
            var v1 = V1Connector
                     .WithInstanceUrl(instanceUrl)
                     .WithUserAgentHeader("Examples", "0.1")
                     .WithAccessToken(accessToken);

            dynamic epic = v1.Create(
                ("AssetType", "Epic"),
                ("Scope", "Scope:0"),
                ("Name", "Epic with four Stories"),
                ("Subs", Assets(
                     Asset(
                         ("AssetType", "Story"),
                         ("Name", "Story in Epic")
                         ),
                     Asset(
                         ("AssetType", "Story"),
                         ("Name", "Another Story in Epic")
                         ),
                     Asset(
                         ("AssetType", "Story"),
                         ("Name", "Story in Epic")
                         ),
                     Asset(
                         ("AssetType", "Story"),
                         ("Name", "Another Story in Epic")
                         )
                     ))
                );

            IEnumerable <string> updated = v1.Update(
                From("Story")
                .Where(
                    Equal("Name", "Story in Epic", "Another Story in Epic"),
                    Equal("Scope", "Scope:0"),
                    Equal("Super", epic.Oid)
                    ), new
            {
                Description = "Updated via bulk API"
            });

            WriteLine("Updated the following Assets: " + string.Join(", ", updated));
        }
Пример #14
0
        public V1ConnectionDto GetV1Connection()
        {
            V1ConnectionDto v1ConnectionDto = new V1ConnectionDto();

            try
            {
                if (!string.IsNullOrEmpty(_credentials.Username) && !string.IsNullOrEmpty(_credentials.Password))
                {
                    V1Connector connector = V1Connector
                                            .WithInstanceUrl(ConfigHelper.V1Url)
                                            .WithUserAgentHeader(ConfigHelper.V1Name, ConfigHelper.V1Version)
                                            .WithUsernameAndPassword(_credentials.Username, _credentials.Password)
                                            .Build();

                    IServices connection = new VersionOne.SDK.APIClient.Services(connector);

                    if (connection.LoggedIn != null)
                    {
                        v1ConnectionDto.IsValid      = true;
                        v1ConnectionDto.ErrorMessage = string.Empty;
                        v1ConnectionDto.Connection   = connection;
                    }
                }
                else
                {
                    v1ConnectionDto.IsValid      = false;
                    v1ConnectionDto.ErrorMessage = "Invalid Username/Password.";
                }
            }
            catch (Exception ex)
            {
                v1ConnectionDto.IsValid = false;
                if ((ex.InnerException != null) && (ex.InnerException.Message.Equals("Unauthorized")))
                {
                    v1ConnectionDto.ErrorMessage = "Unauthorized";
                }
                else
                {
                    v1ConnectionDto.ErrorMessage = "Exception Occured";
                }
            }

            return(v1ConnectionDto);
        }
Пример #15
0
        public void Execute()
        {
            //Set up a connection to VersionOne using simple authentication
            var assets = V1Connector
                         .WithInstanceUrl(instanceUrl)
                         .WithUserAgentHeader("Examples", "0.1")
                         .WithAccessToken(accessToken)
                         .Query("Story")
                         .Where("Name", "Hello, Lifecycle!")
                         .Select("Name", "Number")
                         .Retrieve();

            foreach (dynamic story in assets)
            {
                WriteLine(story.Oid);
                WriteLine(story.Name);
                WriteLine(story.Number);
            }
        }
Пример #16
0
        public void Execute()
        {
            //Set up a connection to VersionOne using simple authentication
            V1Connector connector = V1Connector
                                    .WithInstanceUrl(instanceUrl)
                                    .WithUserAgentHeader("Examples", "0.1")
                                    .WithAccessToken(accessToken)
                                    .Build();

            IServices services = new Services(connector);

            //Determine which VersionOne Asset you would like to look for
            IAssetType storyType = services.Meta.GetAssetType("Story");

            //Prepare this query object.  I am saying "Hey, I want to query a story
            Query query = new Query(storyType);

            //Define the attributes that you would like to access from that Story
            IAttributeDefinition nameAttribute   = storyType.GetAttributeDefinition("Name");
            IAttributeDefinition numberAttribute = storyType.GetAttributeDefinition("Number");

            //Add them to the query object since we need to get these specific attributes
            query.Selection.Add(nameAttribute);
            query.Selection.Add(numberAttribute);

            //Since we need to get a specific Story or Stories that meet some criteria, we set up a filter
            FilterTerm term = new FilterTerm(numberAttribute);

            term.Equal("S-01001");
            query.Filter = term;

            // We do the actually query on the server here and get our results to be processed soon after
            QueryResult result = services.Retrieve(query);


            foreach (Asset story in result.Assets)
            {
                //This first line grabs and prints the system identifier OID of the current Story
                Console.WriteLine(story.Oid.Token);
                Console.WriteLine(story.GetAttribute(nameAttribute).Value);
                Console.WriteLine(story.GetAttribute(numberAttribute).Value);
            }
        }
Пример #17
0
        public void Execute()
        {
            const string scopeOid = "Scope:1015";

            var v1 = V1Connector
                     .WithInstanceUrl(instanceUrl)
                     .WithUserAgentHeader("Examples", "0.1")
                     .WithAccessToken(accessToken);

            dynamic scope = v1
                            .Query(scopeOid)
                            .Select("Workitems:Story")
                            .RetrieveFirst();

            WriteLine($"Story count: {scope["Workitems:Story"].Count}");
            foreach (var story in scope["Workitems:Story"])
            {
                WriteLine(story);
            }
        }
        public void Execute()
        {
            var v1 = V1Connector
                     .WithInstanceUrl(instanceUrl)
                     .WithUserAgentHeader("Examples", "0.1")
                     .WithAccessToken(accessToken);

            dynamic epic = v1.Create(
                ("AssetType", "Epic"),
                ("Scope", "Scope:0"),
                ("Name", "Epic with four Stories"),
                ("Subs", Assets(
                     Asset(
                         ("AssetType", "Story"),
                         ("Name", "Story in Epic")
                         ),
                     Asset(
                         ("AssetType", "Story"),
                         ("Name", "Story in Epic")
                         ),
                     Asset(
                         ("AssetType", "Story"),
                         ("Name", "Story in Epic")
                         ),
                     Asset(
                         ("AssetType", "Story"),
                         ("Name", "Story in Epic")
                         )
                     ))
                );

            IEnumerable <string> assetsOperatedOn = v1.ExecuteOperation(
                From("Story")
                .Where(
                    Equal("Name", "Story in Epic"),
                    Equal("Scope", "Scope:0"),
                    Equal("Super", epic.Oid)
                    ), "QuickClose");

            WriteLine("Operated on the following Assets: " + string.Join(", ", assetsOperatedOn));
        }
Пример #19
0
        /*
         * public bool ConnectToV1()
         * {
         *  bool Connected = false;
         *
         *  CreateDefect();
         *
         *  V1Connector connector = V1Connector
         *      .WithInstanceUrl("https://www8.v1host.com/Terrys_Instance052215")
         *      .WithUserAgentHeader("V1-Asset-Creator", "1.0")
         *      .WithAccessToken("1.eqpQfm0root/o7s+lOXLWYK3wCQ=")
         *      .Build();
         *
         *  IServices services = new Services(connector);
         *
         *
         *  Oid projectId = services.GetOid("Scope:1111");
         *  IAssetType defectType = services.Meta.GetAssetType("Defect");
         *  Asset NewDefect = services.New(defectType, projectId);
         *  IAttributeDefinition nameAttribute = defectType.GetAttributeDefinition("Name");
         *  NewDefect.SetAttributeValue(nameAttribute, "My New Defect");
         *  services.Save(NewDefect);
         *
         *
         *
         *  return (Connected);
         *
         * }*/

        public V1Connector ConnectToV1()
        {
            InstanceSettings InstanceInfo = new InstanceSettings();

            InstanceInfo = InstanceInfo.GetInstanceSettings();

            V1Connector connector = null;

            if (String.IsNullOrEmpty(InstanceInfo.ProxyURL) == true)
            {
                connector = V1Connector
                            .WithInstanceUrl(InstanceInfo.InstanceURL)
                            .WithUserAgentHeader("V1-Asset-Creator", "1.0")
                            .WithAccessToken(InstanceInfo.AccessToken)
                            .Build();
            }
            else
            {
                Uri           proxyURL      = new Uri(InstanceInfo.ProxyURL);
                ProxyProvider proxySettings = new ProxyProvider(proxyURL,
                                                                InstanceInfo.ProxyUserName,
                                                                InstanceInfo.ProxyPassword);

                connector = V1Connector
                            .WithInstanceUrl(InstanceInfo.InstanceURL)
                            .WithUserAgentHeader("V1-Asset-Creator", "1.0")
                            .WithAccessToken(InstanceInfo.AccessToken)
                            .WithProxy(proxySettings)
                            .Build();
            }

            /*
             * V1Connector connector = V1Connector
             *  .WithInstanceUrl("https://www8.v1host.com/Terrys_Instance052215")
             *  .WithUserAgentHeader("V1-Asset-Creator", "1.0")
             *  .WithAccessToken("1.eqpQfm0root/o7s+lOXLWYK3wCQ=")
             *  .Build();
             */
            return(connector);
        }
Пример #20
0
        public List <Story> GetAll()
        {
            List <Story> storyList = new List <Story>();


            string instanceUrl = "https://www16.v1host.com/api-examples/";
            string accessToken = "1.bndNO51GiliELZu1bbQdq3omgRI=";



            var v1 = V1Connector
                     .WithInstanceUrl(instanceUrl)
                     .WithUserAgentHeader("Examples", "0.1")
                     .WithAccessToken(accessToken);

            var assets = v1.Query("Story")
                         .Select("Name", "Scope", "Estimate", "Description", "Number", "IsClosed")
                         .Retrieve();


            foreach (dynamic story in assets)
            {
                storyList.Add(new Story
                {
                    Href        = story.Oid,
                    Scope       = story.Scope.Oid,
                    Name        = story.Name,
                    Description = story.Description,
                    Number      = story.Number,
                    IsClosed    = Convert.ToBoolean(story.IsClosed)
                                  //Attachments
                                  //Owners
                });
            }


            return(storyList);
        }
Пример #21
0
        private void Connect()
        {
            var settings = VersionOneSettings.FromXmlElement(configuration);

            var connector = V1Connector
                            .WithInstanceUrl(settings.Url)
                            .WithUserAgentHeader("VersionOne.Integration.JIRASync", Assembly.GetEntryAssembly().GetName().Version.ToString());

            ICanSetProxyOrEndpointOrGetConnector connectorWithAuth;

            connectorWithAuth = connector.WithAccessToken(settings.AccessToken);

            if (settings.ProxySettings.Enabled)
            {
                connectorWithAuth.WithProxy(
                    new ProxyProvider(
                        new Uri(settings.ProxySettings.Url), settings.ProxySettings.Username, settings.ProxySettings.Password, settings.ProxySettings.Domain));
            }

            services = new Services(connectorWithAuth.UseOAuthEndpoints().Build());

            queryBuilder.Setup(services);
        }
Пример #22
0
        public void Execute()
        {
            var v1 = V1Connector
                     .WithInstanceUrl(instanceUrl)
                     .WithUserAgentHeader("Examples", "0.1")
                     .WithAccessToken(accessToken);

            var story = v1.Create(new
            {
                AssetType = "Story",
                Scope     = "Scope:0",
                Name      = "My Story",
                Children  = new []
                {
                    new
                    {
                        AssetType = "Test",
                        Name      = "Test"
                    },
                    new
                    {
                        AssetType = "Task",
                        Name      = "Task"
                    }
                }
            });

            dynamic queriedStory = v1
                                   .Query(story.Oid)
                                   .Select("Name", "Scope")
                                   .RetrieveFirst();

            WriteLine(queriedStory.Oid);
            WriteLine(queriedStory.Name);
            WriteLine(queriedStory["Scope"].Oid);
            WriteLine(queriedStory.Scope.Oid);
        }
        public void Execute()
        {
            var connector = V1Connector
                            .WithInstanceUrl(instanceUrl)
                            .WithUserAgentHeader("Examples", "0.1")
                            .WithAccessToken(accessToken)
                            .Build();

            var services       = new Services(connector, true);
            var memberType     = services.Meta.GetAssetType("Publication");
            var query          = new Query(memberType);
            var payloadAttrDef = memberType.GetAttributeDefinition("Payload");

            query.Selection.Add(payloadAttrDef);
            var          filter       = new FilterTerm(payloadAttrDef);
            const string payloadValue = "87e33977-0628-4269-ae6c-4b25af302e19";

            filter.Equal(payloadValue);
            query.Filter = filter;
            var result = services.Retrieve(query);

            Console.WriteLine("Expected Payload value: {0}; Actual Payload value: {1}",
                              payloadValue,
                              result.Assets[0].GetAttribute(payloadAttrDef).Value);

            // Try to set the value to something different via string
            const string newPayloadValue = "962ab714-778c-4130-becb-fe71f56f2448";

            result.Assets[0].SetAttributeValue(payloadAttrDef, newPayloadValue);
            // Now read it again:
            Console.WriteLine("Payload value after modifying with string value: {0}", result.Assets[0].GetAttribute(payloadAttrDef).Value);

            // Try to set the value to something different via an actual Guid
            result.Assets[0].SetAttributeValue(payloadAttrDef, Guid.Parse(newPayloadValue));
            // Now read it again:
            Console.WriteLine("Payload value after modifying with Guid value: {0}", result.Assets[0].GetAttribute(payloadAttrDef).Value);
        }
        public void Execute()
        {
            var v1 = V1Connector
                     .WithInstanceUrl(instanceUrl)
                     .WithUserAgentHeader("Examples", "0.1")
                     .WithAccessToken(accessToken);

            dynamic newStory = v1.Create(new {
                AssetType   = "Story",
                Scope       = "Scope:1015",
                Name        = $"Test Story Scope:1015 Update scalar attribute",
                Description = "I am not going to change this description after it is set"
            });

            dynamic retrievedStory = v1.Query(newStory.Oid).Select("Name", "Description").RetrieveFirst();

            retrievedStory.Name = $"{newStory.Name} - Name updated";

            v1.Update(retrievedStory);

            dynamic updatedRetrievedStory = v1.Query(retrievedStory.Oid).Select("Name", "Description").RetrieveFirst();

            WriteLine($"{newStory.Oid} original name: {newStory.Name}");
            WriteLine($"{retrievedStory.Oid} updated name: {updatedRetrievedStory.Name}");
            WriteLine($"{newStory.Oid} original description: {newStory.Description}");
            WriteLine($"{updatedRetrievedStory.Oid} non-updated description: {updatedRetrievedStory.Description}");

            WriteLine("Now we are going to try updating the original newStory object...");

            newStory.Name = "Test Story Scope:1015 updated on original newStory object!";
            v1.Update(newStory);

            dynamic newStoryFetchedAfterUpdate = v1.Query(newStory.Oid).Select("Name").RetrieveFirst();

            WriteLine($"{newStoryFetchedAfterUpdate.Oid} updated name is: {newStoryFetchedAfterUpdate.Name}");
        }
        public void Execute()
        {
            var v1 = V1Connector
                     .WithInstanceUrl(instanceUrl)
                     .WithUserAgentHeader("Examples", "0.1")
                     .WithAccessToken(accessToken);

            var epicDict = new Dictionary <string, object>()
            {
                { "AssetType", "Epic" },
                { "Scope", "Scope:0" },
                { "Name", "My Epic" },
                { "Subs", new []
                  {
                      new Dictionary <string, object>()
                      {
                          { "AssetType", "Story" },
                          { "Name", "My Epic : My Story 1" },
                          { "Children", new []
                                            {
                                                new Dictionary <string, object>()
                                                {
                                                    { "AssetType", "Test" },
                                                    { "Name", "My Story 1: Test" }
                                                },
                                                new  Dictionary <string, object>()
                                                {
                                                    { "AssetType", "Task" },
                                                    { "Name", "My Story 1: Task" }
                                                }
                                            } }
                      },
                      new Dictionary <string, object>()
                      {
                          { "AssetType", "Story" },
                          { "Name", "My Epic : My Story 2" },
                          { "Children", new []
                                            {
                                                new Dictionary <string, object>()
                                                {
                                                    { "AssetType", "Test" },
                                                    { "Name", "My Story 2: Test" }
                                                },
                                                new  Dictionary <string, object>()
                                                {
                                                    { "AssetType", "Task" },
                                                    { "Name", "My Story 2: Task" }
                                                }
                                            } }
                      }
                  } }
            };

            dynamic epic = v1.Create(epicDict);

            WriteLine("Epic returned from .Create (which does not requery the system, but fills in Oids linearly from server response):");
            PrintEpic(epic);

            epic = v1
                   .Query(epic.Oid)
                   .Select(
                "Name",
                "Scope",
                From("Subs")
                .Select(
                    "AssetType",
                    "Name",
                    From("Children")
                    .Select(
                        "AssetType",
                        "Name"
                        )
                    )
                )
                   .RetrieveFirst();

            WriteLine();
            WriteLine("Epic returned from .Query, requerying the system with subselect syntax to pull in nested relationships:");
            PrintEpic(epic);
        }
Пример #26
0
        public void Execute()
        {
            var v1 = V1Connector
                     .WithInstanceUrl(instanceUrl)
                     .WithUserAgentHeader("Examples", "0.1")
                     .WithAccessToken(accessToken);

            var epic = Asset("Epic", new
            {
                Scope = "Scope:0",
                Name  = "My Epic",
                Subs  = Assets(
                    Asset("Story", new
                {
                    Name     = "My Epic : My Story 1",
                    Children = Assets(
                        Asset("Test", new
                    {
                        Name = "My Story 1: Test"
                    }),
                        Asset("Task", new
                    {
                        Name = "My Story 1: Task"
                    })
                        )
                }),
                    Asset("Story", new
                {
                    Name     = "My Epic : My Story 2",
                    Children = Assets(
                        Asset("Test", new
                    {
                        Name = "My Story 2: Test"
                    }),
                        Asset("Task", new
                    {
                        Name = "My Story 2: Task"
                    })
                        )
                })
                    )
            });

            // TODO: probably should be void in this case
            epic = v1.Create(epic);

            WriteLine("Epic returned from .Create (which does not requery the system, but fills in Oids linearly from server response):");
            PrintEpic(epic);

            epic = v1
                   .Query(epic.Oid)
                   .Select(
                "Name",
                "Scope",
                From("Subs")
                .Select(
                    "AssetType",
                    "Name",
                    From("Children")
                    .Select(
                        "AssetType",
                        "Name"
                        )
                    )
                )
                   .RetrieveFirst();

            WriteLine();
            WriteLine("Epic returned from .Query, requerying the system with subselect syntax to pull in nested relationships:");
            PrintEpic(epic);
        }